if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
srtp_add_address(pinfo, PT_UDP, &upcoming_channel_lcl->media_addr.addr,
upcoming_channel_lcl->media_addr.port, 0,
- "H245", pinfo->num, upcoming_channel_lcl->is_video , rtp_dyn_payload, dummy_srtp_info);
+ "H245", pinfo->num, upcoming_channel_lcl->is_video , rtp_dyn_payload, dummy_srtp_info, NULL);
}
if (upcoming_channel_lcl->media_control_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_control_addr.port!=0 && rtcp_handle) {
srtcp_add_address(pinfo, &upcoming_channel_lcl->media_control_addr.addr,
if (upcoming_channel_lcl->media_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_addr.port!=0) {
srtp_add_address(pinfo, PT_UDP, &upcoming_channel_lcl->media_addr.addr,
upcoming_channel_lcl->media_addr.port, 0,
- "H245", pinfo->num, upcoming_channel_lcl->is_video , rtp_dyn_payload, dummy_srtp_info);
+ "H245", pinfo->num, upcoming_channel_lcl->is_video , rtp_dyn_payload, dummy_srtp_info, NULL);
}
if (upcoming_channel_lcl->media_control_addr.addr.type!=AT_NONE && upcoming_channel_lcl->media_control_addr.port!=0 && rtcp_handle) {
srtcp_add_address(pinfo, &upcoming_channel_lcl->media_control_addr.addr,
HTTP_REQUEST,
HTTP_RESPONSE,
HTTP_NOTIFICATION,
- HTTP_OTHERS
+ HTTP_OTHERS,
+ SIP_DATA /* If the content is from the SIP dissector*/
} http_type_t;
/** Passed to dissectors called by the HTTP dissector. */
typedef struct _http_message_info_t {
- http_type_t type; /* Message type; may be HTTP_OTHERS if not called by HTTP */
- const char *media_str; /* Content-Type parameters */
+ http_type_t type; /**< Message type; may be HTTP_OTHERS if not called by HTTP */
+ const char *media_str; /**< Content-Type parameters */
+ void *data; /**< The http_type is used to indicate the data transported */
} http_message_info_t;
#endif /* __PACKET_HTTP_H__ */
{
http2_data_stream_body_info_t *body_info = get_data_stream_body_info(pinfo);
gchar *content_type = body_info->content_type;
- http_message_info_t metadata_used_for_media_type_handle = { HTTP_OTHERS, body_info->content_type_parameters };
+ http_message_info_t metadata_used_for_media_type_handle = { HTTP_OTHERS, body_info->content_type_parameters, NULL };
proto_tree_add_item(tree, hf_http2_data_data, tvb, start, length, encoding);
message_info.type = HTTP_OTHERS;
message_info.media_str = parameters;
+ message_info.data = NULL;
dissector_try_string(media_type_dissector_table, content_type_str, next_tvb, pinfo, tree, (void*)&message_info);
} else {
gchar *mediatype = wmem_strdup(wmem_packet_scope(), fullmediatype);
gchar *parms_at = strchr(mediatype, ';');
const char *save_match_string = pinfo->match_string;
- http_message_info_t message_info = { HTTP_OTHERS, NULL };
+ http_message_info_t message_info = { HTTP_OTHERS, NULL, NULL };
/* Based upon what is done in packet-media.c we set up type and params */
if (NULL != parms_at) {
int found_match = 0;
gint content_type_len, content_type_parameter_str_len;
gchar *media_type_str_lower_case = NULL;
- http_message_info_t message_info = { HTTP_OTHERS, NULL };
+ http_message_info_t message_info = { HTTP_OTHERS, NULL, NULL };
tvbuff_t *next_tvb;
gint parameter_offset;
gint semi_colon_offset;
proto_tree *subtree;
proto_item *ti;
gint offset = start, next_offset = 0;
- http_message_info_t message_info = { input_message_info->type, NULL };
+ http_message_info_t message_info = { input_message_info->type, NULL, NULL };
gint body_start, boundary_start, boundary_line_len;
gchar *content_type_str = NULL;
static dissector_table_t rtp_hdr_ext_dissector_table;
static dissector_table_t rtp_hdr_ext_rfc5285_dissector_table;
+/* Used for storing data to be retreived by the SDP dissector*/
+static int proto_sdp = -1;
+
/* RTP header fields */
static int proto_rtp = -1;
static int hf_rtp_version = -1;
srtp_add_address(packet_info *pinfo, const port_type ptype, address *addr, int port, int other_port,
const gchar *setup_method, guint32 setup_frame_number,
guint32 media_types _U_, rtp_dyn_payload_t *rtp_dyn_payload,
- struct srtp_info *srtp_info)
+ struct srtp_info *srtp_info, sdp_setup_info_t *setup_info)
{
address null_addr;
conversation_t* p_conv;
p_conv_data->frame_number = setup_frame_number;
p_conv_data->media_types = media_types;
p_conv_data->srtp_info = srtp_info;
+ if (setup_info) {
+ p_conv_data->setup_info = setup_info;
+ }
p_conv_data->bta2dp_info = NULL;
p_conv_data->btvdp_info = NULL;
}
const gchar *setup_method, guint32 setup_frame_number,
guint32 media_types , rtp_dyn_payload_t *rtp_dyn_payload)
{
- srtp_add_address(pinfo, ptype, addr, port, other_port, setup_method, setup_frame_number, media_types, rtp_dyn_payload, NULL);
+ srtp_add_address(pinfo, ptype, addr, port, other_port, setup_method, setup_frame_number, media_types, rtp_dyn_payload, NULL, NULL);
}
static gboolean
p_conv_packet_data->rtp_dyn_payload = p_conv_data->rtp_dyn_payload;
p_conv_packet_data->rtp_conv_info = p_conv_data->rtp_conv_info;
p_conv_packet_data->srtp_info = p_conv_data->srtp_info;
+ p_conv_packet_data->setup_info = p_conv_data->setup_info;
p_conv_packet_data->bta2dp_info = p_conv_data->bta2dp_info;
p_conv_packet_data->btvdp_info = p_conv_data->btvdp_info;
/* XXX: why is this file pool not pinfo->pool? */
item = proto_tree_add_string(rtp_setup_tree, hf_rtp_setup_method,
tvb, 0, 0, p_conv_data->method);
PROTO_ITEM_SET_GENERATED(item);
+
+ if ((p_conv_data->setup_info) && (p_conv_data->setup_info->hf_id)) {
+ if (p_conv_data->setup_info->hf_type == SDP_TRACE_ID_HF_TYPE_STR ) {
+ item = proto_tree_add_string(rtp_setup_tree, p_conv_data->setup_info->hf_id, tvb, 0, 0, p_conv_data->setup_info->trace_id);
+ PROTO_ITEM_SET_GENERATED(item);
+ }
+
+ }
}
}
}
dissector_add_uint("rtp.pt", rtp_rfc2198_pt, rtp_rfc2198_handle);
rtp_saved_rfc2198_pt = rtp_rfc2198_pt;
+ proto_sdp = proto_get_id_by_filter_name("sdp");
}
/*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
+#ifndef __PACKET_RTP_H__
+#define __PACKET_RTP_H__
+
#include "epan/packet.h"
#include "ws_symbol_export.h"
#include "packet-btavdtp.h"
-
+#include "packet-sdp.h"
#define RTP_MEDIA_AUDIO 1
#define RTP_MEDIA_VIDEO 2
#endif
/* Info to save in RTP conversation / packet-info */
-#define MAX_RTP_SETUP_METHOD_SIZE 7
+#define MAX_RTP_SETUP_METHOD_SIZE 11
struct _rtp_conversation_info
{
gchar method[MAX_RTP_SETUP_METHOD_SIZE + 1];
struct srtp_info *srtp_info; /* SRTP context */
bta2dp_codec_info_t *bta2dp_info;
btvdp_codec_info_t *btvdp_info;
+ sdp_setup_info_t *setup_info;
};
/* Add an RTP conversation with the given details */
guint32 setup_frame_number,
guint32 media_types,
rtp_dyn_payload_t *rtp_dyn_payload,
- struct srtp_info *srtp_info);
+ struct srtp_info *srtp_info,
+ sdp_setup_info_t *setup_info);
/* Add an Bluetooth conversation with the given details */
void
bluetooth_add_address(packet_info *pinfo, address *addr, guint32 stream_number,
const gchar *setup_method, guint32 setup_frame_number,
guint32 media_types, void *data);
+
+#endif /*__PACKET_RTP_H__*/
#include <wsutil/strtoi.h>
+#include "packet-http.h"
#include "packet-sdp.h"
/* un-comment the following as well as this line in conversation.c, to enable debug printing */
* are not freed, this is the responsibility of the caller.
*/
static void
-apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int request_frame)
+apply_sdp_transport(packet_info *pinfo, transport_info_t *transport_info, int request_frame, sdp_setup_info_t *setup_info)
{
int establish_frame = 0;
because that's where the RTP flow started, and thus conversation needs to check against */
srtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame,
media_desc->media_types,
- media_desc->media.rtp_dyn_payload, srtp_info);
+ media_desc->media.rtp_dyn_payload, srtp_info,
+ setup_info);
DENDENT();
} else {
DPRINT(("calling rtp_add_address, channel=%d, media_port=%d",
i, media_desc->media_port));
DINDENT();
- rtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame,
+ srtp_add_address(pinfo, PT_UDP, &media_desc->conn_addr, media_desc->media_port, 0, "SDP", establish_frame,
media_desc->media_types,
- media_desc->media.rtp_dyn_payload);
+ media_desc->media.rtp_dyn_payload, NULL, setup_info);
DENDENT();
}
/* SPRT might use the same port... */
void
setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type exchange_type,
- int request_frame, const gboolean delay)
+ int request_frame, const gboolean delay, sdp_setup_info_t *setup_info)
{
gint offset = 0, next_offset, n;
int linelen;
if (!delay || ((exchange_type == SDP_EXCHANGE_ANSWER_ACCEPT) &&
(transport_info->sdp_status == SDP_EXCHANGE_OFFER))) {
/* Accepting answer to a previous offer (or delay pref is false). */
- apply_sdp_transport(pinfo, transport_info, request_frame);
+ apply_sdp_transport(pinfo, transport_info, request_frame, setup_info);
/* Free all media hash tables that were not assigned to a conversation
* ('set_rtp' is false) */
}
static int
-dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
+dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
proto_tree *sdp_tree;
proto_item *ti, *sub_ti;
media_description_t *media_desc = NULL;
session_info_t session_info;
sdp_packet_info *sdp_pi;
+ sdp_setup_info_t *setup_info = NULL;
+
+ if (data) {
+ http_message_info_t *message_info = (http_message_info_t *)data;
+ if (message_info->type == SIP_DATA) {
+ setup_info = (sdp_setup_info_t *)message_info->data;
+ }
+ }
DPRINT2(("----------------------- dissect_sdp ------------------------"));
* not an earlier request (transport_info == &local_transport_info).
* Use 0 as request_frame since there is no (known) request.
*/
- apply_sdp_transport(pinfo, transport_info, 0);
+ apply_sdp_transport(pinfo, transport_info, 0, setup_info);
}
/* Add information to the VoIP Calls dialog. */
* SPDX-License-Identifier: GPL-2.0-or-later
*/
+#ifndef __PACKET_SDP_H__
+#define __PACKET_SDP_H__
+
typedef struct _sdp_packet_info {
- gchar summary_str[50]; /* SDP summary string for VoIP calls graph analysis */
+ gchar summary_str[50]; /* SDP summary string for VoIP calls graph analysis */
} sdp_packet_info;
enum sdp_exchange_type
SDP_EXCHANGE_ANSWER_REJECT
};
-extern void setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type type, int request_frame, const gboolean delay);
+enum sdp_trace_id_hf_type
+{
+ SDP_TRACE_ID_HF_TYPE_STR = 0 /* */
+};
+
+/*
+ * Information needed to set up a trace id in RTP(t ex SIP CallId )
+ */
+typedef struct _sdp_setup_info {
+ gchar *setup_proto;
+ int hf_id; /* Header field to use */
+ enum sdp_trace_id_hf_type hf_type; /* Indicates which of the following variables to use( add guint32 etc as needed)*/
+ gchar *trace_id; /* The trace id if the type is str*/
+} sdp_setup_info_t;
+
+extern void setup_sdp_transport(tvbuff_t *tvb, packet_info *pinfo, enum sdp_exchange_type type, int request_frame, const gboolean delay, sdp_setup_info_t *setup_info);
/* Handles duplicate OFFER packets so they don't end up processed by dissect_sdp(). This can probably
* be removed when all higher layer dissectors properly handle SDP themselves with setup_sdp_transport()
*/
extern void setup_sdp_transport_resend(int current_frame, int request_frame);
+
+#endif /* __PACKET_SDP_H__ */
char cseq_method[MAX_CSEQ_METHOD_SIZE] = "";
char call_id[MAX_CALL_ID_SIZE] = "";
gchar *media_type_str_lower_case = NULL;
- http_message_info_t message_info = { HTTP_OTHERS, NULL };
+ http_message_info_t message_info = { SIP_DATA, NULL, NULL };
char *content_encoding_parameter_str = NULL;
guint resend_for_packet = 0;
guint request_for_response = 0;
if (!strcmp(media_type_str_lower_case, "application/sdp")) {
/* Resends don't count */
if (resend_for_packet == 0) {
+ sdp_setup_info_t *setup_info = wmem_new(wmem_file_scope(), sdp_setup_info_t);
+
+ setup_info->setup_proto = g_strdup("SIP");
+ setup_info->hf_id = hf_header_array[POS_CALL_ID];
+ setup_info->hf_type = SDP_TRACE_ID_HF_TYPE_STR;
+ setup_info->trace_id = wmem_strdup(wmem_file_scope(), call_id);
+ message_info.data = setup_info;
+
if (line_type == REQUEST_LINE) {
DPRINT(("calling setup_sdp_transport() SDP_EXCHANGE_OFFER frame=%d",
pinfo->num));
DINDENT();
- setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_OFFER, pinfo->num, sip_delay_sdp_changes);
+ setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_OFFER, pinfo->num, sip_delay_sdp_changes, setup_info);
DENDENT();
} else if (line_type == STATUS_LINE) {
if (stat_info->response_code >= 400) {
request_for_response, pinfo->num));
DINDENT();
/* SIP client request failed, so SDP offer should fail */
- setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_REJECT, request_for_response, sip_delay_sdp_changes);
+ setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_REJECT, request_for_response, sip_delay_sdp_changes, setup_info);
DENDENT();
}
else if ((stat_info->response_code >= 200) && (stat_info->response_code <= 299)) {
request_for_response, pinfo->num));
DINDENT();
/* SIP success request, so SDP offer should be accepted */
- setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_ACCEPT, request_for_response, sip_delay_sdp_changes);
+ setup_sdp_transport(next_tvb, pinfo, SDP_EXCHANGE_ANSWER_ACCEPT, request_for_response, sip_delay_sdp_changes, setup_info);
DENDENT();
}
}
}
message_info.type = si->message_type;
message_info.media_str = media_str;
+ message_info.data = NULL;
if (handle != NULL) {
/*
* We have a subdissector - call it.
dummy_srtp_info->auth_tag_len = 4;
srtp_add_address(pinfo, PT_UDP, &pinfo->net_src, pinfo->srcport, pinfo->destport,
- "ZRTP", pinfo->num, RTP_MEDIA_AUDIO, NULL, dummy_srtp_info);
+ "ZRTP", pinfo->num, RTP_MEDIA_AUDIO, NULL, dummy_srtp_info, NULL);
srtp_add_address(pinfo, PT_UDP, &pinfo->net_dst, pinfo->destport, pinfo->srcport,
- "ZRTP", pinfo->num, RTP_MEDIA_AUDIO, NULL, dummy_srtp_info);
+ "ZRTP", pinfo->num, RTP_MEDIA_AUDIO, NULL, dummy_srtp_info, NULL);
srtcp_add_address(pinfo, &pinfo->net_src, pinfo->srcport+1, pinfo->destport+1,
"ZRTP", pinfo->num, dummy_srtp_info);