]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Move the definitions of the various GMPLS "struct tok"s out of gmpls.h
authorguy <guy>
Mon, 9 Jun 2003 23:28:08 +0000 (23:28 +0000)
committerguy <guy>
Mon, 9 Jun 2003 23:28:08 +0000 (23:28 +0000)
into a new gmpls.c file; have gmpls.h contain only external declarations
of those structures.  That removes compiler warnings about static
structures being defined but not used, and also lets more than one file
share structures used in both of those files, rather than having private
definitions of them.

FILES
INSTALL
Makefile.in
gmpls.c [new file with mode: 0644]
gmpls.h

diff --git a/FILES b/FILES
index 9b751c2705406f95386c3b958d9aa00b80193f59..85bb22f777a1b4123828644621a0ced309047d49 100644 (file)
--- a/FILES
+++ b/FILES
@@ -31,6 +31,7 @@ ether.h
 ethertype.h
 extract.h
 fddi.h
+gmpls.c
 gmpls.h
 gmt2local.c
 gmt2local.h
diff --git a/INSTALL b/INSTALL
index 253a2ad6f3afcd01e65277dbbf2440d48dbf3689..40b66b217e6d79ed9ceb9cfb7a2386eff020df38 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/tcpdump/Attic/INSTALL,v 1.54 2003-06-07 11:57:52 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/Attic/INSTALL,v 1.55 2003-06-09 23:28:08 guy Exp $ (LBL)
 
 If you have not built libpcap, do so first.  See the README
 file in this directory for the ftp location.
@@ -73,7 +73,8 @@ ether.h               - Ethernet definitions
 ethertype.h    - Ethernet type value definitions
 extract.h      - alignment definitions
 fddi.h         - Fiber Distributed Data Interface definitions
-gmpls.h                - GMPLS definitions
+gmpls.c                - GMPLS definitions
+gmpls.h                - GMPLS declarations
 gmt2local.c    - time conversion routines
 gmt2local.h    - time conversion prototypes
 icmp6.h                - ICMPv6 definitiions
index 249eefa1d3449da88836dcd03c967fa59f614b03..373044955736b8d54db255d8d0a7c6e5cf3412e7 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.273 2003-03-25 08:32:59 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.274 2003-06-09 23:28:08 guy 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 gmt2local.c machdep.c parsenfsfh.c \
+CSRC = addrtoname.c gmpls.c gmt2local.c machdep.c parsenfsfh.c \
        print-802_11.c print-ah.c print-arcnet.c print-arp.c \
        print-ascii.c print-atalk.c print-atm.c print-beep.c \
        print-bgp.c print-bootp.c print-cdp.c print-chdlc.c \
diff --git a/gmpls.c b/gmpls.c
new file mode 100644 (file)
index 0000000..380b058
--- /dev/null
+++ b/gmpls.c
@@ -0,0 +1,117 @@
+/* 
+ * 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[] =
+    "@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.1 2003-06-09 23:28:09 guy Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include "interface.h"
+
+struct tok gmpls_link_prot_values[] = {
+    { 0x01, "Extra Traffic"},
+    { 0x02, "Unprotected"},
+    { 0x04, "Shared"},
+    { 0x08, "Dedicated 1:1"},
+    { 0x10, "Dedicated 1+1"},
+    { 0x20, "Enhanced"},
+    { 0x40, "Reserved"},
+    { 0x80, "Reserved"},
+    { 0, NULL }
+};
+
+struct tok gmpls_switch_cap_values[] = {
+    { 1,       "Packet-Switch Capable-1"},
+    { 2,       "Packet-Switch Capable-2"},
+    { 3,       "Packet-Switch Capable-3"},
+    { 4,       "Packet-Switch Capable-4"},
+    { 51,      "Layer-2 Switch Capable"},
+    { 100,     "Time-Division-Multiplex"},
+    { 150,     "Lambda-Switch Capable"},
+    { 200,     "Fiber-Switch Capable"},
+    { 0, NULL }
+};
+
+struct tok gmpls_encoding_values[] = {
+    { 1,    "Packet"},
+    { 2,    "Ethernet V2/DIX"},
+    { 3,    "ANSI/ETSI PDH"},
+    { 4,    "Reserved"},
+    { 5,    "SDH ITU-T G.707/SONET ANSI T1.105"},
+    { 6,    "Reserved"},
+    { 7,    "Digital Wrapper"},
+    { 8,    "Lambda (photonic)"},
+    { 9,    "Fiber"},
+    { 10,   "Reserved"},
+    { 11,   "FiberChannel"},
+    { 0, NULL }
+};
+
+struct tok gmpls_payload_values[] = {
+    {  0,   "Unknown"},
+    {  1,   "Reserved"},
+    {  2,   "Reserved"},
+    {  3,   "Reserved"},
+    {  4,   "Reserved"},
+    {  5,   "Asynchronous mapping of E4"},
+    {  6,   "Asynchronous mapping of DS3/T3"},
+    {  7,   "Asynchronous mapping of E3"},
+    {  8,   "Bit synchronous mapping of E3"},
+    {  9,   "Byte synchronous mapping of E3"},
+    { 10,   "Asynchronous mapping of DS2/T2"},
+    { 11,   "Bit synchronous mapping of DS2/T2"},
+    { 12,   "Reserved"},
+    { 13,   "Asynchronous mapping of E1"},
+    { 14,   "Byte synchronous mapping of E1"},
+    { 15,   "Byte synchronous mapping of 31 * DS0"},
+    { 16,   "Asynchronous mapping of DS1/T1"},
+    { 17,   "Bit synchronous mapping of DS1/T1"},
+    { 18,   "Byte synchronous mapping of DS1/T1"},
+    { 19,   "VC-11 in VC-12"},
+    { 20,   "Reserved"},
+    { 21,   "Reserved"},
+    { 22,   "DS1 SF Asynchronous"},
+    { 23,   "DS1 ESF Asynchronous"},
+    { 24,   "DS3 M23 Asynchronous"},
+    { 25,   "DS3 C-Bit Parity Asynchronous"},
+    { 26,   "VT/LOVC"},
+    { 27,   "STS SPE/HOVC"},
+    { 28,   "POS - No Scrambling, 16 bit CRC"},
+    { 29,   "POS - No Scrambling, 32 bit CRC"},
+    { 30,   "POS - Scrambling, 16 bit CRC"},
+    { 31,   "POS - Scrambling, 32 bit CRC"},
+    { 32,   "ATM mapping"},
+    { 33,   "Ethernet"},
+    { 34,   "SONET/SDH"},
+    { 35,   "Reserved (SONET deprecated)"},
+    { 36,   "Digital Wrapper"},
+    { 37,   "Lambda"},
+    { 38,   "ANSI/ETSI PDH"},
+    { 39,   "Reserved"},
+    { 40,   "Link Access Protocol SDH (X.85 and X.86)"},
+    { 41,   "FDDI"},
+    { 42,   "DQDB (ETSI ETS 300 216)"},
+    { 43,   "FiberChannel-3 (Services)"},
+    { 44,   "HDLC"},
+    { 45,   "Ethernet V2/DIX (only)"},
+    { 46,   "Ethernet 802.3 (only)"},
+    { 0, NULL }
+};
diff --git a/gmpls.h b/gmpls.h
index bf5a083a9cef8145534f6ee6b874eda45bbc4935..b6cf880bd798cae24f645792c09a8f4a547c95af 100644 (file)
--- a/gmpls.h
+++ b/gmpls.h
@@ -1,4 +1,4 @@
-/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.1 2003-06-06 23:47:53 hannes Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.2 2003-06-09 23:28:09 guy Exp $ (LBL) */
 /* 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that: (1) source code
  * Original code by Hannes Gredler ([email protected])
  */
 
-
-static struct tok gmpls_link_prot_values[] = {
-    { 0x01, "Extra Traffic"},
-    { 0x02, "Unprotected"},
-    { 0x04, "Shared"},
-    { 0x08, "Dedicated 1:1"},
-    { 0x10, "Dedicated 1+1"},
-    { 0x20, "Enhanced"},
-    { 0x40, "Reserved"},
-    { 0x80, "Reserved"},
-    { 0, NULL }
-};
-
-static struct tok gmpls_switch_cap_values[] = {
-    { 1,       "Packet-Switch Capable-1"},
-    { 2,       "Packet-Switch Capable-2"},
-    { 3,       "Packet-Switch Capable-3"},
-    { 4,       "Packet-Switch Capable-4"},
-    { 51,      "Layer-2 Switch Capable"},
-    { 100,     "Time-Division-Multiplex"},
-    { 150,     "Lambda-Switch Capable"},
-    { 200,     "Fiber-Switch Capable"},
-    { 0, NULL }
-};
-
-static struct tok gmpls_encoding_values[] = {
-    { 1,    "Packet"},
-    { 2,    "Ethernet V2/DIX"},
-    { 3,    "ANSI/ETSI PDH"},
-    { 4,    "Reserved"},
-    { 5,    "SDH ITU-T G.707/SONET ANSI T1.105"},
-    { 6,    "Reserved"},
-    { 7,    "Digital Wrapper"},
-    { 8,    "Lambda (photonic)"},
-    { 9,    "Fiber"},
-    { 10,   "Reserved"},
-    { 11,   "FiberChannel"},
-    { 0, NULL }
-};
-
-static struct tok gmpls_payload_values[] = {
-    {  0,   "Unknown"},
-    {  1,   "Reserved"},
-    {  2,   "Reserved"},
-    {  3,   "Reserved"},
-    {  4,   "Reserved"},
-    {  5,   "Asynchronous mapping of E4"},
-    {  6,   "Asynchronous mapping of DS3/T3"},
-    {  7,   "Asynchronous mapping of E3"},
-    {  8,   "Bit synchronous mapping of E3"},
-    {  9,   "Byte synchronous mapping of E3"},
-    { 10,   "Asynchronous mapping of DS2/T2"},
-    { 11,   "Bit synchronous mapping of DS2/T2"},
-    { 12,   "Reserved"},
-    { 13,   "Asynchronous mapping of E1"},
-    { 14,   "Byte synchronous mapping of E1"},
-    { 15,   "Byte synchronous mapping of 31 * DS0"},
-    { 16,   "Asynchronous mapping of DS1/T1"},
-    { 17,   "Bit synchronous mapping of DS1/T1"},
-    { 18,   "Byte synchronous mapping of DS1/T1"},
-    { 19,   "VC-11 in VC-12"},
-    { 20,   "Reserved"},
-    { 21,   "Reserved"},
-    { 22,   "DS1 SF Asynchronous"},
-    { 23,   "DS1 ESF Asynchronous"},
-    { 24,   "DS3 M23 Asynchronous"},
-    { 25,   "DS3 C-Bit Parity Asynchronous"},
-    { 26,   "VT/LOVC"},
-    { 27,   "STS SPE/HOVC"},
-    { 28,   "POS - No Scrambling, 16 bit CRC"},
-    { 29,   "POS - No Scrambling, 32 bit CRC"},
-    { 30,   "POS - Scrambling, 16 bit CRC"},
-    { 31,   "POS - Scrambling, 32 bit CRC"},
-    { 32,   "ATM mapping"},
-    { 33,   "Ethernet"},
-    { 34,   "SONET/SDH"},
-    { 35,   "Reserved (SONET deprecated)"},
-    { 36,   "Digital Wrapper"},
-    { 37,   "Lambda"},
-    { 38,   "ANSI/ETSI PDH"},
-    { 39,   "Reserved"},
-    { 40,   "Link Access Protocol SDH (X.85 and X.86)"},
-    { 41,   "FDDI"},
-    { 42,   "DQDB (ETSI ETS 300 216)"},
-    { 43,   "FiberChannel-3 (Services)"},
-    { 44,   "HDLC"},
-    { 45,   "Ethernet V2/DIX (only)"},
-    { 46,   "Ethernet 802.3 (only)"},
-    { 0, NULL }
-};
+extern struct tok gmpls_link_prot_values[];
+extern struct tok gmpls_switch_cap_values[];
+extern struct tok gmpls_encoding_values[];
+extern struct tok gmpls_payload_values[];