aboutsummaryrefslogtreecommitdiffstats
path: root/xdlc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-09-02 19:18:52 +0000
committerGuy Harris <guy@alum.mit.edu>2003-09-02 19:18:52 +0000
commit454806eeff5bd53d1283bbc2fafe86cdf0eddd48 (patch)
tree7924a9ddd20a83a016d1fdb768079765bb451dba /xdlc.c
parent7cb23da0fb155a118684a966303da81da70d18ca (diff)
Use "dissect_xdlc_control()" to dissect the control field of Frame Relay
packets that have one. Add an argument to "dissect_xdlc_control()" to indicate whether it should append the information to the Info field or just put it in the Info field. Use the #defines for the DLCI bitfields to extract the DLCI bits when constructing the DLCI. svn path=/trunk/; revision=8335
Diffstat (limited to 'xdlc.c')
-rw-r--r--xdlc.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/xdlc.c b/xdlc.c
index 6bdca9f51a..85bd1df316 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.20 2002/08/28 21:00:41 jmayer Exp $
+ * $Id: xdlc.c,v 1.21 2003/09/02 19:18:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -192,7 +192,7 @@ get_xdlc_control(const guchar *pd, int offset, int is_extended)
int
dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *xdlc_tree, int hf_xdlc_control, gint ett_xdlc_control,
- int is_response, int is_extended)
+ int is_response, int is_extended, int append_info)
{
guint16 control;
char info[80];
@@ -240,8 +240,13 @@ dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
""),
(control & XDLC_N_R_MASK) >> XDLC_N_R_SHIFT);
}
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, info);
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ if (append_info) {
+ col_append_str(pinfo->cinfo, COL_INFO, ", ");
+ col_append_str(pinfo->cinfo, COL_INFO, info);
+ } else
+ col_add_str(pinfo->cinfo, COL_INFO, info);
+ }
if (xdlc_tree) {
if (is_extended) {
tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control, tvb,
@@ -315,8 +320,13 @@ dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
(is_response ? " F" : " P") :
""),
modifier);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, info);
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ if (append_info) {
+ col_append_str(pinfo->cinfo, COL_INFO, ", ");
+ col_append_str(pinfo->cinfo, COL_INFO, info);
+ } else
+ col_add_str(pinfo->cinfo, COL_INFO, info);
+ }
if (xdlc_tree) {
tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control, tvb,
offset, 1,
@@ -358,8 +368,13 @@ dissect_xdlc_control(tvbuff_t *tvb, int offset, packet_info *pinfo,
(control & XDLC_N_R_MASK) >> XDLC_N_R_SHIFT,
(control & XDLC_N_S_MASK) >> XDLC_N_S_SHIFT);
}
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_str(pinfo->cinfo, COL_INFO, info);
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ if (append_info) {
+ col_append_str(pinfo->cinfo, COL_INFO, ", ");
+ col_append_str(pinfo->cinfo, COL_INFO, info);
+ } else
+ col_add_str(pinfo->cinfo, COL_INFO, info);
+ }
if (xdlc_tree) {
tc = proto_tree_add_uint_format(xdlc_tree, hf_xdlc_control, tvb,
offset, (is_extended) ? 2 : 1,