15b0fe478SBruce M Simpson /* 25b0fe478SBruce M Simpson * Redistribution and use in source and binary forms, with or without 35b0fe478SBruce M Simpson * modification, are permitted provided that: (1) source code 45b0fe478SBruce M Simpson * distributions retain the above copyright notice and this paragraph 55b0fe478SBruce M Simpson * in its entirety, and (2) distributions including binary code include 65b0fe478SBruce M Simpson * the above copyright notice and this paragraph in its entirety in 75b0fe478SBruce M Simpson * the documentation or other materials provided with the distribution. 85b0fe478SBruce M Simpson * THIS SOFTWARE IS PROVIDED ``AS IS'' AND 95b0fe478SBruce M Simpson * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT 105b0fe478SBruce M Simpson * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 115b0fe478SBruce M Simpson * FOR A PARTICULAR PURPOSE. 125b0fe478SBruce M Simpson * 135b0fe478SBruce M Simpson * Original code by Hannes Gredler (hannes@juniper.net) 145b0fe478SBruce M Simpson */ 155b0fe478SBruce M Simpson 165b0fe478SBruce M Simpson #ifndef lint 175b0fe478SBruce M Simpson static const char rcsid[] _U_ = 18f4d0c64aSSam Leffler "@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.5.2.1 2005/05/19 06:44:02 guy Exp $ (LBL)"; 195b0fe478SBruce M Simpson #endif 205b0fe478SBruce M Simpson 215b0fe478SBruce M Simpson #ifdef HAVE_CONFIG_H 225b0fe478SBruce M Simpson #include "config.h" 235b0fe478SBruce M Simpson #endif 245b0fe478SBruce M Simpson 255b0fe478SBruce M Simpson #include <tcpdump-stdinc.h> 265b0fe478SBruce M Simpson 275b0fe478SBruce M Simpson #include "interface.h" 285b0fe478SBruce M Simpson 295b0fe478SBruce M Simpson /* rfc3471 */ 305b0fe478SBruce M Simpson struct tok gmpls_link_prot_values[] = { 315b0fe478SBruce M Simpson { 0x01, "Extra Traffic"}, 325b0fe478SBruce M Simpson { 0x02, "Unprotected"}, 335b0fe478SBruce M Simpson { 0x04, "Shared"}, 345b0fe478SBruce M Simpson { 0x08, "Dedicated 1:1"}, 355b0fe478SBruce M Simpson { 0x10, "Dedicated 1+1"}, 365b0fe478SBruce M Simpson { 0x20, "Enhanced"}, 375b0fe478SBruce M Simpson { 0x40, "Reserved"}, 385b0fe478SBruce M Simpson { 0x80, "Reserved"}, 395b0fe478SBruce M Simpson { 0, NULL } 405b0fe478SBruce M Simpson }; 415b0fe478SBruce M Simpson 425b0fe478SBruce M Simpson /* rfc3471 */ 435b0fe478SBruce M Simpson struct tok gmpls_switch_cap_values[] = { 445b0fe478SBruce M Simpson { 1, "Packet-Switch Capable-1"}, 455b0fe478SBruce M Simpson { 2, "Packet-Switch Capable-2"}, 465b0fe478SBruce M Simpson { 3, "Packet-Switch Capable-3"}, 475b0fe478SBruce M Simpson { 4, "Packet-Switch Capable-4"}, 485b0fe478SBruce M Simpson { 51, "Layer-2 Switch Capable"}, 495b0fe478SBruce M Simpson { 100, "Time-Division-Multiplex"}, 505b0fe478SBruce M Simpson { 150, "Lambda-Switch Capable"}, 515b0fe478SBruce M Simpson { 200, "Fiber-Switch Capable"}, 525b0fe478SBruce M Simpson { 0, NULL } 535b0fe478SBruce M Simpson }; 545b0fe478SBruce M Simpson 555b0fe478SBruce M Simpson /* rfc3471 */ 565b0fe478SBruce M Simpson struct tok gmpls_encoding_values[] = { 575b0fe478SBruce M Simpson { 1, "Packet"}, 585b0fe478SBruce M Simpson { 2, "Ethernet V2/DIX"}, 595b0fe478SBruce M Simpson { 3, "ANSI/ETSI PDH"}, 605b0fe478SBruce M Simpson { 4, "Reserved"}, 615b0fe478SBruce M Simpson { 5, "SDH ITU-T G.707/SONET ANSI T1.105"}, 625b0fe478SBruce M Simpson { 6, "Reserved"}, 635b0fe478SBruce M Simpson { 7, "Digital Wrapper"}, 645b0fe478SBruce M Simpson { 8, "Lambda (photonic)"}, 655b0fe478SBruce M Simpson { 9, "Fiber"}, 665b0fe478SBruce M Simpson { 10, "Reserved"}, 675b0fe478SBruce M Simpson { 11, "FiberChannel"}, 685b0fe478SBruce M Simpson { 0, NULL } 695b0fe478SBruce M Simpson }; 705b0fe478SBruce M Simpson 715b0fe478SBruce M Simpson /* rfc3471 */ 725b0fe478SBruce M Simpson struct tok gmpls_payload_values[] = { 735b0fe478SBruce M Simpson { 0, "Unknown"}, 745b0fe478SBruce M Simpson { 1, "Reserved"}, 755b0fe478SBruce M Simpson { 2, "Reserved"}, 765b0fe478SBruce M Simpson { 3, "Reserved"}, 775b0fe478SBruce M Simpson { 4, "Reserved"}, 785b0fe478SBruce M Simpson { 5, "Asynchronous mapping of E4"}, 795b0fe478SBruce M Simpson { 6, "Asynchronous mapping of DS3/T3"}, 805b0fe478SBruce M Simpson { 7, "Asynchronous mapping of E3"}, 815b0fe478SBruce M Simpson { 8, "Bit synchronous mapping of E3"}, 825b0fe478SBruce M Simpson { 9, "Byte synchronous mapping of E3"}, 835b0fe478SBruce M Simpson { 10, "Asynchronous mapping of DS2/T2"}, 845b0fe478SBruce M Simpson { 11, "Bit synchronous mapping of DS2/T2"}, 855b0fe478SBruce M Simpson { 12, "Reserved"}, 865b0fe478SBruce M Simpson { 13, "Asynchronous mapping of E1"}, 875b0fe478SBruce M Simpson { 14, "Byte synchronous mapping of E1"}, 885b0fe478SBruce M Simpson { 15, "Byte synchronous mapping of 31 * DS0"}, 895b0fe478SBruce M Simpson { 16, "Asynchronous mapping of DS1/T1"}, 905b0fe478SBruce M Simpson { 17, "Bit synchronous mapping of DS1/T1"}, 915b0fe478SBruce M Simpson { 18, "Byte synchronous mapping of DS1/T1"}, 925b0fe478SBruce M Simpson { 19, "VC-11 in VC-12"}, 935b0fe478SBruce M Simpson { 20, "Reserved"}, 945b0fe478SBruce M Simpson { 21, "Reserved"}, 955b0fe478SBruce M Simpson { 22, "DS1 SF Asynchronous"}, 965b0fe478SBruce M Simpson { 23, "DS1 ESF Asynchronous"}, 975b0fe478SBruce M Simpson { 24, "DS3 M23 Asynchronous"}, 985b0fe478SBruce M Simpson { 25, "DS3 C-Bit Parity Asynchronous"}, 995b0fe478SBruce M Simpson { 26, "VT/LOVC"}, 1005b0fe478SBruce M Simpson { 27, "STS SPE/HOVC"}, 1015b0fe478SBruce M Simpson { 28, "POS - No Scrambling, 16 bit CRC"}, 1025b0fe478SBruce M Simpson { 29, "POS - No Scrambling, 32 bit CRC"}, 1035b0fe478SBruce M Simpson { 30, "POS - Scrambling, 16 bit CRC"}, 1045b0fe478SBruce M Simpson { 31, "POS - Scrambling, 32 bit CRC"}, 1055b0fe478SBruce M Simpson { 32, "ATM mapping"}, 1065b0fe478SBruce M Simpson { 33, "Ethernet PHY"}, 1075b0fe478SBruce M Simpson { 34, "SONET/SDH"}, 1085b0fe478SBruce M Simpson { 35, "Reserved (SONET deprecated)"}, 1095b0fe478SBruce M Simpson { 36, "Digital Wrapper"}, 1105b0fe478SBruce M Simpson { 37, "Lambda"}, 1115b0fe478SBruce M Simpson { 38, "ANSI/ETSI PDH"}, 1125b0fe478SBruce M Simpson { 39, "Reserved"}, 1135b0fe478SBruce M Simpson { 40, "Link Access Protocol SDH (X.85 and X.86)"}, 1145b0fe478SBruce M Simpson { 41, "FDDI"}, 1155b0fe478SBruce M Simpson { 42, "DQDB (ETSI ETS 300 216)"}, 1165b0fe478SBruce M Simpson { 43, "FiberChannel-3 (Services)"}, 1175b0fe478SBruce M Simpson { 44, "HDLC"}, 1185b0fe478SBruce M Simpson { 45, "Ethernet V2/DIX (only)"}, 1195b0fe478SBruce M Simpson { 46, "Ethernet 802.3 (only)"}, 1205b0fe478SBruce M Simpson /* draft-ietf-ccamp-gmpls-g709-04.txt */ 1215b0fe478SBruce M Simpson { 47, "G.709 ODUj"}, 1225b0fe478SBruce M Simpson { 48, "G.709 OTUk(v)"}, 1235b0fe478SBruce M Simpson { 49, "CBR/CBRa"}, 1245b0fe478SBruce M Simpson { 50, "CBRb"}, 1255b0fe478SBruce M Simpson { 51, "BSOT"}, 1265b0fe478SBruce M Simpson { 52, "BSNT"}, 1275b0fe478SBruce M Simpson { 53, "IP/PPP (GFP)"}, 1285b0fe478SBruce M Simpson { 54, "Ethernet MAC (framed GFP)"}, 1295b0fe478SBruce M Simpson { 55, "Ethernet PHY (transparent GFP)"}, 1305b0fe478SBruce M Simpson { 56, "ESCON"}, 1315b0fe478SBruce M Simpson { 57, "FICON"}, 1325b0fe478SBruce M Simpson { 58, "Fiber Channel"}, 1335b0fe478SBruce M Simpson { 0, NULL } 1345b0fe478SBruce M Simpson }; 1351de50e9fSSam Leffler 136f4d0c64aSSam Leffler /* 137f4d0c64aSSam Leffler * Link Type values used by LMP Service Discovery (specifically, the Client 138f4d0c64aSSam Leffler * Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details. 139f4d0c64aSSam Leffler */ 140f4d0c64aSSam Leffler struct tok lmp_sd_service_config_cpsa_link_type_values[] = { 141f4d0c64aSSam Leffler { 5, "SDH ITU-T G.707"}, 142f4d0c64aSSam Leffler { 6, "SONET ANSI T1.105"}, 143f4d0c64aSSam Leffler { 0, NULL} 144f4d0c64aSSam Leffler }; 145f4d0c64aSSam Leffler 146f4d0c64aSSam Leffler /* 147f4d0c64aSSam Leffler * Signal Type values for SDH links used by LMP Service Discovery (specifically, 148f4d0c64aSSam Leffler * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for 149f4d0c64aSSam Leffler * details. 150f4d0c64aSSam Leffler */ 151f4d0c64aSSam Leffler struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = { 152f4d0c64aSSam Leffler { 5, "VC-3"}, 153f4d0c64aSSam Leffler { 6, "VC-4"}, 154f4d0c64aSSam Leffler { 7, "STM-0"}, 155f4d0c64aSSam Leffler { 8, "STM-1"}, 156f4d0c64aSSam Leffler { 9, "STM-4"}, 157f4d0c64aSSam Leffler { 10, "STM-16"}, 158f4d0c64aSSam Leffler { 11, "STM-64"}, 159f4d0c64aSSam Leffler { 12, "STM-256"}, 160f4d0c64aSSam Leffler { 0, NULL} 161f4d0c64aSSam Leffler }; 162f4d0c64aSSam Leffler 163f4d0c64aSSam Leffler /* 164f4d0c64aSSam Leffler * Signal Type values for SONET links used by LMP Service Discovery (specifically, 165f4d0c64aSSam Leffler * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for 166f4d0c64aSSam Leffler * details. 167f4d0c64aSSam Leffler */ 168f4d0c64aSSam Leffler struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = { 169f4d0c64aSSam Leffler { 5, "STS-1 SPE"}, 170f4d0c64aSSam Leffler { 6, "STS-3c SPE"}, 171f4d0c64aSSam Leffler { 7, "STS-1"}, 172f4d0c64aSSam Leffler { 8, "STM-3"}, 173f4d0c64aSSam Leffler { 9, "STM-12"}, 174f4d0c64aSSam Leffler { 10, "STM-48"}, 175f4d0c64aSSam Leffler { 11, "STM-192"}, 176f4d0c64aSSam Leffler { 12, "STM-768"}, 177f4d0c64aSSam Leffler { 0, NULL} 178f4d0c64aSSam Leffler }; 179f4d0c64aSSam Leffler 1801de50e9fSSam Leffler #define DIFFSERV_BC_MODEL_RDM 0 /* draft-ietf-tewg-diff-te-proto-07 */ 1811de50e9fSSam Leffler #define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */ 1821de50e9fSSam Leffler #define DIFFSERV_BC_MODEL_EXTD_MAM 254 /* experimental */ 1831de50e9fSSam Leffler 1841de50e9fSSam Leffler struct tok diffserv_te_bc_values[] = { 1851de50e9fSSam Leffler { DIFFSERV_BC_MODEL_RDM, "Russian dolls"}, 1861de50e9fSSam Leffler { DIFFSERV_BC_MODEL_MAM, "Maximum allocation"}, 1871de50e9fSSam Leffler { DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"}, 1881de50e9fSSam Leffler { 0, NULL } 1891de50e9fSSam Leffler }; 190