]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Some BSDs define IPPROTO_IGRP as 88 and don't define IPPROTO_EIGRP, so
authorguy <guy>
Wed, 28 Apr 2004 22:02:23 +0000 (22:02 +0000)
committerguy <guy>
Wed, 28 Apr 2004 22:02:23 +0000 (22:02 +0000)
we also define it as 88, so we can't have

case IPPROTO_IGRP:
case IPPROTO_EIGRP:

in a switch statement.

The current IANA protocol number assignments page lists 9 as "any
private interior gateway (used by Cisco for their IGRP)" and 88 as
"EIGRP" from Cisco, so we define IPPROTO_PIGP as 9 (which matches what
those BSDs do) and IPPROTO_EIGRP as 88 (so we don't bother with
IPPROTO_IGRP at all), and do

case IPPROTO_PIGP:
case IPPROTO_EIGRP:

It's not clear that we should handle both with the same print routine,
however - Cisco IGRP and Cisco EIGRP don't appear to have the same
packet format.

ipproto.h
print-ip.c

index e9f090ef199730f651370674e2bbceafa6697972..6ca1679d3b96328e67edf3bc86dbbc33b33da036 100644 (file)
--- a/ipproto.h
+++ b/ipproto.h
@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.3 2004-04-26 17:49:44 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.4 2004-04-28 22:02:23 guy Exp $ (LBL)
  *
  * From:
  *     @(#)in.h        8.3 (Berkeley) 1/3/94
@@ -60,8 +60,8 @@ extern struct tok ipproto_values[];
 #ifndef IPPROTO_EGP
 #define        IPPROTO_EGP             8               /* exterior gateway protocol */
 #endif
-#ifndef IPPROTO_IGRP
-#define IPPROTO_IGRP           9
+#ifndef IPPROTO_PIGP
+#define IPPROTO_PIGP           9
 #endif
 #ifndef IPPROTO_UDP
 #define        IPPROTO_UDP             17              /* user datagram protocol */
index d56c0bd8c076cf943c9710f7159320175438304a..af17385325c1295d4a4109e1558350059095c1cb 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.137 2004-04-26 18:27:57 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.138 2004-04-28 22:02:23 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -544,8 +544,28 @@ again:
                        icmp_print(cp, len, (const u_char *)ip, (off & 0x3fff));
                        break;
 
-                case IPPROTO_IGRP:
+               case IPPROTO_PIGP:
                case IPPROTO_EIGRP:
+                       /*
+                        * XXX - the current IANA protocol number assignments
+                        * page lists 9 as "any private interior gateway
+                        * (used by Cisco for their IGRP)" and 88 as
+                        * "EIGRP" from Cisco.
+                        *
+                        * Recent BSD <netinet/in.h> headers define
+                        * IP_PROTO_PIGP as 9 and IP_PROTO_IGRP as 88.
+                        * We define IP_PROTO_PIGP as 9 and
+                        * IP_PROTO_EIGRP as 88; those names better
+                        * match was the current protocol number
+                        * assignments say.
+                        *
+                        * XXX - at least according to the Ethereal
+                        * dissectors, Cisco IGRP and Cisco EIGRP are
+                        * *not* the same, so it's not clear that both
+                        * IPPROTO_PIGP and IPPROTO_EIGRP should be
+                        * handed to the same print routine; "igrp_print()"
+                        * appears to be for IGRP, not EIGRP.
+                        */
                        igrp_print(cp, len, (const u_char *)ip);
                        break;