Add an AT_ARCNET address type for ARCNET addresses, and have the ARCNET
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 18 Oct 2002 21:40:13 +0000 (21:40 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 18 Oct 2002 21:40:13 +0000 (21:40 +0000)
dissector set the source and destination link-layer addresses.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6452 f5534014-38df-0310-8fa8-9805f1628bb7

epan/column-utils.c
epan/packet_info.h
packet-arcnet.c

index 14545be1d13d98f4662dd044ecab31933daa54da..c852394ff7758f8577a64078a7882dc5049b9a88 100644 (file)
@@ -1,7 +1,7 @@
 /* column-utils.c
  * Routines for column utilities.
  *
- * $Id: column-utils.c,v 1.19 2002/10/15 04:31:00 guy Exp $
+ * $Id: column-utils.c,v 1.20 2002/10/18 21:40:13 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -477,6 +477,22 @@ col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res,
     pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
     break;
 
+  case AT_DLCI:
+    /* XXX - handle AT_DLCI */
+    break;
+
+  case AT_ARCNET:
+    snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%02X",
+      addr->data[0]);
+    pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0';
+    if (is_src)
+      strcpy(pinfo->cinfo->col_expr[col], "arcnet.src");
+    else
+      strcpy(pinfo->cinfo->col_expr[col], "arcnet.dst");
+    pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
+    strcpy(pinfo->cinfo->col_expr_val[col],pinfo->cinfo->col_buf[col]);
+    break;
+
   default:
     break;
   }
index 2c44165b0dd239cfb0452c225e0d308030cb176c..277560a5637f0d891c202960b10b891555bda021 100644 (file)
@@ -1,7 +1,7 @@
 /* packet_info.h
  * Definitions for packet info structures and routines
  *
- * $Id: packet_info.h,v 1.20 2002/10/15 04:31:00 guy Exp $
+ * $Id: packet_info.h,v 1.21 2002/10/18 21:40:13 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -39,7 +39,8 @@ typedef enum {
   AT_ATALK,            /* Appletalk DDP */
   AT_VINES,            /* Banyan Vines */
   AT_OSI,              /* OSI NSAP */
-  AT_DLCI               /* Frame Relay DLCI */
+  AT_DLCI,             /* Frame Relay DLCI */
+  AT_ARCNET            /* ARCNET */
 } address_type;
 
 typedef struct _address {
index c6acd41e5e2d1998ad3058a407b57c79bbe26844..547c5785970242a8e4e15075165b22b91e158bb8 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for arcnet dissection
  * Copyright 2001-2002, Peter Fales <ethereal@fales-lorenz.net>
  *
- * $Id: packet-arcnet.c,v 1.2 2002/10/18 21:10:38 guy Exp $
+ * $Id: packet-arcnet.c,v 1.3 2002/10/18 21:40:12 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -68,6 +68,11 @@ dissect_arcnet (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 
   src = tvb_get_guint8 (tvb, 0);
   dst = tvb_get_guint8 (tvb, 1);
+  SET_ADDRESS(&pinfo->dl_src,  AT_ARCNET, 1, tvb_get_ptr(tvb, 0, 1));
+  SET_ADDRESS(&pinfo->src,     AT_ARCNET, 1, tvb_get_ptr(tvb, 0, 1));
+  SET_ADDRESS(&pinfo->dl_dst,  AT_ARCNET, 1, tvb_get_ptr(tvb, 1, 1));
+  SET_ADDRESS(&pinfo->dst,     AT_ARCNET, 1, tvb_get_ptr(tvb, 1, 1));
+
   protID = tvb_get_guint8 (tvb, 4);
 
 /* In the interest of speed, if "tree" is NULL, don't do any work not