Wireshark-dev: [Wireshark-dev] COS DSCP Column patch
From: "Thomas Sillaber" <Thomas.Sillaber@xxxxxx>
Date: Sat, 09 Dec 2006 12:20:03 +0100
Index: gtk/voip_calls.c
===================================================================
--- gtk/voip_calls.c (revision 20080)
+++ gtk/voip_calls.c (working copy)
@@ -82,14 +82,15 @@
};
/* defines whether we can consider the call active */
-const char *voip_protocol_name[7]={
+const char *voip_protocol_name[8]={
"SIP",
"ISUP",
"H.323",
"MGCP",
"AC_ISDN",
"AC_CAS",
- "T.38"
+ "T.38",
+ "UAUDP"
};
typedef struct {
@@ -2678,6 +2679,70 @@
}
/****************************************************************************/
+/* ***************************TAP for UAUDP **********************************/
+/****************************************************************************/
+
+/****************************************************************************/
+/* whenever a prot_ packet is seen by the tap listener */
+
+static int
+uaudp_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *uaudp_info _U_)
+{
+ voip_calls_info_t *strinfo = NULL;
+ voip_calls_tapinfo_t *tapinfo = &the_tapinfo_struct;
+ if (strinfo!=NULL){
+ strinfo->stop_sec=pinfo->fd->rel_ts.secs;
+ strinfo->stop_usec=pinfo->fd->rel_ts.nsecs/1000;
+ strinfo->last_frame_num=pinfo->fd->num;
+ strinfo->last_frame_num=pinfo->fd->num;
+ ++(strinfo->npackets);
+ ++(tapinfo->npackets);
+ }
+
+ tapinfo->redraw = TRUE;
+
+ return 1;
+}
+/****************************************************************************/
+
+static gboolean have_uaudp_tap_listener=FALSE;
+
+void
+uaudp_calls_init_tap(void)
+{
+ GString *error_string;
+
+ if(have_uaudp_tap_listener==FALSE)
+ {
+ error_string = register_tap_listener("uaudp", &(the_tapinfo_struct.uaudp_dummy),
+ NULL,
+ voip_calls_dlg_reset,
+ uaudp_calls_packet,
+ voip_calls_dlg_draw
+ );
+
+ if (error_string != NULL) {
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
+ error_string->str);
+ g_string_free(error_string, TRUE);
+ exit(1);
+ }
+ have_uaudp_tap_listener=TRUE;
+ }
+}
+/****************************************************************************/
+
+void
+remove_tap_listener_uaudp_calls(void)
+{
+ protect_thread_critical_region();
+ remove_tap_listener(&(the_tapinfo_struct.uaudp_dummy));
+ unprotect_thread_critical_region();
+
+ have_uaudp_tap_listener=FALSE;
+}
+
+/****************************************************************************/
/* ***************************TAP for OTHER PROTOCOL **********************************/
/****************************************************************************/
Index: gtk/voip_calls.h
===================================================================
--- gtk/voip_calls.h (revision 20080)
+++ gtk/voip_calls.h (working copy)
@@ -67,10 +67,11 @@
VOIP_MGCP,
VOIP_AC_ISDN,
VOIP_AC_CAS,
- MEDIA_T38
+ MEDIA_T38,
+ VOIP_UAUDP
} voip_protocol;
-extern const char *voip_protocol_name[7];
+extern const char *voip_protocol_name[8];
/* defines specific SIP data */
@@ -177,6 +178,8 @@
int mgcp_dummy;
int actrace_dummy;
int t38_dummy;
+ /*test*/
+ int uaudp_dummy;
} voip_calls_tapinfo_t;
@@ -233,6 +236,8 @@
void mgcp_calls_init_tap(void);
void actrace_calls_init_tap(void);
void t38_init_tap(void);
+/*test*/
+void uaudp_init_tap(void);
/*
* Removes the voip_calls tap listener (if not already done)
@@ -250,6 +255,8 @@
void remove_tap_listener_mgcp_calls(void);
void remove_tap_listener_actrace_calls(void);
void remove_tap_listener_t38(void);
+/*test*/
+void remove_tap_listener_uaudp(void);
/*
* Retrieves a constant reference to the unique info structure of the voip_calls tap listener.
Hello,
here's the working patch/diff.
Please test and apply!
Thanks
TS
Index: epan/column.c
===================================================================
--- epan/column.c (revision 20080)
+++ epan/column.c (working copy)
@@ -91,12 +91,16 @@
"%H",
"%P",
"%y",
- "%z",
- "%v",
+ "%v",
+ "%q",
+ "%f",
+ "%U",
"%E",
"%C",
- "%l"
+ "%l",
+ "%z"
};
+
if (fmt < 0 || fmt >= NUM_COL_FMTS)
return NULL;
@@ -155,6 +159,8 @@
"DCE/RPC call (cn_call_id / dg_seqnum)", /* COL_DCE_CALL */
"DCE/RPC context ID (cn_ctx_id)", /* COL_DCE_CTX */
"802.1Q VLAN id", /* COL_8021Q_VLAN_ID */
+ "IP DSCP Value", /* COL_DSCP_VALUE */
+ "L2 COS Value", /* COL_COS_VALUE */
"TEI", /* XXX - why is it missing in column_utils.c and elsewhere? */
"Frame Relay DLCI", /* COL_FR_DLCI */
"GPRS BSSGP TLLI", /* COL_BSSGP_TLLI */
@@ -261,6 +267,12 @@
case COL_8021Q_VLAN_ID:
fmt_list[COL_8021Q_VLAN_ID] = TRUE;
break;
+ case COL_DSCP_VALUE:
+ fmt_list[COL_DSCP_VALUE] = TRUE;
+ break;
+ case COL_COS_VALUE:
+ fmt_list[COL_COS_VALUE] = TRUE;
+ break;
case COL_TEI:
fmt_list[COL_TEI] = TRUE;
break;
@@ -524,6 +536,12 @@
case COL_8021Q_VLAN_ID:
return "0000";
break;
+ case COL_DSCP_VALUE:
+ return "00";
+ break;
+ case COL_COS_VALUE:
+ return "0";
+ break;
case COL_TEI:
return "127";
break;
@@ -682,9 +700,15 @@
case 'z':
return COL_DCE_CTX;
break;
- case 'v':
+ case 'q':
return COL_8021Q_VLAN_ID;
break;
+ case 'f':
+ return COL_DSCP_VALUE;
+ break;
+ case 'U':
+ return COL_COS_VALUE;
+ break;
case 'E':
return COL_TEI;
case 'C':
Index: epan/column-utils.c
===================================================================
--- epan/column-utils.c (revision 20080)
+++ epan/column-utils.c (working copy)
@@ -1288,7 +1288,14 @@
case COL_8021Q_VLAN_ID:
break;
+
+ case COL_DSCP_VALUE: /* done by packet-ip */
+ break;
+
+ case COL_COS_VALUE: /* done by packet-vlan */
+ break;
+
case COL_FR_DLCI: /* done by packet-fr.c */
case COL_BSSGP_TLLI: /* done by packet-bssgp.c */
break;
Index: epan/dissectors/packet-vlan.c
===================================================================
--- epan/dissectors/packet-vlan.c (revision 20080)
+++ epan/dissectors/packet-vlan.c (working copy)
@@ -91,6 +91,9 @@
if ( check_col(pinfo->cinfo, COL_8021Q_VLAN_ID)) {
col_add_fstr(pinfo->cinfo, COL_8021Q_VLAN_ID, "%u", (tci & 0xFFF));
}
+ if ( check_col(pinfo->cinfo, COL_COS_VALUE)) {
+ col_add_fstr(pinfo->cinfo, COL_COS_VALUE, "%u", (tci >> 13));
+ }
vlan_tree = NULL;
Index: epan/dissectors/packet-ip.c
===================================================================
--- epan/dissectors/packet-ip.c (revision 20080)
+++ epan/dissectors/packet-ip.c (working copy)
@@ -929,7 +929,11 @@
iph->ip_tos = tvb_get_guint8(tvb, offset + 1);
if (tree) {
- if (g_ip_dscp_actif) {
+
+ if ( check_col(pinfo->cinfo, COL_DSCP_VALUE)) {
+ col_add_fstr(pinfo->cinfo, COL_DSCP_VALUE, "%u", IPDSFIELD_DSCP(iph->ip_tos));
+ }
+ if (g_ip_dscp_actif) {
tf = proto_tree_add_uint_format(ip_tree, hf_ip_dsfield, tvb, offset + 1, 1, iph->ip_tos,
"Differentiated Services Field: 0x%02x (DSCP 0x%02x: %s; ECN: 0x%02x)", iph->ip_tos,
IPDSFIELD_DSCP(iph->ip_tos), val_to_str(IPDSFIELD_DSCP(iph->ip_tos), dscp_vals,
Index: epan/column_info.h
===================================================================
--- epan/column_info.h (revision 20080)
+++ epan/column_info.h (working copy)
@@ -100,6 +100,8 @@
COL_DCE_CALL, /* DCE/RPC connection oriented call id OR datagram sequence number */
COL_DCE_CTX, /* DCE/RPC connection oriented context id */
COL_8021Q_VLAN_ID, /* 802.1Q vlan ID */
+ COL_DSCP_VALUE, /* IP DSCP Value */
+ COL_COS_VALUE, /* L2 COS Value */
COL_TEI, /* q.921 TEI */
COL_FR_DLCI, /* Frame Relay DLCI */
COL_BSSGP_TLLI, /* GPRS BSSGP IE TLLI */
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
- Prev by Date: [Wireshark-dev] (no subject)
- Next by Date: [Wireshark-dev] I can't get the file libwireshark.dll
- Previous by thread: Re: [Wireshark-dev] COS DSCP Column patch
- Next by thread: [Wireshark-dev] Regarding dissectors.
- Index(es):