Ethereal-dev: [Ethereal-dev] support for OSI over CHDLC

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: Thu, 19 Sep 2002 21:32:31 +0200
sorry forgot to add packet-chdlc.c in the diff :-(
attached the patch to the three files ...

/hannes

---

hi ethereal developers,

pls find attach a little patch that supports decoding
for OSI [including IS-IS PDUs :-)] on C-HDLC;

i hope its ok to add the ethertype 0xFEFE to ethers.h;
heres the story:

typically cisco uses ethertypes to encode PDUs inside CHDLC;

however OSI frames are typically carried using LLC
 encapsulation on ethernet and not ETHII ...
 therefore somebody has decided to combine the OSI LLC
 code DSAP xFE and SSAP xFE to the "ethertype" 0xFEFE 

/hannes
Index: packet-osi.c
===================================================================
RCS file: /cvsroot/ethereal/packet-osi.c,v
retrieving revision 1.55
diff -u -r1.55 packet-osi.c
--- packet-osi.c	2002/08/28 21:00:24	1.55
+++ packet-osi.c	2002/09/19 19:30:17
@@ -38,6 +38,7 @@
 #include "aftypes.h"
 #include "nlpid.h"
 #include "ppptypes.h"
+#include "etypes.h"
 #include "packet-osi.h"
 #include "packet-isis.h"
 #include "packet-esis.h"
@@ -189,6 +190,7 @@
 	osi_handle = create_dissector_handle(dissect_osi, -1);
 	dissector_add("llc.dsap", SAP_OSINL, osi_handle);
         dissector_add("ppp.protocol", PPP_OSI, osi_handle);
+        dissector_add("chdlctype", ETHERTYPE_OSI, osi_handle);
 	dissector_add("null.type", BSD_AF_ISO, osi_handle);
 	dissector_add("gre.proto", SAP_OSINL, osi_handle);
 	data_handle = find_dissector("data");
Index: etypes.h
===================================================================
RCS file: /cvsroot/ethereal/etypes.h,v
retrieving revision 1.26
diff -u -r1.26 etypes.h
--- etypes.h	2002/08/28 21:00:06	1.26
+++ etypes.h	2002/09/19 19:30:17
@@ -183,6 +183,10 @@
 #define ETHERTYPE_LOOP		0x9000 	/* used for layer 2 testing (do i see my own frames on the wire) */
 #endif
 
+#ifndef ETHERTYPE_OSI
+#define ETHERTYPE_OSI 	        0xfefe  /* used in Cisco HDLC only */
+#endif
+
 extern const value_string etype_vals[];
 
 #endif /* etypes.h */
Index: packet-chdlc.c
===================================================================
RCS file: /cvsroot/ethereal/packet-chdlc.c,v
retrieving revision 1.15
diff -u -r1.15 packet-chdlc.c
--- packet-chdlc.c	2002/08/28 21:00:08	1.15
+++ packet-chdlc.c	2002/09/19 19:30:19
@@ -94,6 +94,7 @@
 	{ETHERTYPE_AARP,      "AARP"},
 	{ETHERTYPE_IPX,       "Netware IPX/SPX"},
 	{ETHERTYPE_ETHBRIDGE, "Transparent Ethernet bridging" },
+	{ETHERTYPE_OSI,       "OSI" },
 	{0,                   NULL}
 };