gmpls.c 5.8 KB

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