summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--file.c7
-rw-r--r--packet-vines.c30
-rw-r--r--packet-vines.h7
-rw-r--r--packet.h5
4 files changed, 39 insertions, 10 deletions
diff --git a/file.c b/file.c
index 9c33a81679..d8e920c183 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.111 1999/10/22 08:11:39 guy Exp $
+ * $Id: file.c,v 1.112 1999/10/22 08:30:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -641,6 +641,11 @@ col_set_addr(frame_data *fd, int col, address *addr, gboolean is_res)
COL_MAX_LEN);
break;
+ case AT_VINES:
+ strncpy(fd->cinfo->col_data[col], vines_addr_to_str(&addr->data[0]),
+ COL_MAX_LEN);
+ break;
+
default:
break;
}
diff --git a/packet-vines.c b/packet-vines.c
index 72f036a6e2..09ebc10ae3 100644
--- a/packet-vines.c
+++ b/packet-vines.c
@@ -1,7 +1,7 @@
/* packet-vines.c
* Routines for Banyan VINES protocol packet disassembly
*
- * $Id: packet-vines.c,v 1.7 1999/07/07 22:51:57 gram Exp $
+ * $Id: packet-vines.c,v 1.8 1999/10/22 08:30:03 guy Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
@@ -97,6 +97,24 @@ dissect_vines_frp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree
dissect_vines(pd, offset, fd, tree);
}
+gchar *
+vines_addr_to_str(const guint8 *addrp)
+{
+ static gchar str[3][22];
+ static gchar *cur;
+
+ if (cur == &str[0][0]) {
+ cur = &str[1][0];
+ } else if (cur == &str[1][0]) {
+ cur = &str[2][0];
+ } else {
+ cur = &str[0][0];
+ }
+
+ sprintf(cur, "%08x.%04x", pntohl(&addrp[0]), pntohs(&addrp[4]));
+ return cur;
+}
+
void
dissect_vines(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
{
@@ -114,8 +132,8 @@ dissect_vines(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
viph.vip_chksum = pntohs(&pd[offset]);
viph.vip_pktlen = pntohs(&pd[offset+2]);
viph.vip_dnet = pntohl(&pd[offset+6]);
- viph.vip_snet = pntohl(&pd[offset+12]);
viph.vip_dsub = pntohs(&pd[offset+10]);
+ viph.vip_snet = pntohl(&pd[offset+12]);
viph.vip_ssub = pntohs(&pd[offset+16]);
switch (viph.vip_proto) {
@@ -156,10 +174,10 @@ dissect_vines(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
col_add_fstr(fd, COL_INFO, "Unknown VIP protocol (%02x)", viph.vip_proto);
}
- if (check_col(fd, COL_RES_NET_SRC))
- col_add_fstr(fd, COL_RES_NET_SRC, "%08x.%04x", viph.vip_snet, viph.vip_ssub);
- if (check_col(fd, COL_RES_NET_DST))
- col_add_fstr(fd, COL_RES_NET_DST, "%08x.%04x", viph.vip_dnet, viph.vip_dsub);
+ SET_ADDRESS(&pi.net_src, AT_VINES, 6, &pd[offset+12]);
+ SET_ADDRESS(&pi.src, AT_VINES, 6, &pd[offset+12]);
+ SET_ADDRESS(&pi.net_dst, AT_VINES, 6, &pd[offset+6]);
+ SET_ADDRESS(&pi.dst, AT_VINES, 6, &pd[offset+6]);
/* helpers to decode flags */
/* FIXME: Not used yet */
diff --git a/packet-vines.h b/packet-vines.h
index e4d91503b6..83b44b729f 100644
--- a/packet-vines.h
+++ b/packet-vines.h
@@ -1,7 +1,7 @@
/* packet-vines.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet-vines.h,v 1.2 1998/12/29 04:05:36 gerald Exp $
+ * $Id: packet-vines.h,v 1.3 1999/10/22 08:30:04 guy Exp $
*
* Don Lafontaine <lafont02@cn.ca>
*
@@ -105,4 +105,9 @@ typedef struct _e_vsmb {
guint32 vsmb_ttw;
} e_vsmb;
+/*
+ * Routine to take a Vines address and generate a string.
+ */
+extern gchar *vines_addr_to_str(const guint8 *addrp);
+
#endif /* packet-vines.h */
diff --git a/packet.h b/packet.h
index 51969b69d5..1f905616b7 100644
--- a/packet.h
+++ b/packet.h
@@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.118 1999/10/22 08:11:40 guy Exp $
+ * $Id: packet.h,v 1.119 1999/10/22 08:30:04 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -139,7 +139,8 @@ typedef enum {
AT_IPv6, /* IPv6 */
AT_IPX, /* IPX */
AT_SNA, /* SNA */
- AT_ATALK /* Appletalk */
+ AT_ATALK, /* Appletalk DDP */
+ AT_VINES /* Banyan Vines */
} address_type;
typedef struct _address {