IPX addresses in the Destination/Source fields of the "column" part of the GUI
authorGilbert Ramirez <gram@alumni.rice.edu>
Fri, 5 Mar 1999 06:09:39 +0000 (06:09 -0000)
committerGilbert Ramirez <gram@alumni.rice.edu>
Fri, 5 Mar 1999 06:09:39 +0000 (06:09 -0000)
are now written in NNNNNNNN.hhhhhhhhhhhh form, N=IPX network, h=hwaddr.

svn path=/trunk/; revision=211

column.c
packet-ipx.c

index a9c21b7a922b0960ee12b6b8f22a83cb9c1c8f9b..9858a3a4a7d18e8e3f810fd01155a9be10d8dda2 100644 (file)
--- a/column.c
+++ b/column.c
@@ -1,7 +1,7 @@
 /* column.c
  * Routines for handling column preferences
  *
- * $Id: column.c,v 1.8 1999/01/04 01:31:17 gerald Exp $
+ * $Id: column.c,v 1.9 1999/03/05 06:09:39 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -220,7 +220,7 @@ get_column_width(gint format, GdkFont *font) {
     case COL_DEF_NET_DST:
     case COL_RES_NET_DST:
     case COL_UNRES_NET_DST:
-      return (gdk_string_width(font, "00:00:00:00:00:00"));
+      return (gdk_string_width(font, "00000000.000000000000")); /* IPX-style */
       break;
     case COL_DEF_SRC_PORT:
     case COL_RES_SRC_PORT:
index 2e247416c6768dbe1f11c1f45decc821c1043cef..a3e7055994a7d4f804243f6b1cf71bf32aa1bd29 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for NetWare's IPX
  * Gilbert Ramirez <gram@verdict.uthscsa.edu>
  *
- * $Id: packet-ipx.c,v 1.15 1999/03/05 05:20:12 gram Exp $
+ * $Id: packet-ipx.c,v 1.16 1999/03/05 06:09:39 gram Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@unicom.net>
@@ -160,6 +160,25 @@ ipxnet_to_string(const guint8 *ad)
        return cur;
 }
 
+gchar*
+ipx_addr_to_str(guint32 net, const guint8 *ad)
+{
+       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, "%X.%02x%02x%02x%02x%02x%02x", net, 
+               ad[0], ad[1], ad[2], ad[3], ad[4], ad[5]);
+       return cur;
+}
+
 void
 dissect_ipx(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
 
@@ -176,6 +195,14 @@ dissect_ipx(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
        dsocket = pntohs(&pd[offset+16]);
        ssocket = pntohs(&pd[offset+28]);
 
+       if (check_col(fd, COL_RES_DL_DST))
+               col_add_str(fd, COL_RES_DL_DST,
+                               ipx_addr_to_str(pntohl(&pd[offset+6]),
+                                       (guint8*)&pd[offset+10]));
+       if (check_col(fd, COL_RES_DL_SRC))
+               col_add_str(fd, COL_RES_DL_SRC,
+                               ipx_addr_to_str(pntohl(&pd[offset+18]),
+                                       (guint8*)&pd[offset+22]));
        if (check_col(fd, COL_PROTOCOL))
                col_add_str(fd, COL_PROTOCOL, "IPX");
        if (check_col(fd, COL_INFO))
@@ -188,7 +215,7 @@ dissect_ipx(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
                        "Internetwork Packet Exchange");
                ipx_tree = gtk_tree_new();
                add_subtree(ti, ipx_tree, ETT_IPX);
-               add_item_to_tree(ipx_tree, offset,      2, "Checksum: 0x%04X",
+               add_item_to_tree(ipx_tree, offset,      2, "Checksum: 0x%04x",
                        (pd[offset] << 8) | pd[offset+1]);
                add_item_to_tree(ipx_tree, offset+2,    2, "Length: %d bytes",
                        (pd[offset+2] << 8) | pd[offset+3]);
@@ -273,7 +300,7 @@ spx_conn_ctrl(u_char ctrl)
 }
 
 static char*
-datastream(u_char type)
+spx_datastream(u_char type)
 {
        switch (type) {
                case 0xfe:
@@ -307,7 +334,7 @@ dissect_spx(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
 
                add_item_to_tree(spx_tree, offset+1,     1,
                        "Datastream Type: %s (0x%02X)",
-                       datastream(pd[offset+1]), pd[offset+1]);
+                       spx_datastream(pd[offset+1]), pd[offset+1]);
 
                add_item_to_tree(spx_tree, offset+2,     2,
                        "Source Connection ID: %d", pntohs( &pd[offset+2] ) );