xref: /dflybsd-src/contrib/tcpdump/gmpls.c (revision 59c07fbdf8168fa08c76c515186d561b5a92690c)
141c99275SPeter Avalos /*
241c99275SPeter Avalos  * Redistribution and use in source and binary forms, with or without
341c99275SPeter Avalos  * modification, are permitted provided that: (1) source code
441c99275SPeter Avalos  * distributions retain the above copyright notice and this paragraph
541c99275SPeter Avalos  * in its entirety, and (2) distributions including binary code include
641c99275SPeter Avalos  * the above copyright notice and this paragraph in its entirety in
741c99275SPeter Avalos  * the documentation or other materials provided with the distribution.
841c99275SPeter Avalos  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
941c99275SPeter Avalos  * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
1041c99275SPeter Avalos  * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1141c99275SPeter Avalos  * FOR A PARTICULAR PURPOSE.
1241c99275SPeter Avalos  *
13411677aeSAaron LI  * Original code by Hannes Gredler (hannes@gredler.at)
1441c99275SPeter Avalos  */
1541c99275SPeter Avalos 
1641c99275SPeter Avalos #ifdef HAVE_CONFIG_H
17*ed775ee7SAntonio Huete Jimenez #include <config.h>
1841c99275SPeter Avalos #endif
1941c99275SPeter Avalos 
20*ed775ee7SAntonio Huete Jimenez #include "netdissect-stdinc.h"
2141c99275SPeter Avalos 
22411677aeSAaron LI #include "netdissect.h"
23ea7b4bf5SPeter Avalos #include "gmpls.h"
2441c99275SPeter Avalos 
2541c99275SPeter Avalos /* rfc3471 */
2627bfbee1SPeter Avalos const struct tok gmpls_link_prot_values[] = {
2741c99275SPeter Avalos     { 0x01, "Extra Traffic"},
2841c99275SPeter Avalos     { 0x02, "Unprotected"},
2941c99275SPeter Avalos     { 0x04, "Shared"},
3041c99275SPeter Avalos     { 0x08, "Dedicated 1:1"},
3141c99275SPeter Avalos     { 0x10, "Dedicated 1+1"},
3241c99275SPeter Avalos     { 0x20, "Enhanced"},
3341c99275SPeter Avalos     { 0x40, "Reserved"},
3441c99275SPeter Avalos     { 0x80, "Reserved"},
3541c99275SPeter Avalos     { 0, NULL }
3641c99275SPeter Avalos };
3741c99275SPeter Avalos 
3841c99275SPeter Avalos /* rfc3471 */
3927bfbee1SPeter Avalos const struct tok gmpls_switch_cap_values[] = {
40ea7b4bf5SPeter Avalos     { GMPLS_PSC1, "Packet-Switch Capable-1"},
41ea7b4bf5SPeter Avalos     { GMPLS_PSC2, "Packet-Switch Capable-2"},
42ea7b4bf5SPeter Avalos     { GMPLS_PSC3, "Packet-Switch Capable-3"},
43ea7b4bf5SPeter Avalos     { GMPLS_PSC4, "Packet-Switch Capable-4"},
44ea7b4bf5SPeter Avalos     { GMPLS_L2SC, "Layer-2 Switch Capable"},
45ea7b4bf5SPeter Avalos     { GMPLS_TSC, "Time-Division-Multiplex"},
46ea7b4bf5SPeter Avalos     { GMPLS_LSC, "Lambda-Switch Capable"},
47ea7b4bf5SPeter Avalos     { GMPLS_FSC, "Fiber-Switch Capable"},
48ea7b4bf5SPeter Avalos     { 0, NULL }
49ea7b4bf5SPeter Avalos };
50ea7b4bf5SPeter Avalos 
51ea7b4bf5SPeter Avalos /* rfc4205 */
5227bfbee1SPeter Avalos const struct tok gmpls_switch_cap_tsc_indication_values[] = {
53ea7b4bf5SPeter Avalos     { 0, "Standard SONET/SDH" },
54ea7b4bf5SPeter Avalos     { 1, "Arbitrary SONET/SDH" },
5541c99275SPeter Avalos     { 0, NULL }
5641c99275SPeter Avalos };
5741c99275SPeter Avalos 
5841c99275SPeter Avalos /* rfc3471 */
5927bfbee1SPeter Avalos const struct tok gmpls_encoding_values[] = {
6041c99275SPeter Avalos     { 1,    "Packet"},
6141c99275SPeter Avalos     { 2,    "Ethernet V2/DIX"},
6241c99275SPeter Avalos     { 3,    "ANSI/ETSI PDH"},
6341c99275SPeter Avalos     { 4,    "Reserved"},
6441c99275SPeter Avalos     { 5,    "SDH ITU-T G.707/SONET ANSI T1.105"},
6541c99275SPeter Avalos     { 6,    "Reserved"},
6641c99275SPeter Avalos     { 7,    "Digital Wrapper"},
6741c99275SPeter Avalos     { 8,    "Lambda (photonic)"},
6841c99275SPeter Avalos     { 9,    "Fiber"},
6941c99275SPeter Avalos     { 10,   "Reserved"},
7041c99275SPeter Avalos     { 11,   "FiberChannel"},
7141c99275SPeter Avalos     { 0, NULL }
7241c99275SPeter Avalos };
7341c99275SPeter Avalos 
7441c99275SPeter Avalos /* rfc3471 */
7527bfbee1SPeter Avalos const struct tok gmpls_payload_values[] = {
7641c99275SPeter Avalos     {  0,   "Unknown"},
7741c99275SPeter Avalos     {  1,   "Reserved"},
7841c99275SPeter Avalos     {  2,   "Reserved"},
7941c99275SPeter Avalos     {  3,   "Reserved"},
8041c99275SPeter Avalos     {  4,   "Reserved"},
8141c99275SPeter Avalos     {  5,   "Asynchronous mapping of E4"},
8241c99275SPeter Avalos     {  6,   "Asynchronous mapping of DS3/T3"},
8341c99275SPeter Avalos     {  7,   "Asynchronous mapping of E3"},
8441c99275SPeter Avalos     {  8,   "Bit synchronous mapping of E3"},
8541c99275SPeter Avalos     {  9,   "Byte synchronous mapping of E3"},
8641c99275SPeter Avalos     { 10,   "Asynchronous mapping of DS2/T2"},
8741c99275SPeter Avalos     { 11,   "Bit synchronous mapping of DS2/T2"},
8841c99275SPeter Avalos     { 12,   "Reserved"},
8941c99275SPeter Avalos     { 13,   "Asynchronous mapping of E1"},
9041c99275SPeter Avalos     { 14,   "Byte synchronous mapping of E1"},
9141c99275SPeter Avalos     { 15,   "Byte synchronous mapping of 31 * DS0"},
9241c99275SPeter Avalos     { 16,   "Asynchronous mapping of DS1/T1"},
9341c99275SPeter Avalos     { 17,   "Bit synchronous mapping of DS1/T1"},
9441c99275SPeter Avalos     { 18,   "Byte synchronous mapping of DS1/T1"},
9541c99275SPeter Avalos     { 19,   "VC-11 in VC-12"},
9641c99275SPeter Avalos     { 20,   "Reserved"},
9741c99275SPeter Avalos     { 21,   "Reserved"},
9841c99275SPeter Avalos     { 22,   "DS1 SF Asynchronous"},
9941c99275SPeter Avalos     { 23,   "DS1 ESF Asynchronous"},
10041c99275SPeter Avalos     { 24,   "DS3 M23 Asynchronous"},
10141c99275SPeter Avalos     { 25,   "DS3 C-Bit Parity Asynchronous"},
10241c99275SPeter Avalos     { 26,   "VT/LOVC"},
10341c99275SPeter Avalos     { 27,   "STS SPE/HOVC"},
10441c99275SPeter Avalos     { 28,   "POS - No Scrambling, 16 bit CRC"},
10541c99275SPeter Avalos     { 29,   "POS - No Scrambling, 32 bit CRC"},
10641c99275SPeter Avalos     { 30,   "POS - Scrambling, 16 bit CRC"},
10741c99275SPeter Avalos     { 31,   "POS - Scrambling, 32 bit CRC"},
10841c99275SPeter Avalos     { 32,   "ATM mapping"},
10941c99275SPeter Avalos     { 33,   "Ethernet PHY"},
11041c99275SPeter Avalos     { 34,   "SONET/SDH"},
11141c99275SPeter Avalos     { 35,   "Reserved (SONET deprecated)"},
11241c99275SPeter Avalos     { 36,   "Digital Wrapper"},
11341c99275SPeter Avalos     { 37,   "Lambda"},
11441c99275SPeter Avalos     { 38,   "ANSI/ETSI PDH"},
11541c99275SPeter Avalos     { 39,   "Reserved"},
11641c99275SPeter Avalos     { 40,   "Link Access Protocol SDH (X.85 and X.86)"},
11741c99275SPeter Avalos     { 41,   "FDDI"},
11841c99275SPeter Avalos     { 42,   "DQDB (ETSI ETS 300 216)"},
11941c99275SPeter Avalos     { 43,   "FiberChannel-3 (Services)"},
12041c99275SPeter Avalos     { 44,   "HDLC"},
12141c99275SPeter Avalos     { 45,   "Ethernet V2/DIX (only)"},
12241c99275SPeter Avalos     { 46,   "Ethernet 802.3 (only)"},
12341c99275SPeter Avalos /* draft-ietf-ccamp-gmpls-g709-04.txt */
12441c99275SPeter Avalos     { 47,   "G.709 ODUj"},
12541c99275SPeter Avalos     { 48,   "G.709 OTUk(v)"},
12641c99275SPeter Avalos     { 49,   "CBR/CBRa"},
12741c99275SPeter Avalos     { 50,   "CBRb"},
12841c99275SPeter Avalos     { 51,   "BSOT"},
12941c99275SPeter Avalos     { 52,   "BSNT"},
13041c99275SPeter Avalos     { 53,   "IP/PPP (GFP)"},
13141c99275SPeter Avalos     { 54,   "Ethernet MAC (framed GFP)"},
13241c99275SPeter Avalos     { 55,   "Ethernet PHY (transparent GFP)"},
13341c99275SPeter Avalos     { 56,   "ESCON"},
13441c99275SPeter Avalos     { 57,   "FICON"},
13541c99275SPeter Avalos     { 58,   "Fiber Channel"},
13641c99275SPeter Avalos     { 0, NULL }
13741c99275SPeter Avalos };
13841c99275SPeter Avalos 
13941c99275SPeter Avalos /*
14041c99275SPeter Avalos  * Link Type values used by LMP Service Discovery (specifically, the Client
14141c99275SPeter Avalos  * Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details.
14241c99275SPeter Avalos  */
14327bfbee1SPeter Avalos const struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
14441c99275SPeter Avalos     { 5, "SDH ITU-T G.707"},
14541c99275SPeter Avalos     { 6, "SONET ANSI T1.105"},
14641c99275SPeter Avalos     { 0, NULL}
14741c99275SPeter Avalos };
14841c99275SPeter Avalos 
14941c99275SPeter Avalos /*
15041c99275SPeter Avalos  * Signal Type values for SDH links used by LMP Service Discovery (specifically,
15141c99275SPeter Avalos  * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
15241c99275SPeter Avalos  * details.
15341c99275SPeter Avalos  */
15427bfbee1SPeter Avalos const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
15541c99275SPeter Avalos     { 5,  "VC-3"},
15641c99275SPeter Avalos     { 6,  "VC-4"},
15741c99275SPeter Avalos     { 7,  "STM-0"},
15841c99275SPeter Avalos     { 8,  "STM-1"},
15941c99275SPeter Avalos     { 9,  "STM-4"},
16041c99275SPeter Avalos     { 10, "STM-16"},
16141c99275SPeter Avalos     { 11, "STM-64"},
16241c99275SPeter Avalos     { 12, "STM-256"},
16341c99275SPeter Avalos     { 0, NULL}
16441c99275SPeter Avalos };
16541c99275SPeter Avalos 
16641c99275SPeter Avalos /*
16741c99275SPeter Avalos  * Signal Type values for SONET links used by LMP Service Discovery (specifically,
16841c99275SPeter Avalos  * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
16941c99275SPeter Avalos  * details.
17041c99275SPeter Avalos  */
17127bfbee1SPeter Avalos const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
17241c99275SPeter Avalos     { 5,  "STS-1 SPE"},
17341c99275SPeter Avalos     { 6,  "STS-3c SPE"},
17441c99275SPeter Avalos     { 7,  "STS-1"},
17541c99275SPeter Avalos     { 8,  "STM-3"},
17641c99275SPeter Avalos     { 9,  "STM-12"},
17741c99275SPeter Avalos     { 10, "STM-48"},
17841c99275SPeter Avalos     { 11, "STM-192"},
17941c99275SPeter Avalos     { 12, "STM-768"},
18041c99275SPeter Avalos     { 0, NULL}
18141c99275SPeter Avalos };
18241c99275SPeter Avalos 
18341c99275SPeter Avalos #define DIFFSERV_BC_MODEL_RDM           0   /* draft-ietf-tewg-diff-te-proto-07 */
18441c99275SPeter Avalos #define DIFFSERV_BC_MODEL_MAM           1   /* draft-ietf-tewg-diff-te-proto-07 */
18541c99275SPeter Avalos #define DIFFSERV_BC_MODEL_EXTD_MAM      254 /* experimental */
18641c99275SPeter Avalos 
18727bfbee1SPeter Avalos const struct tok diffserv_te_bc_values[] = {
18841c99275SPeter Avalos     {  DIFFSERV_BC_MODEL_RDM, "Russian dolls"},
18941c99275SPeter Avalos     {  DIFFSERV_BC_MODEL_MAM, "Maximum allocation"},
19041c99275SPeter Avalos     {  DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"},
19141c99275SPeter Avalos     { 0, NULL }
19241c99275SPeter Avalos };
193