From: hannes Date: Fri, 6 Jun 2003 23:47:53 +0000 (+0000) Subject: outsource gmpls related tokens to gmpls.h X-Git-Tag: tcpdump-3.8-bp~116 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/8474904c14e532494f4650690ac5d3a70053dedc outsource gmpls related tokens to gmpls.h --- diff --git a/gmpls.h b/gmpls.h new file mode 100644 index 00000000..bf5a083a --- /dev/null +++ b/gmpls.h @@ -0,0 +1,106 @@ +/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.1 2003-06-06 23:47:53 hannes Exp $ (LBL) */ +/* + * 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 (hannes@juniper.net) + */ + + +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 } +}; diff --git a/print-isoclns.c b/print-isoclns.c index ab5135cc..70e1a90d 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.84 2003-05-22 16:52:37 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.85 2003-06-06 23:47:53 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -43,6 +43,7 @@ static const char rcsid[] = #include "ethertype.h" #include "ether.h" #include "extract.h" +#include "gmpls.h" #define NLPID_CLNS 129 /* 0x81 */ #define NLPID_ESIS 130 /* 0x82 */ @@ -254,45 +255,6 @@ static struct tok isis_mt_flag_values[] = { #define ISIS_MASK_TLV_SHARED_RISK_GROUP(x) ((x)&0x1) -static struct tok isis_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 isis_gmpls_sw_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 isis_gmpls_lsp_enc_values[] = { - { 1, "Packet"}, - { 2, "Ethernet V2/DIX"}, - { 3, "ANSI PDH"}, - { 4, "ETSI PDH"}, - { 5, "SDH ITU-T G.707"}, - { 6, "SONET ANSI T1.105"}, - { 7, "Digital Wrapper"}, - { 8, "Lambda (photonic)"}, - { 9, "Fiber"}, - { 10, "Ethernet 802.3"}, - { 11, "FiberChannel"}, - { 0, NULL } -}; - static struct tok isis_mt_values[] = { { 0, "IPv4 unicast"}, { 1, "In-Band Management"}, @@ -941,7 +903,7 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *i goto trunctlv; printf("%sLink Protection Type: %s, Priority %u", ident, - bittok2str(isis_gmpls_link_prot_values, "none", *tptr), + bittok2str(gmpls_link_prot_values, "none", *tptr), *(tptr+1)); break; case SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR: @@ -951,12 +913,12 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *i goto trunctlv; printf("%s Interface Switching Capability:%s", ident, - tok2str(isis_gmpls_sw_cap_values, "Unknown", *(tptr))); + tok2str(gmpls_switch_cap_values, "Unknown", *(tptr))); if (!TTEST2(*(tptr+1),1)) goto trunctlv; printf(", LSP Encoding: %s", - tok2str(isis_gmpls_lsp_enc_values, "Unknown", *(tptr+1))); + tok2str(gmpls_encoding_values, "Unknown", *(tptr+1))); if (!TTEST2(*(tptr+2),2)) /* skip 2 res. bytes */ goto trunctlv;