add a new column DCE/RPC context ID

svn path=/trunk/; revision=18578
This commit is contained in:
Ulf Lamping 2006-06-26 20:46:15 +00:00
parent 49a7d578c8
commit ecb07acdef
5 changed files with 156 additions and 56 deletions

View File

@ -1225,6 +1225,9 @@ col_fill_in(packet_info *pinfo)
case COL_DCE_CALL: /* done by dcerpc */
break;
case COL_DCE_CTX: /* done by dcerpc */
break;
case COL_8021Q_VLAN_ID:
break;

View File

@ -45,12 +45,55 @@
const gchar *
col_format_to_string(gint fmt) {
const gchar *slist[] = {
"%m", "%t", "%Rt", "%At", "%Yt", "%Tt", "%s", "%rs",
"%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
"%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
"%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
"%i", "%L", "%B", "%XO", "%XR", "%I", "%c", "%Xs",
"%Xd", "%V", "%x", "%e", "%H", "%P", "%y", "%v", "%E"
"%m",
"%t",
"%Rt",
"%At",
"%Yt",
"%Tt",
"%s",
"%rs",
"%us",
"%hs",
"%rhs",
"%uhs",
"%ns",
"%rns",
"%uns",
"%d",
"%rd",
"%ud",
"%hd",
"%rhd",
"%uhd",
"%nd",
"%rnd",
"%und",
"%S",
"%rS",
"%uS",
"%D",
"%rD",
"%uD",
"%p",
"%i",
"%L",
"%B",
"%XO",
"%XR",
"%I",
"%c",
"%Xs",
"%Xd",
"%V",
"%x",
"%e",
"%H",
"%P",
"%y",
"%z",
"%v",
"%E"
};
if (fmt < 0 || fmt >= NUM_COL_FMTS)
@ -62,54 +105,55 @@ col_format_to_string(gint fmt) {
/* Given a format number (as defined in packet.h), returns its
description */
static const gchar *dlist[NUM_COL_FMTS] = {
"Number",
"Time (format as specified)",
"Relative time",
"Absolute time",
"Absolute date and time",
"Delta time",
"Source address",
"Src addr (resolved)",
"Src addr (unresolved)",
"Hardware src addr",
"Hw src addr (resolved)",
"Hw src addr (unresolved)",
"Network src addr",
"Net src addr (resolved)",
"Net src addr (unresolved)",
"Destination address",
"Dest addr (resolved)",
"Dest addr (unresolved)",
"Hardware dest addr",
"Hw dest addr (resolved)",
"Hw dest addr (unresolved)",
"Network dest addr",
"Net dest addr (resolved)",
"Net dest addr (unresolved)",
"Source port",
"Src port (resolved)",
"Src port (unresolved)",
"Destination port",
"Dest port (resolved)",
"Dest port (unresolved)",
"Protocol",
"Information",
"Packet length (bytes)" ,
"Cumulative Bytes" ,
"Fibre Channel OXID",
"Fibre Channel RXID",
"FW-1 monitor if/direction",
"Circuit ID",
"Cisco Src PortIdx",
"Cisco Dst PortIdx",
"Cisco VSAN",
"IEEE 802.11 TX rate",
"IEEE 802.11 RSSI",
"HP-UX Subsystem",
"HP-UX Device ID",
"DCE/RPC call (cn_call_id / dg_seqnum)",
"802.1Q VLAN id",
"TEI",
"Number", /* COL_NUMBER */
"Time (format as specified)", /* COL_CLS_TIME */
"Relative time", /* COL_REL_TIME */
"Absolute time", /* COL_ABS_TIME */
"Absolute date and time", /* COL_ABS_DATE_TIME */
"Delta time", /* COL_DELTA_TIME */
"Source address", /* COL_DEF_SRC */
"Src addr (resolved)", /* COL_RES_SRC */
"Src addr (unresolved)", /* COL_UNRES_SRC */
"Hardware src addr", /* COL_DEF_DL_SRC */
"Hw src addr (resolved)", /* COL_RES_DL_SRC*/
"Hw src addr (unresolved)", /* COL_UNRES_DL_SRC */
"Network src addr", /* COL_DEF_NET_SRC */
"Net src addr (resolved)", /* COL_RES_NET_SRC */
"Net src addr (unresolved)", /* COL_UNRES_NET_SRC */
"Destination address", /* COL_DEF_DST */
"Dest addr (resolved)", /* COL_RES_DST */
"Dest addr (unresolved)", /* COL_UNRES_DST */
"Hardware dest addr", /* COL_DEF_DL_DST */
"Hw dest addr (resolved)", /* COL_RES_DL_DST */
"Hw dest addr (unresolved)", /* COL_UNRES_DL_DST */
"Network dest addr", /* COL_DEF_NET_DST */
"Net dest addr (resolved)", /* COL_RES_NET_DST */
"Net dest addr (unresolved)", /* COL_UNRES_NET_DST */
"Source port", /* COL_DEF_SRC_PORT */
"Src port (resolved)", /* COL_RES_SRC_PORT */
"Src port (unresolved)", /* COL_UNRES_SRC_PORT */
"Destination port", /* COL_DEF_DST_PORT */
"Dest port (resolved)", /* COL_RES_DST_PORT */
"Dest port (unresolved)", /* COL_UNRES_DST_PORT */
"Protocol", /* COL_PROTOCOL */
"Information", /* COL_INFO */
"Packet length (bytes)" , /* COL_PACKET_LENGTH */
"Cumulative Bytes" , /* COL_CUMULATIVE_BYTES */
"Fibre Channel OXID", /* COL_OXID */
"Fibre Channel RXID", /* COL_RXID */
"FW-1 monitor if/direction", /* COL_IF_DIR */
"Circuit ID", /* COL_CIRCUIT_ID */
"Cisco Src PortIdx", /* COL_SRCIDX */
"Cisco Dst PortIdx", /* COL_DSTIDX */
"Cisco VSAN", /* COL_VSAN */
"IEEE 802.11 TX rate", /* COL_TX_RATE */
"IEEE 802.11 RSSI", /* COL_RSSI */
"HP-UX Subsystem", /* COL_HPUX_SUBSYS */
"HP-UX Device ID", /* COL_HPUX_DEVID */
"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 */
"TEI", /* XXX - why is it missing in column_utils.c and elsewhere? */
};
const gchar *
@ -207,6 +251,9 @@ get_column_format_matches(gboolean *fmt_list, gint format) {
case COL_DCE_CALL:
fmt_list[COL_DCE_CALL] = TRUE;
break;
case COL_DCE_CTX:
fmt_list[COL_DCE_CTX] = TRUE;
break;
case COL_8021Q_VLAN_ID:
fmt_list[COL_8021Q_VLAN_ID] = TRUE;
break;
@ -430,6 +477,9 @@ get_column_longest_string(gint format)
case COL_DCE_CALL:
return "0000";
break;
case COL_DCE_CTX:
return "0000";
break;
case COL_8021Q_VLAN_ID:
return "0000";
break;
@ -582,6 +632,9 @@ get_column_format_from_str(gchar *str) {
case 'y':
return COL_DCE_CALL;
break;
case 'z':
return COL_DCE_CTX;
break;
case 'v':
return COL_8021Q_VLAN_ID;
break;

View File

@ -97,7 +97,8 @@ enum {
COL_RSSI, /* IEEE 802.11 - received signal strength */
COL_HPUX_SUBSYS, /* HP-UX Nettl Subsystem */
COL_HPUX_DEVID, /* HP-UX Nettl Device ID */
COL_DCE_CALL, /* DCE/RPC call id OR datagram sequence number */
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_TEI, /* q.921 TEI */
NUM_COL_FMTS /* Should always be last */

View File

@ -326,6 +326,7 @@ static const value_string reject_status_vals[] = {
{ 0x8007000E, "E_OUTOFMEMORY" },
{ 0x80070057, "E_INVALIDARG" },
{ 0x800706d1, "RPC_S_PROCNUM_OUT_OF_RANGE" },
{ 0x80070776, "OR_INVALID_OXID" },
{ 0, NULL }
};
@ -2636,6 +2637,16 @@ dissect_dcerpc_cn_bind (tvbuff_t *tvb, gint offset, packet_info *pinfo,
offset = dissect_dcerpc_uint16 (tvb, offset, pinfo, NULL, hdr->drep,
hf_dcerpc_cn_ctx_id, &ctx_id);
if (check_col (pinfo->cinfo, COL_DCE_CTX)) {
if(pinfo->dcectxid == 0) {
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "%u", ctx_id);
} else {
/* this is not the first DCE-RPC request/response in this (TCP?-)PDU,
* prepend a delimiter */
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "#%u", ctx_id);
}
}
/* save context ID for use with dcerpc_add_conv_to_bind_table() */
/* (if we have multiple contexts, this might cause "decode as"
* to behave unpredictably) */
@ -3301,6 +3312,16 @@ dissect_dcerpc_cn_rqst (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_item_append_text(parent_pi, " Ctx: %u", ctx_id);
}
if (check_col (pinfo->cinfo, COL_DCE_CTX)) {
if(pinfo->dcectxid == 0) {
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "%u", ctx_id);
} else {
/* this is not the first DCE-RPC request/response in this (TCP?-)PDU,
* prepend a delimiter */
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "#%u", ctx_id);
}
}
offset = dissect_dcerpc_uint16 (tvb, offset, pinfo, dcerpc_tree, hdr->drep,
hf_dcerpc_opnum, &opnum);
@ -3474,6 +3495,17 @@ dissect_dcerpc_cn_resp (tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_item_append_text(parent_pi, " Ctx: %u", ctx_id);
}
if (check_col (pinfo->cinfo, COL_DCE_CTX)) {
if(pinfo->dcectxid == 0) {
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "%u", ctx_id);
} else {
/* this is not the first DCE-RPC request/response in this (TCP?-)PDU,
* prepend a delimiter */
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "#%u", ctx_id);
}
}
/* save context ID for use with dcerpc_add_conv_to_bind_table() */
pinfo->dcectxid = ctx_id;
@ -3586,6 +3618,16 @@ dissect_dcerpc_cn_fault (tvbuff_t *tvb, gint offset, packet_info *pinfo,
offset = dissect_dcerpc_uint16 (tvb, offset, pinfo, dcerpc_tree, hdr->drep,
hf_dcerpc_cn_ctx_id, &ctx_id);
if (check_col (pinfo->cinfo, COL_DCE_CTX)) {
if(pinfo->dcectxid == 0) {
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "%u", ctx_id);
} else {
/* this is not the first DCE-RPC request/response in this (TCP?-)PDU,
* prepend a delimiter */
col_append_fstr (pinfo->cinfo, COL_DCE_CTX, "#%u", ctx_id);
}
}
offset = dissect_dcerpc_uint8 (tvb, offset, pinfo, dcerpc_tree, hdr->drep,
hf_dcerpc_cn_cancel_count, NULL);
/* padding */

View File

@ -534,7 +534,8 @@ packet_list_new(e_prefs *prefs)
if (cfile.cinfo.col_fmt[i] == COL_NUMBER ||
cfile.cinfo.col_fmt[i] == COL_PACKET_LENGTH ||
cfile.cinfo.col_fmt[i] == COL_CUMULATIVE_BYTES ||
cfile.cinfo.col_fmt[i] == COL_DCE_CALL)
cfile.cinfo.col_fmt[i] == COL_DCE_CALL ||
cfile.cinfo.col_fmt[i] == COL_DCE_CTX)
eth_clist_set_column_justification(ETH_CLIST(packet_list), i,
GTK_JUSTIFY_RIGHT);
}