xref: /freebsd/contrib/tcpdump/gmpls.c (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
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  *
130bff6a5aSEd Maste  * Original code by Hannes Gredler (hannes@gredler.at)
145b0fe478SBruce M Simpson  */
155b0fe478SBruce M Simpson 
165b0fe478SBruce M Simpson #ifdef HAVE_CONFIG_H
17*ee67461eSJoseph Mingrone #include <config.h>
185b0fe478SBruce M Simpson #endif
195b0fe478SBruce M Simpson 
20*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
215b0fe478SBruce M Simpson 
223340d773SGleb Smirnoff #include "netdissect.h"
23a5779b6eSRui Paulo #include "gmpls.h"
245b0fe478SBruce M Simpson 
255b0fe478SBruce M Simpson /* rfc3471 */
2627df3f5dSRui Paulo const struct tok gmpls_link_prot_values[] = {
275b0fe478SBruce M Simpson     { 0x01, "Extra Traffic"},
285b0fe478SBruce M Simpson     { 0x02, "Unprotected"},
295b0fe478SBruce M Simpson     { 0x04, "Shared"},
305b0fe478SBruce M Simpson     { 0x08, "Dedicated 1:1"},
315b0fe478SBruce M Simpson     { 0x10, "Dedicated 1+1"},
325b0fe478SBruce M Simpson     { 0x20, "Enhanced"},
335b0fe478SBruce M Simpson     { 0x40, "Reserved"},
345b0fe478SBruce M Simpson     { 0x80, "Reserved"},
355b0fe478SBruce M Simpson     { 0, NULL }
365b0fe478SBruce M Simpson };
375b0fe478SBruce M Simpson 
385b0fe478SBruce M Simpson /* rfc3471 */
3927df3f5dSRui Paulo const struct tok gmpls_switch_cap_values[] = {
40a5779b6eSRui Paulo     { GMPLS_PSC1, "Packet-Switch Capable-1"},
41a5779b6eSRui Paulo     { GMPLS_PSC2, "Packet-Switch Capable-2"},
42a5779b6eSRui Paulo     { GMPLS_PSC3, "Packet-Switch Capable-3"},
43a5779b6eSRui Paulo     { GMPLS_PSC4, "Packet-Switch Capable-4"},
44a5779b6eSRui Paulo     { GMPLS_L2SC, "Layer-2 Switch Capable"},
45a5779b6eSRui Paulo     { GMPLS_TSC, "Time-Division-Multiplex"},
46a5779b6eSRui Paulo     { GMPLS_LSC, "Lambda-Switch Capable"},
47a5779b6eSRui Paulo     { GMPLS_FSC, "Fiber-Switch Capable"},
48a5779b6eSRui Paulo     { 0, NULL }
49a5779b6eSRui Paulo };
50a5779b6eSRui Paulo 
51a5779b6eSRui Paulo /* rfc4205 */
5227df3f5dSRui Paulo const struct tok gmpls_switch_cap_tsc_indication_values[] = {
53a5779b6eSRui Paulo     { 0, "Standard SONET/SDH" },
54a5779b6eSRui Paulo     { 1, "Arbitrary SONET/SDH" },
555b0fe478SBruce M Simpson     { 0, NULL }
565b0fe478SBruce M Simpson };
575b0fe478SBruce M Simpson 
585b0fe478SBruce M Simpson /* rfc3471 */
5927df3f5dSRui Paulo const struct tok gmpls_encoding_values[] = {
605b0fe478SBruce M Simpson     { 1,    "Packet"},
615b0fe478SBruce M Simpson     { 2,    "Ethernet V2/DIX"},
625b0fe478SBruce M Simpson     { 3,    "ANSI/ETSI PDH"},
635b0fe478SBruce M Simpson     { 4,    "Reserved"},
645b0fe478SBruce M Simpson     { 5,    "SDH ITU-T G.707/SONET ANSI T1.105"},
655b0fe478SBruce M Simpson     { 6,    "Reserved"},
665b0fe478SBruce M Simpson     { 7,    "Digital Wrapper"},
675b0fe478SBruce M Simpson     { 8,    "Lambda (photonic)"},
685b0fe478SBruce M Simpson     { 9,    "Fiber"},
695b0fe478SBruce M Simpson     { 10,   "Reserved"},
705b0fe478SBruce M Simpson     { 11,   "FiberChannel"},
715b0fe478SBruce M Simpson     { 0, NULL }
725b0fe478SBruce M Simpson };
735b0fe478SBruce M Simpson 
745b0fe478SBruce M Simpson /* rfc3471 */
7527df3f5dSRui Paulo const struct tok gmpls_payload_values[] = {
765b0fe478SBruce M Simpson     {  0,   "Unknown"},
775b0fe478SBruce M Simpson     {  1,   "Reserved"},
785b0fe478SBruce M Simpson     {  2,   "Reserved"},
795b0fe478SBruce M Simpson     {  3,   "Reserved"},
805b0fe478SBruce M Simpson     {  4,   "Reserved"},
815b0fe478SBruce M Simpson     {  5,   "Asynchronous mapping of E4"},
825b0fe478SBruce M Simpson     {  6,   "Asynchronous mapping of DS3/T3"},
835b0fe478SBruce M Simpson     {  7,   "Asynchronous mapping of E3"},
845b0fe478SBruce M Simpson     {  8,   "Bit synchronous mapping of E3"},
855b0fe478SBruce M Simpson     {  9,   "Byte synchronous mapping of E3"},
865b0fe478SBruce M Simpson     { 10,   "Asynchronous mapping of DS2/T2"},
875b0fe478SBruce M Simpson     { 11,   "Bit synchronous mapping of DS2/T2"},
885b0fe478SBruce M Simpson     { 12,   "Reserved"},
895b0fe478SBruce M Simpson     { 13,   "Asynchronous mapping of E1"},
905b0fe478SBruce M Simpson     { 14,   "Byte synchronous mapping of E1"},
915b0fe478SBruce M Simpson     { 15,   "Byte synchronous mapping of 31 * DS0"},
925b0fe478SBruce M Simpson     { 16,   "Asynchronous mapping of DS1/T1"},
935b0fe478SBruce M Simpson     { 17,   "Bit synchronous mapping of DS1/T1"},
945b0fe478SBruce M Simpson     { 18,   "Byte synchronous mapping of DS1/T1"},
955b0fe478SBruce M Simpson     { 19,   "VC-11 in VC-12"},
965b0fe478SBruce M Simpson     { 20,   "Reserved"},
975b0fe478SBruce M Simpson     { 21,   "Reserved"},
985b0fe478SBruce M Simpson     { 22,   "DS1 SF Asynchronous"},
995b0fe478SBruce M Simpson     { 23,   "DS1 ESF Asynchronous"},
1005b0fe478SBruce M Simpson     { 24,   "DS3 M23 Asynchronous"},
1015b0fe478SBruce M Simpson     { 25,   "DS3 C-Bit Parity Asynchronous"},
1025b0fe478SBruce M Simpson     { 26,   "VT/LOVC"},
1035b0fe478SBruce M Simpson     { 27,   "STS SPE/HOVC"},
1045b0fe478SBruce M Simpson     { 28,   "POS - No Scrambling, 16 bit CRC"},
1055b0fe478SBruce M Simpson     { 29,   "POS - No Scrambling, 32 bit CRC"},
1065b0fe478SBruce M Simpson     { 30,   "POS - Scrambling, 16 bit CRC"},
1075b0fe478SBruce M Simpson     { 31,   "POS - Scrambling, 32 bit CRC"},
1085b0fe478SBruce M Simpson     { 32,   "ATM mapping"},
1095b0fe478SBruce M Simpson     { 33,   "Ethernet PHY"},
1105b0fe478SBruce M Simpson     { 34,   "SONET/SDH"},
1115b0fe478SBruce M Simpson     { 35,   "Reserved (SONET deprecated)"},
1125b0fe478SBruce M Simpson     { 36,   "Digital Wrapper"},
1135b0fe478SBruce M Simpson     { 37,   "Lambda"},
1145b0fe478SBruce M Simpson     { 38,   "ANSI/ETSI PDH"},
1155b0fe478SBruce M Simpson     { 39,   "Reserved"},
1165b0fe478SBruce M Simpson     { 40,   "Link Access Protocol SDH (X.85 and X.86)"},
1175b0fe478SBruce M Simpson     { 41,   "FDDI"},
1185b0fe478SBruce M Simpson     { 42,   "DQDB (ETSI ETS 300 216)"},
1195b0fe478SBruce M Simpson     { 43,   "FiberChannel-3 (Services)"},
1205b0fe478SBruce M Simpson     { 44,   "HDLC"},
1215b0fe478SBruce M Simpson     { 45,   "Ethernet V2/DIX (only)"},
1225b0fe478SBruce M Simpson     { 46,   "Ethernet 802.3 (only)"},
1235b0fe478SBruce M Simpson /* draft-ietf-ccamp-gmpls-g709-04.txt */
1245b0fe478SBruce M Simpson     { 47,   "G.709 ODUj"},
1255b0fe478SBruce M Simpson     { 48,   "G.709 OTUk(v)"},
1265b0fe478SBruce M Simpson     { 49,   "CBR/CBRa"},
1275b0fe478SBruce M Simpson     { 50,   "CBRb"},
1285b0fe478SBruce M Simpson     { 51,   "BSOT"},
1295b0fe478SBruce M Simpson     { 52,   "BSNT"},
1305b0fe478SBruce M Simpson     { 53,   "IP/PPP (GFP)"},
1315b0fe478SBruce M Simpson     { 54,   "Ethernet MAC (framed GFP)"},
1325b0fe478SBruce M Simpson     { 55,   "Ethernet PHY (transparent GFP)"},
1335b0fe478SBruce M Simpson     { 56,   "ESCON"},
1345b0fe478SBruce M Simpson     { 57,   "FICON"},
1355b0fe478SBruce M Simpson     { 58,   "Fiber Channel"},
1365b0fe478SBruce M Simpson     { 0, NULL }
1375b0fe478SBruce M Simpson };
1381de50e9fSSam Leffler 
139f4d0c64aSSam Leffler /*
140f4d0c64aSSam Leffler  * Link Type values used by LMP Service Discovery (specifically, the Client
141f4d0c64aSSam Leffler  * Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details.
142f4d0c64aSSam Leffler  */
14327df3f5dSRui Paulo const struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
144f4d0c64aSSam Leffler     { 5, "SDH ITU-T G.707"},
145f4d0c64aSSam Leffler     { 6, "SONET ANSI T1.105"},
146f4d0c64aSSam Leffler     { 0, NULL}
147f4d0c64aSSam Leffler };
148f4d0c64aSSam Leffler 
149f4d0c64aSSam Leffler /*
150f4d0c64aSSam Leffler  * Signal Type values for SDH links used by LMP Service Discovery (specifically,
151f4d0c64aSSam Leffler  * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
152f4d0c64aSSam Leffler  * details.
153f4d0c64aSSam Leffler  */
15427df3f5dSRui Paulo const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
155f4d0c64aSSam Leffler     { 5,  "VC-3"},
156f4d0c64aSSam Leffler     { 6,  "VC-4"},
157f4d0c64aSSam Leffler     { 7,  "STM-0"},
158f4d0c64aSSam Leffler     { 8,  "STM-1"},
159f4d0c64aSSam Leffler     { 9,  "STM-4"},
160f4d0c64aSSam Leffler     { 10, "STM-16"},
161f4d0c64aSSam Leffler     { 11, "STM-64"},
162f4d0c64aSSam Leffler     { 12, "STM-256"},
163f4d0c64aSSam Leffler     { 0, NULL}
164f4d0c64aSSam Leffler };
165f4d0c64aSSam Leffler 
166f4d0c64aSSam Leffler /*
167f4d0c64aSSam Leffler  * Signal Type values for SONET links used by LMP Service Discovery (specifically,
168f4d0c64aSSam Leffler  * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
169f4d0c64aSSam Leffler  * details.
170f4d0c64aSSam Leffler  */
17127df3f5dSRui Paulo const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
172f4d0c64aSSam Leffler     { 5,  "STS-1 SPE"},
173f4d0c64aSSam Leffler     { 6,  "STS-3c SPE"},
174f4d0c64aSSam Leffler     { 7,  "STS-1"},
175f4d0c64aSSam Leffler     { 8,  "STM-3"},
176f4d0c64aSSam Leffler     { 9,  "STM-12"},
177f4d0c64aSSam Leffler     { 10, "STM-48"},
178f4d0c64aSSam Leffler     { 11, "STM-192"},
179f4d0c64aSSam Leffler     { 12, "STM-768"},
180f4d0c64aSSam Leffler     { 0, NULL}
181f4d0c64aSSam Leffler };
182f4d0c64aSSam Leffler 
1831de50e9fSSam Leffler #define DIFFSERV_BC_MODEL_RDM           0   /* draft-ietf-tewg-diff-te-proto-07 */
1841de50e9fSSam Leffler #define DIFFSERV_BC_MODEL_MAM           1   /* draft-ietf-tewg-diff-te-proto-07 */
1851de50e9fSSam Leffler #define DIFFSERV_BC_MODEL_EXTD_MAM      254 /* experimental */
1861de50e9fSSam Leffler 
18727df3f5dSRui Paulo const struct tok diffserv_te_bc_values[] = {
1881de50e9fSSam Leffler     {  DIFFSERV_BC_MODEL_RDM, "Russian dolls"},
1891de50e9fSSam Leffler     {  DIFFSERV_BC_MODEL_MAM, "Maximum allocation"},
1901de50e9fSSam Leffler     {  DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"},
1911de50e9fSSam Leffler     { 0, NULL }
1921de50e9fSSam Leffler };
193