Ethereal-dev: [Ethereal-dev] resolving of well-known mac-addresses

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Hannes Gredler <hannes@xxxxxxxxxxx>
Date: Wed, 28 Aug 2002 10:36:58 +0200
hi ethereal developers,

find attached a patch that allows protocol dissectors to
register their well known MAC-addresses;
  [the patch contains an example for IS-IS and ES-IS]
  using the new add_eth_byname() function;

/hannes
Index: packet-esis.c
===================================================================
RCS file: /cvsroot/ethereal/packet-esis.c,v
retrieving revision 1.26
diff -u -r1.26 packet-esis.c
--- packet-esis.c	2002/08/02 23:35:49	1.26
+++ packet-esis.c	2002/08/28 08:31:10
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <glib.h>
 #include <epan/packet.h>
+#include <epan/resolv.h>
 #include "nlpid.h"
 #include "packet-osi.h"
 #include "packet-osi-options.h"
@@ -442,4 +443,7 @@
 
   esis_handle = create_dissector_handle(dissect_esis, proto_esis);
   dissector_add("osinl", NLPID_ISO9542_ESIS, esis_handle);
+
+  /* lets register the well-known MAC address*/
+  add_eth_byname("\x09\x00\x2b\x00\x00\x04","AllESs");
 }
Index: packet-isis.c
===================================================================
RCS file: /cvsroot/ethereal/packet-isis.c,v
retrieving revision 1.32
diff -u -r1.32 packet-isis.c
--- packet-isis.c	2002/08/02 23:35:52	1.32
+++ packet-isis.c	2002/08/28 08:31:12
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <glib.h>
 #include <epan/packet.h>
+#include <epan/resolv.h>
 #include "nlpid.h"
 #include "packet-osi.h"
 #include "packet-isis.h"
@@ -326,4 +327,9 @@
 
     isis_handle = create_dissector_handle(dissect_isis, proto_isis);
     dissector_add("osinl", NLPID_ISO10589_ISIS, isis_handle);
+
+    /* lets register the well-known MAC addresses*/
+    add_eth_byname("\x01\x80\xc2\x00\x00\x14","AllL1ISs");
+    add_eth_byname("\x01\x80\xc2\x00\x00\x15","AllL2ISs");
+    add_eth_byname("\x09\x00\x2b\x00\x00\x05","AllISs");
 }
Index: epan/resolv.c
===================================================================
RCS file: /cvsroot/ethereal/epan/resolv.c,v
retrieving revision 1.24
diff -u -r1.24 resolv.c
--- resolv.c	2002/08/02 21:29:40	1.24
+++ resolv.c	2002/08/28 08:31:20
@@ -1300,6 +1300,12 @@
 
 } /* add_ether_byip */
 
+extern void add_eth_byname(const guint8 *addr, const guchar *name)
+{
+    add_eth_name(addr, name);
+
+} /* add_eth_byname */
+
 extern const guchar *get_ipxnet_name(const guint32 addr)
 {
 
Index: epan/resolv.h
===================================================================
RCS file: /cvsroot/ethereal/epan/resolv.h,v
retrieving revision 1.8
diff -u -r1.8 resolv.h
--- resolv.h	2002/01/13 20:35:10	1.8
+++ resolv.h	2002/08/28 08:31:20
@@ -102,6 +102,9 @@
 /* add ethernet address / name corresponding to IP address  */
 extern void add_ether_byip(guint ip, const guint8 *eth);
 
+/* add wellknown ethernet address */
+extern void add_eth_byname(const guint8 *addr, const guchar *name);
+
 /* Translates a string representing the hostname or dotted-decimal IP address
  * into a numeric IP address value, returning TRUE if it succeeds and
  * FALSE if it fails. */
@@ -115,3 +118,4 @@
 gboolean get_host_ipaddr6(const char *host, struct e_in6_addr *addrp);
 
 #endif /* __RESOLV_H__ */
+