aboutsummaryrefslogtreecommitdiffstats
path: root/xdlc.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-01-18 08:32:46 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-01-18 08:32:46 +0000
commit09fcdb8a6cf99880c2201935a49e114eb9c2d0ee (patch)
tree5f69dc150eac8233eefdbc1d4aa153060afd2b32 /xdlc.c
parent13c173de75d4a98a5596be5006a4ab61b7054632 (diff)
Add arguments to "dissect_xdlc_control()" to specify value_string
tables, for use in the top-level item for the control field, for unnumbered frame function codes for commands and responses. If the argument is null, default to the standard tables. Use "dissect_xdlc_control()" and the #defines from "xdlc.h" for IrDA. Use the reported length rather than the data length in the IrDA dissector when iterating over the data in an IrDA packet. Make "dissect_xid()" update the column information as well as the protocol tree. Put the slot number into the protocol tree only for command frames - "the slot number field is undefined in discovery XID response frames", to quote the IrLAP spec. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9713 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'xdlc.c')
-rw-r--r--xdlc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/xdlc.c b/xdlc.c
index 0f492458cc..f6d8864aee 100644
--- a/xdlc.c
+++ b/xdlc.c
@@ -2,7 +2,7 @@
* Routines for use by various SDLC-derived protocols, such as HDLC
* and its derivatives LAPB, IEEE 802.2 LLC, etc..
*
- * $Id: xdlc.c,v 1.22 2004/01/03 03:49:23 guy Exp $
+ * $Id: xdlc.c,v 1.23 2004/01/18 08:32:46 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -173,7 +173,9 @@ int
dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
const xdlc_cf_items *cf_items_nonext, const xdlc_cf_items *cf_items_ext,
- int is_response, int is_extended, int append_info)
+ const value_string *u_modifier_short_vals_cmd,
+ const value_string *u_modifier_short_vals_resp, int is_response,
+ int is_extended, int append_info)
{
guint16 control;
int control_len;
@@ -272,16 +274,20 @@ dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
* control field of a U frame, there doesn't appear to be any
* need for it to be 2 bytes in extended operation.
*/
+ if (u_modifier_short_vals_cmd == NULL)
+ u_modifier_short_vals_cmd = modifier_short_vals_cmd;
+ if (u_modifier_short_vals_resp == NULL)
+ u_modifier_short_vals_resp = modifier_short_vals_resp;
control = tvb_get_guint8(tvb, offset);
control_len = 1;
cf_items = cf_items_nonext;
control_format = "Control field: %s (0x%02X)";
if (is_response) {
modifier = match_strval(control & XDLC_U_MODIFIER_MASK,
- modifier_short_vals_resp);
+ u_modifier_short_vals_resp);
} else {
modifier = match_strval(control & XDLC_U_MODIFIER_MASK,
- modifier_short_vals_cmd);
+ u_modifier_short_vals_cmd);
}
if (modifier == NULL)
modifier = "Unknown";