]> The Tcpdump Group git mirrors - tcpdump/commitdiff
add infrastructure for host-OS indep. ipproto name resolution
authorhannes <hannes>
Mon, 26 Apr 2004 17:49:44 +0000 (17:49 +0000)
committerhannes <hannes>
Mon, 26 Apr 2004 17:49:44 +0000 (17:49 +0000)
Makefile.in
ipproto.c [new file with mode: 0755]
ipproto.h

index 44cb4b8ea9d23cfad55325450a1eb50a766a767e..16fceeb8c2bf2d2a707fd7ecc9e229be03bb7779 100644 (file)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.284 2004-04-19 21:17:15 hannes Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.285 2004-04-26 17:49:44 hannes Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -65,7 +65,7 @@ INSTALL_DATA = @INSTALL_DATA@
        @rm -f $@
        $(CC) $(CFLAGS) -c $(srcdir)/$*.c
 
-CSRC = addrtoname.c gmpls.c oui.c gmt2local.c machdep.c parsenfsfh.c \
+CSRC = addrtoname.c gmpls.c oui.c gmt2local.c ipproto.c machdep.c parsenfsfh.c \
        print-802_11.c print-ap1394.c print-ah.c print-arcnet.c \
        print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \
        print-beep.c print-bfd.c print-bgp.c print-bootp.c print-cdp.c \
diff --git a/ipproto.c b/ipproto.c
new file mode 100755 (executable)
index 0000000..100c23e
--- /dev/null
+++ b/ipproto.c
@@ -0,0 +1,58 @@
+/* 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code
+ * distributions retain the above copyright notice and this paragraph
+ * in its entirety, and (2) distributions including binary code include
+ * the above copyright notice and this paragraph in its entirety in
+ * the documentation or other materials provided with the distribution.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
+ * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
+ * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE.
+ *
+ * Original code by Hannes Gredler ([email protected])
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/ipproto.c,v 1.1 2004-04-26 17:49:44 hannes Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include "ipproto.h"
+#include "interface.h"
+
+struct tok ipproto_values[] = {
+    { IPPROTO_HOPOPTS, "Options" },
+    { IPPROTO_ICMP, "ICMP" },
+    { IPPROTO_IGMP, "IGMP" },
+    { IPPROTO_IPV4, "IPIP" },
+    { IPPROTO_TCP, "TCP" },
+    { IPPROTO_EGP, "EGP" },
+    { IPPROTO_IGRP, "IGRP" },
+    { IPPROTO_UDP, "UDP" },
+    { IPPROTO_IPV6, "IPv6" },
+    { IPPROTO_ROUTING, "Routing" },
+    { IPPROTO_FRAGMENT, "Fragment" },
+    { IPPROTO_RSVP, "RSVP" },
+    { IPPROTO_GRE, "GRE" },
+    { IPPROTO_ESP, "ESP" },
+    { IPPROTO_AH, "AH" },
+    { IPPROTO_MOBILE, "Mobile IP" },
+    { IPPROTO_ICMPV6, "ICMPv6" },
+    { IPPROTO_MOBILITY_OLD, "Mobile IP (old)" },
+    { IPPROTO_EIGRP, "EIGRP" },
+    { IPPROTO_OSPF, "OSPF" },
+    { IPPROTO_PIM, "PIM" },
+    { IPPROTO_IPCOMP, "Compressed IP" },
+    { IPPROTO_VRRP, "VRRP" },
+    { IPPROTO_SCTP, "STCP" },
+    { IPPROTO_MOBILITY, "Mobility" },
+    { 0, NULL }
+};
+
index 1efb8557571dfc419b7d9994125fffb6d7c4184b..e9f090ef199730f651370674e2bbceafa6697972 100644 (file)
--- a/ipproto.h
+++ b/ipproto.h
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.2 2003-11-24 20:30:51 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.3 2004-04-26 17:49:44 hannes Exp $ (LBL)
  *
  * From:
  *     @(#)in.h        8.3 (Berkeley) 1/3/94
  * $FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp $
  */
 
+extern struct tok ipproto_values[];
+
 #ifndef IPPROTO_IP
 #define        IPPROTO_IP              0               /* dummy for IP */
 #endif
 #ifndef IPPROTO_ND
 #define        IPPROTO_ND              77              /* Sun net disk proto (temp.) */
 #endif
-#ifndef IPPROTO_IGRP
-#define        IPPROTO_IGRP            88              /* Cisco/GXS IGRP */
+#ifndef IPPROTO_EIGRP
+#define        IPPROTO_EIGRP           88              /* Cisco/GXS IGRP */
 #endif
 #ifndef IPPROTO_OSPF
 #define IPPROTO_OSPF           89