xref: /freebsd/contrib/tcpdump/gmpls.c (revision 7a7741af18d6c8a804cc643cb7ecda9d730c6aa6)
1 /*
2  * Redistribution and use in source and binary forms, with or without
3  * modification, are permitted provided that: (1) source code
4  * distributions retain the above copyright notice and this paragraph
5  * in its entirety, and (2) distributions including binary code include
6  * the above copyright notice and this paragraph in its entirety in
7  * the documentation or other materials provided with the distribution.
8  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
9  * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
10  * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
11  * FOR A PARTICULAR PURPOSE.
12  *
13  * Original code by Hannes Gredler (hannes@gredler.at)
14  */
15 
16 #include <config.h>
17 
18 #include "netdissect-stdinc.h"
19 
20 #include "netdissect.h"
21 #include "gmpls.h"
22 
23 /* rfc3471 */
24 const struct tok gmpls_link_prot_values[] = {
25     { 0x01, "Extra Traffic"},
26     { 0x02, "Unprotected"},
27     { 0x04, "Shared"},
28     { 0x08, "Dedicated 1:1"},
29     { 0x10, "Dedicated 1+1"},
30     { 0x20, "Enhanced"},
31     { 0x40, "Reserved"},
32     { 0x80, "Reserved"},
33     { 0, NULL }
34 };
35 
36 /* rfc3471 */
37 const struct tok gmpls_switch_cap_values[] = {
38     { GMPLS_PSC1, "Packet-Switch Capable-1"},
39     { GMPLS_PSC2, "Packet-Switch Capable-2"},
40     { GMPLS_PSC3, "Packet-Switch Capable-3"},
41     { GMPLS_PSC4, "Packet-Switch Capable-4"},
42     { GMPLS_L2SC, "Layer-2 Switch Capable"},
43     { GMPLS_TSC, "Time-Division-Multiplex"},
44     { GMPLS_LSC, "Lambda-Switch Capable"},
45     { GMPLS_FSC, "Fiber-Switch Capable"},
46     { 0, NULL }
47 };
48 
49 /* rfc4205 */
50 const struct tok gmpls_switch_cap_tsc_indication_values[] = {
51     { 0, "Standard SONET/SDH" },
52     { 1, "Arbitrary SONET/SDH" },
53     { 0, NULL }
54 };
55 
56 /* rfc3471 */
57 const struct tok gmpls_encoding_values[] = {
58     { 1,    "Packet"},
59     { 2,    "Ethernet V2/DIX"},
60     { 3,    "ANSI/ETSI PDH"},
61     { 4,    "Reserved"},
62     { 5,    "SDH ITU-T G.707/SONET ANSI T1.105"},
63     { 6,    "Reserved"},
64     { 7,    "Digital Wrapper"},
65     { 8,    "Lambda (photonic)"},
66     { 9,    "Fiber"},
67     { 10,   "Reserved"},
68     { 11,   "FiberChannel"},
69     { 0, NULL }
70 };
71 
72 /* rfc3471 */
73 const struct tok gmpls_payload_values[] = {
74     {  0,   "Unknown"},
75     {  1,   "Reserved"},
76     {  2,   "Reserved"},
77     {  3,   "Reserved"},
78     {  4,   "Reserved"},
79     {  5,   "Asynchronous mapping of E4"},
80     {  6,   "Asynchronous mapping of DS3/T3"},
81     {  7,   "Asynchronous mapping of E3"},
82     {  8,   "Bit synchronous mapping of E3"},
83     {  9,   "Byte synchronous mapping of E3"},
84     { 10,   "Asynchronous mapping of DS2/T2"},
85     { 11,   "Bit synchronous mapping of DS2/T2"},
86     { 12,   "Reserved"},
87     { 13,   "Asynchronous mapping of E1"},
88     { 14,   "Byte synchronous mapping of E1"},
89     { 15,   "Byte synchronous mapping of 31 * DS0"},
90     { 16,   "Asynchronous mapping of DS1/T1"},
91     { 17,   "Bit synchronous mapping of DS1/T1"},
92     { 18,   "Byte synchronous mapping of DS1/T1"},
93     { 19,   "VC-11 in VC-12"},
94     { 20,   "Reserved"},
95     { 21,   "Reserved"},
96     { 22,   "DS1 SF Asynchronous"},
97     { 23,   "DS1 ESF Asynchronous"},
98     { 24,   "DS3 M23 Asynchronous"},
99     { 25,   "DS3 C-Bit Parity Asynchronous"},
100     { 26,   "VT/LOVC"},
101     { 27,   "STS SPE/HOVC"},
102     { 28,   "POS - No Scrambling, 16 bit CRC"},
103     { 29,   "POS - No Scrambling, 32 bit CRC"},
104     { 30,   "POS - Scrambling, 16 bit CRC"},
105     { 31,   "POS - Scrambling, 32 bit CRC"},
106     { 32,   "ATM mapping"},
107     { 33,   "Ethernet PHY"},
108     { 34,   "SONET/SDH"},
109     { 35,   "Reserved (SONET deprecated)"},
110     { 36,   "Digital Wrapper"},
111     { 37,   "Lambda"},
112     { 38,   "ANSI/ETSI PDH"},
113     { 39,   "Reserved"},
114     { 40,   "Link Access Protocol SDH (X.85 and X.86)"},
115     { 41,   "FDDI"},
116     { 42,   "DQDB (ETSI ETS 300 216)"},
117     { 43,   "FiberChannel-3 (Services)"},
118     { 44,   "HDLC"},
119     { 45,   "Ethernet V2/DIX (only)"},
120     { 46,   "Ethernet 802.3 (only)"},
121 /* draft-ietf-ccamp-gmpls-g709-04.txt */
122     { 47,   "G.709 ODUj"},
123     { 48,   "G.709 OTUk(v)"},
124     { 49,   "CBR/CBRa"},
125     { 50,   "CBRb"},
126     { 51,   "BSOT"},
127     { 52,   "BSNT"},
128     { 53,   "IP/PPP (GFP)"},
129     { 54,   "Ethernet MAC (framed GFP)"},
130     { 55,   "Ethernet PHY (transparent GFP)"},
131     { 56,   "ESCON"},
132     { 57,   "FICON"},
133     { 58,   "Fiber Channel"},
134     { 0, NULL }
135 };
136 
137 /*
138  * Link Type values used by LMP Service Discovery (specifically, the Client
139  * Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details.
140  */
141 const struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
142     { 5, "SDH ITU-T G.707"},
143     { 6, "SONET ANSI T1.105"},
144     { 0, NULL}
145 };
146 
147 /*
148  * Signal Type values for SDH links used by LMP Service Discovery (specifically,
149  * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
150  * details.
151  */
152 const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
153     { 5,  "VC-3"},
154     { 6,  "VC-4"},
155     { 7,  "STM-0"},
156     { 8,  "STM-1"},
157     { 9,  "STM-4"},
158     { 10, "STM-16"},
159     { 11, "STM-64"},
160     { 12, "STM-256"},
161     { 0, NULL}
162 };
163 
164 /*
165  * Signal Type values for SONET links used by LMP Service Discovery (specifically,
166  * the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
167  * details.
168  */
169 const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
170     { 5,  "STS-1 SPE"},
171     { 6,  "STS-3c SPE"},
172     { 7,  "STS-1"},
173     { 8,  "STM-3"},
174     { 9,  "STM-12"},
175     { 10, "STM-48"},
176     { 11, "STM-192"},
177     { 12, "STM-768"},
178     { 0, NULL}
179 };
180 
181 #define DIFFSERV_BC_MODEL_RDM           0   /* draft-ietf-tewg-diff-te-proto-07 */
182 #define DIFFSERV_BC_MODEL_MAM           1   /* draft-ietf-tewg-diff-te-proto-07 */
183 #define DIFFSERV_BC_MODEL_EXTD_MAM      254 /* experimental */
184 
185 const struct tok diffserv_te_bc_values[] = {
186     {  DIFFSERV_BC_MODEL_RDM, "Russian dolls"},
187     {  DIFFSERV_BC_MODEL_MAM, "Maximum allocation"},
188     {  DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"},
189     { 0, NULL }
190 };
191