aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-05-19 18:42:33 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-05-19 18:42:33 +0000
commit3a11073d6b950e6a87a67996963b41a2f8e860ed (patch)
tree527a7dc887765ccbf6d69ec71c789e207ed761ff
parentaf7304aa79849218a86d1c6a3b035b7575078ebe (diff)
Get info about media type(Video or not) a first step towards usage in rtp statistics.
svn path=/trunk/; revision=28415
-rw-r--r--asn1/h245/packet-h245-template.c4
-rw-r--r--epan/dissectors/packet-ansi_a.c2
-rw-r--r--epan/dissectors/packet-h245.c16
-rw-r--r--epan/dissectors/packet-h245.h2
-rw-r--r--epan/dissectors/packet-rtp.c14
-rw-r--r--epan/dissectors/packet-rtp.h17
-rw-r--r--epan/dissectors/packet-rtsp.c3
-rw-r--r--epan/dissectors/packet-sdp.c13
-rw-r--r--epan/dissectors/packet-skinny.c5
-rw-r--r--epan/dissectors/packet-uma.c2
-rw-r--r--plugins/unistim/packet-unistim.c2
11 files changed, 54 insertions, 26 deletions
diff --git a/asn1/h245/packet-h245-template.c b/asn1/h245/packet-h245-template.c
index b5c822eda7..9f8b4389a3 100644
--- a/asn1/h245/packet-h245-template.c
+++ b/asn1/h245/packet-h245-template.c
@@ -224,6 +224,7 @@ typedef struct _channel_info_t {
unicast_addr_t media_control_addr;
unsigned int rfc2198;
gboolean srtp_flag;
+ gboolean is_video;
} channel_info_t;
typedef struct _olc_info_t {
@@ -352,10 +353,11 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha
if (upcoming_channel->srtp_flag) {
dummy_srtp_info = se_alloc0(sizeof(struct srtp_info));
}
+ /* FIX ME indicate if Video - temp always false */
if (upcoming_channel->media_addr.addr.type!=AT_NONE && upcoming_channel->media_addr.port!=0 && rtp_handle) {
srtp_add_address(pinfo, &upcoming_channel->media_addr.addr,
upcoming_channel->media_addr.port, 0,
- "H245", pinfo->fd->num, rtp_dyn_payload, dummy_srtp_info);
+ "H245", pinfo->fd->num, /*upcoming_channel->is_video*/ FALSE, rtp_dyn_payload, dummy_srtp_info);
}
if (upcoming_channel->media_control_addr.addr.type!=AT_NONE && upcoming_channel->media_control_addr.port!=0 && rtcp_handle) {
srtcp_add_address(pinfo, &upcoming_channel->media_control_addr.addr,
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index c9b0b019f8..95d443bc63 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -8313,7 +8313,7 @@ elem_a2p_bearer_format(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint le
first_assigned_found = TRUE;
rtp_add_address(g_pinfo, &rtp_src_addr, rtp_port, 0, "IOS5",
- g_pinfo->fd->num, rtp_dyn_payload);
+ g_pinfo->fd->num, FALSE, rtp_dyn_payload);
}
num_bearers++;
diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c
index 99cfda6932..1c1a4b5bdb 100644
--- a/epan/dissectors/packet-h245.c
+++ b/epan/dissectors/packet-h245.c
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-h245.c */
-/* ../../tools/asn2wrs.py -e -p h245 -c ./h245.cnf -s ./packet-h245-template -D . MULTIMEDIA-SYSTEM-CONTROL.asn */
+/* ../../tools/asn2wrs.py -e -p h245 -c h245.cnf -s packet-h245-template MULTIMEDIA-SYSTEM-CONTROL.asn */
/* Input file: packet-h245-template.c */
@@ -355,6 +355,7 @@ typedef struct _channel_info_t {
unicast_addr_t media_control_addr;
unsigned int rfc2198;
gboolean srtp_flag;
+ gboolean is_video;
} channel_info_t;
typedef struct _olc_info_t {
@@ -483,10 +484,11 @@ static void h245_setup_channels(packet_info *pinfo, channel_info_t *upcoming_cha
if (upcoming_channel->srtp_flag) {
dummy_srtp_info = se_alloc0(sizeof(struct srtp_info));
}
+ /* FIX ME indicate if Video - temp always false */
if (upcoming_channel->media_addr.addr.type!=AT_NONE && upcoming_channel->media_addr.port!=0 && rtp_handle) {
srtp_add_address(pinfo, &upcoming_channel->media_addr.addr,
upcoming_channel->media_addr.port, 0,
- "H245", pinfo->fd->num, rtp_dyn_payload, dummy_srtp_info);
+ "H245", pinfo->fd->num, /*upcoming_channel->is_video*/ FALSE, rtp_dyn_payload, dummy_srtp_info);
}
if (upcoming_channel->media_control_addr.addr.type!=AT_NONE && upcoming_channel->media_control_addr.port!=0 && rtcp_handle) {
srtcp_add_address(pinfo, &upcoming_channel->media_control_addr.addr,
@@ -1902,7 +1904,7 @@ static int hf_h245_encrypted = -1; /* OCTET_STRING */
static int hf_h245_encryptedAlphanumeric = -1; /* EncryptedAlphanumeric */
/*--- End of included file: packet-h245-hf.c ---*/
-#line 370 "packet-h245-template.c"
+#line 372 "packet-h245-template.c"
/* Initialize the subtree pointers */
static int ett_h245 = -1;
@@ -2403,7 +2405,7 @@ static gint ett_h245_FlowControlIndication = -1;
static gint ett_h245_MobileMultilinkReconfigurationIndication = -1;
/*--- End of included file: packet-h245-ett.c ---*/
-#line 375 "packet-h245-template.c"
+#line 377 "packet-h245-template.c"
/* Forward declarations */
static int dissect_h245_MultimediaSystemControlMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_);
@@ -14442,7 +14444,7 @@ static void dissect_OpenLogicalChannel_PDU(tvbuff_t *tvb _U_, packet_info *pinfo
/*--- End of included file: packet-h245-fn.c ---*/
-#line 384 "packet-h245-template.c"
+#line 386 "packet-h245-template.c"
static void
dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
@@ -20125,7 +20127,7 @@ void proto_register_h245(void) {
"h245.EncryptedAlphanumeric", HFILL }},
/*--- End of included file: packet-h245-hfarr.c ---*/
-#line 462 "packet-h245-template.c"
+#line 464 "packet-h245-template.c"
};
/* List of subtrees */
@@ -20628,7 +20630,7 @@ void proto_register_h245(void) {
&ett_h245_MobileMultilinkReconfigurationIndication,
/*--- End of included file: packet-h245-ettarr.c ---*/
-#line 469 "packet-h245-template.c"
+#line 471 "packet-h245-template.c"
};
module_t *h245_module;
diff --git a/epan/dissectors/packet-h245.h b/epan/dissectors/packet-h245.h
index 386f1d0775..4376792099 100644
--- a/epan/dissectors/packet-h245.h
+++ b/epan/dissectors/packet-h245.h
@@ -1,7 +1,7 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* packet-h245.h */
-/* ../../tools/asn2wrs.py -e -p h245 -c ./h245.cnf -s ./packet-h245-template -D . MULTIMEDIA-SYSTEM-CONTROL.asn */
+/* ../../tools/asn2wrs.py -e -p h245 -c h245.cnf -s packet-h245-template MULTIMEDIA-SYSTEM-CONTROL.asn */
/* Input file: packet-h245-template.h */
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 8e35df5f39..d16abfb8a4 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -374,7 +374,7 @@ rtp_free_hash_dyn_payload(GHashTable *rtp_dyn_payload)
void srtp_add_address(packet_info *pinfo,
address *addr, int port,
int other_port,
- const gchar *setup_method, guint32 setup_frame_number, GHashTable *rtp_dyn_payload,
+ const gchar *setup_method, guint32 setup_frame_number, gboolean is_video _U_, GHashTable *rtp_dyn_payload,
struct srtp_info *srtp_info)
{
address null_addr;
@@ -446,6 +446,7 @@ void srtp_add_address(packet_info *pinfo,
g_strlcpy(p_conv_data->method, setup_method, MAX_RTP_SETUP_METHOD_SIZE+1);
p_conv_data->frame_number = setup_frame_number;
+ p_conv_data->is_video = is_video;
p_conv_data->rtp_dyn_payload = rtp_dyn_payload;
p_conv_data->srtp_info = srtp_info;
}
@@ -454,9 +455,9 @@ void srtp_add_address(packet_info *pinfo,
void rtp_add_address(packet_info *pinfo,
address *addr, int port,
int other_port,
- const gchar *setup_method, guint32 setup_frame_number, GHashTable *rtp_dyn_payload)
+ const gchar *setup_method, guint32 setup_frame_number, gboolean is_video , GHashTable *rtp_dyn_payload)
{
- srtp_add_address(pinfo, addr, port, other_port, setup_method, setup_frame_number, rtp_dyn_payload, NULL);
+ srtp_add_address(pinfo, addr, port, other_port, setup_method, setup_frame_number, is_video, rtp_dyn_payload, NULL);
}
static gboolean
@@ -1028,6 +1029,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
rtp_info->info_padding_set = padding_set;
rtp_info->info_padding_count = 0;
rtp_info->info_marker_set = marker_set;
+ rtp_info->info_is_video = FALSE;
rtp_info->info_payload_type = payload_type;
rtp_info->info_seq_num = seq_num;
rtp_info->info_timestamp = timestamp;
@@ -1073,6 +1075,9 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
get_conv_info(pinfo, rtp_info);
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
+ if (p_conv_data)
+ rtp_info->info_is_video = p_conv_data->is_video;
+
if (p_conv_data && p_conv_data->srtp_info) is_srtp = TRUE;
rtp_info->info_is_srtp = is_srtp;
@@ -1082,6 +1087,8 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
/* check if this is added as an SRTP stream - if so, don't try to dissector the payload data for now */
p_conv_data = p_get_proto_data(pinfo->fd, proto_rtp);
+
+
if (p_conv_data && p_conv_data->srtp_info) {
srtp_info = p_conv_data->srtp_info;
if (rtp_info->info_all_data_present) {
@@ -1341,6 +1348,7 @@ static void get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info)
p_conv_packet_data = se_alloc(sizeof(struct _rtp_conversation_info));
g_strlcpy(p_conv_packet_data->method, p_conv_data->method, MAX_RTP_SETUP_METHOD_SIZE+1);
p_conv_packet_data->frame_number = p_conv_data->frame_number;
+ p_conv_packet_data->is_video = p_conv_data->is_video;
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;
diff --git a/epan/dissectors/packet-rtp.h b/epan/dissectors/packet-rtp.h
index 156667d2c6..be06dacc90 100644
--- a/epan/dissectors/packet-rtp.h
+++ b/epan/dissectors/packet-rtp.h
@@ -31,6 +31,7 @@ struct _rtp_info {
unsigned int info_version;
gboolean info_padding_set;
gboolean info_marker_set;
+ gboolean info_is_video;
unsigned int info_payload_type;
unsigned int info_padding_count;
guint16 info_seq_num;
@@ -99,15 +100,17 @@ struct srtp_info
struct _rtp_conversation_info
{
gchar method[MAX_RTP_SETUP_METHOD_SIZE + 1];
- guint32 frame_number; /* the frame where this conversation is started */
- GHashTable *rtp_dyn_payload; /* a hash table with the dynamic RTP payload */
+ guint32 frame_number; /* the frame where this conversation is started */
+ gboolean is_video;
+ GHashTable *rtp_dyn_payload; /* a hash table with the dynamic RTP payload */
- guint32 extended_seqno; /* the sequence number, extended to a 32-bit
- * int to guarantee it increasing monotonically
- */
+ guint32 extended_seqno; /* the sequence number, extended to a 32-bit
+ * int to guarantee it increasing monotonically
+ */
struct _rtp_private_conv_info *rtp_conv_info; /* conversation info private
- * to the rtp dissector */
+ * to the rtp dissector
+ */
struct srtp_info *srtp_info; /* SRTP context */
};
@@ -117,6 +120,7 @@ void rtp_add_address(packet_info *pinfo,
int other_port,
const gchar *setup_method,
guint32 setup_frame_number,
+ gboolean is_video,
GHashTable *rtp_dyn_payload);
/* Add an SRTP conversation with the given details */
@@ -125,6 +129,7 @@ void srtp_add_address(packet_info *pinfo,
int other_port,
const gchar *setup_method,
guint32 setup_frame_number,
+ gboolean is_video,
GHashTable *rtp_dyn_payload,
struct srtp_info *srtp_info);
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c
index 08107248cb..ad7ec57989 100644
--- a/epan/dissectors/packet-rtsp.c
+++ b/epan/dissectors/packet-rtsp.c
@@ -341,6 +341,7 @@ rtsp_create_conversation(packet_info *pinfo, const guchar *line_begin,
gboolean rdt_transport = FALSE;
guint c_data_port, c_mon_port;
guint s_data_port, s_mon_port;
+ gboolean is_video = FALSE; /* FIX ME - need to indicate video or not */
/* Copy line into buf */
if (line_len > sizeof(buf) - 1)
@@ -473,7 +474,7 @@ rtsp_create_conversation(packet_info *pinfo, const guchar *line_begin,
{
/* There is always data for RTP */
rtp_add_address(pinfo, &pinfo->dst, c_data_port, s_data_port,
- "RTSP", pinfo->fd->num, NULL);
+ "RTSP", pinfo->fd->num, is_video, NULL);
/* RTCP only if indicated */
if (c_mon_port)
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index e7a0c47384..efefd873ff 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -204,6 +204,7 @@ typedef struct {
typedef struct {
char *connection_address;
char *connection_type;
+ char *media_type;
char *encoding_name[SDP_NO_OF_PT];
char *media_port[SDP_MAX_RTP_CHANNELS];
char *media_proto[SDP_MAX_RTP_CHANNELS];
@@ -276,6 +277,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean set_rtp=FALSE;
gboolean is_ipv4_addr=FALSE;
gboolean is_ipv6_addr=FALSE;
+ gboolean is_video=FALSE;
guint32 ipaddr[4];
gint n,i;
sdp_packet_info *sdp_pi;
@@ -287,6 +289,7 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Initialise RTP channel info */
transport_info.connection_address=NULL;
transport_info.connection_type=NULL;
+ transport_info.media_type=NULL;
for (n=0; n < SDP_NO_OF_PT; n++){
transport_info.encoding_name[n]=NULL;
}
@@ -483,6 +486,9 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
}
+ if (strcmp(transport_info.media_type,"video")==0){
+ is_video = TRUE;
+ }
set_rtp = FALSE;
/* Add (s)rtp and (s)rtcp conversation, if available (overrides t38 if conversation already set) */
if((!pinfo->fd->flags.visited) && port!=0 && (is_rtp||is_srtp) && (is_ipv4_addr || is_ipv6_addr)){
@@ -490,10 +496,10 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(rtp_handle){
if (is_srtp) {
struct srtp_info *dummy_srtp_info = se_alloc0(sizeof(struct srtp_info));
- srtp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num,
+ srtp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num, is_video,
transport_info.media[n].rtp_dyn_payload, dummy_srtp_info);
} else {
- rtp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num,
+ rtp_add_address(pinfo, &src_addr, port, 0, "SDP", pinfo->fd->num, is_video,
transport_info.media[n].rtp_dyn_payload);
}
set_rtp = TRUE;
@@ -1021,6 +1027,7 @@ static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, pr
}
}
+
/* Dissect media description */
static void
dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
@@ -1050,6 +1057,8 @@ dissect_sdp_media(tvbuff_t *tvb, proto_item *ti,
proto_tree_add_item(sdp_media_tree, hf_media_media, tvb, offset, tokenlen,
FALSE);
+ transport_info->media_type = (char*)tvb_get_ephemeral_string(tvb, offset, tokenlen);
+
offset = next_offset + 1;
next_offset = tvb_find_guint8(tvb,offset, -1, ' ');
diff --git a/epan/dissectors/packet-skinny.c b/epan/dissectors/packet-skinny.c
index a760b414e0..c8454bfc28 100644
--- a/epan/dissectors/packet-skinny.c
+++ b/epan/dissectors/packet-skinny.c
@@ -1200,6 +1200,7 @@ static void
dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
+ gboolean is_video = FALSE; /* FIX ME: need to indicate video or not */
/* Header fields */
guint32 hdr_data_length;
@@ -1423,7 +1424,7 @@ dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
src_addr.len=4;
src_addr.data=(guint8 *)&ipv4_address;
ipv4_address = tvb_get_ipv4(tvb, offset+16);
- rtp_add_address(pinfo, &src_addr, tvb_get_letohl(tvb, offset+20), 0, "Skinny", pinfo->fd->num, NULL);
+ rtp_add_address(pinfo, &src_addr, tvb_get_letohl(tvb, offset+20), 0, "Skinny", pinfo->fd->num, is_video, NULL);
}
si->passThruId = tvb_get_letohl(tvb, offset+24);
break;
@@ -1821,7 +1822,7 @@ dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
src_addr.len=4;
src_addr.data=(char *)&ipv4_address;
ipv4_address = tvb_get_ipv4(tvb, offset+20);
- rtp_add_address(pinfo, &src_addr, tvb_get_letohl(tvb, offset+24), 0, "Skinny", pinfo->fd->num, NULL);
+ rtp_add_address(pinfo, &src_addr, tvb_get_letohl(tvb, offset+24), 0, "Skinny", pinfo->fd->num, is_video, NULL);
}
si->passThruId = tvb_get_letohl(tvb, offset+16);
break;
diff --git a/epan/dissectors/packet-uma.c b/epan/dissectors/packet-uma.c
index 772bb3f347..81926392ea 100644
--- a/epan/dissectors/packet-uma.c
+++ b/epan/dissectors/packet-uma.c
@@ -1581,7 +1581,7 @@ dissect_uma_IE(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
}
if((!pinfo->fd->flags.visited) && RTP_UDP_port!=0 && rtp_handle){
- rtp_add_address(pinfo, &src_addr, RTP_UDP_port, 0, "UMA", pinfo->fd->num, 0);
+ rtp_add_address(pinfo, &src_addr, RTP_UDP_port, 0, "UMA", pinfo->fd->num, FALSE, 0);
if ((RTP_UDP_port & 0x1) == 0){ /* Even number RTP port RTCP should follow on odd number */
RTCP_UDP_port = RTP_UDP_port + 1;
rtcp_add_address(pinfo, &src_addr, RTCP_UDP_port, 0, "UMA", pinfo->fd->num);
diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c
index 86460e18a1..4dae72d057 100644
--- a/plugins/unistim/packet-unistim.c
+++ b/plugins/unistim/packet-unistim.c
@@ -2237,7 +2237,7 @@ dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
SET_ADDRESS(&far_addr, AT_IPv4, 4, &far_ip_addr);
far_port = tvb_get_ntohs(tvb, offset-8);
- rtp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num, NULL);
+ rtp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num, FALSE, NULL);
far_port = tvb_get_ntohs(tvb, offset-6);
rtcp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num);