enums.go 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. // Copyright 2012 Google, Inc. All rights reserved.
  2. // Copyright 2009-2011 Andreas Krennmair. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style license
  5. // that can be found in the LICENSE file in the root of the source
  6. // tree.
  7. package layers
  8. import (
  9. "errors"
  10. "fmt"
  11. "github.com/google/gopacket"
  12. )
  13. // EnumMetadata keeps track of a set of metadata for each enumeration value
  14. // for protocol enumerations.
  15. type EnumMetadata struct {
  16. // DecodeWith is the decoder to use to decode this protocol's data.
  17. DecodeWith gopacket.Decoder
  18. // Name is the name of the enumeration value.
  19. Name string
  20. // LayerType is the layer type implied by the given enum.
  21. LayerType gopacket.LayerType
  22. }
  23. // errorFunc returns a decoder that spits out a specific error message.
  24. func errorFunc(msg string) gopacket.Decoder {
  25. var e = errors.New(msg)
  26. return gopacket.DecodeFunc(func([]byte, gopacket.PacketBuilder) error {
  27. return e
  28. })
  29. }
  30. // EthernetType is an enumeration of ethernet type values, and acts as a decoder
  31. // for any type it supports.
  32. type EthernetType uint16
  33. const (
  34. // EthernetTypeLLC is not an actual ethernet type. It is instead a
  35. // placeholder we use in Ethernet frames that use the 802.3 standard of
  36. // srcmac|dstmac|length|LLC instead of srcmac|dstmac|ethertype.
  37. EthernetTypeLLC EthernetType = 0
  38. EthernetTypeIPv4 EthernetType = 0x0800
  39. EthernetTypeARP EthernetType = 0x0806
  40. EthernetTypeIPv6 EthernetType = 0x86DD
  41. EthernetTypeCiscoDiscovery EthernetType = 0x2000
  42. EthernetTypeNortelDiscovery EthernetType = 0x01a2
  43. EthernetTypeTransparentEthernetBridging EthernetType = 0x6558
  44. EthernetTypeDot1Q EthernetType = 0x8100
  45. EthernetTypePPPoEDiscovery EthernetType = 0x8863
  46. EthernetTypePPPoESession EthernetType = 0x8864
  47. EthernetTypeMPLSUnicast EthernetType = 0x8847
  48. EthernetTypeMPLSMulticast EthernetType = 0x8848
  49. EthernetTypeEAPOL EthernetType = 0x888e
  50. EthernetTypeQinQ EthernetType = 0x88a8
  51. EthernetTypeLinkLayerDiscovery EthernetType = 0x88cc
  52. EthernetTypeEthernetCTP EthernetType = 0x9000
  53. )
  54. // IPProtocol is an enumeration of IP protocol values, and acts as a decoder
  55. // for any type it supports.
  56. type IPProtocol uint8
  57. const (
  58. IPProtocolIPv6HopByHop IPProtocol = 0
  59. IPProtocolICMPv4 IPProtocol = 1
  60. IPProtocolIGMP IPProtocol = 2
  61. IPProtocolIPv4 IPProtocol = 4
  62. IPProtocolTCP IPProtocol = 6
  63. IPProtocolUDP IPProtocol = 17
  64. IPProtocolRUDP IPProtocol = 27
  65. IPProtocolIPv6 IPProtocol = 41
  66. IPProtocolIPv6Routing IPProtocol = 43
  67. IPProtocolIPv6Fragment IPProtocol = 44
  68. IPProtocolGRE IPProtocol = 47
  69. IPProtocolESP IPProtocol = 50
  70. IPProtocolAH IPProtocol = 51
  71. IPProtocolICMPv6 IPProtocol = 58
  72. IPProtocolNoNextHeader IPProtocol = 59
  73. IPProtocolIPv6Destination IPProtocol = 60
  74. IPProtocolOSPF IPProtocol = 89
  75. IPProtocolIPIP IPProtocol = 94
  76. IPProtocolEtherIP IPProtocol = 97
  77. IPProtocolVRRP IPProtocol = 112
  78. IPProtocolSCTP IPProtocol = 132
  79. IPProtocolUDPLite IPProtocol = 136
  80. IPProtocolMPLSInIP IPProtocol = 137
  81. )
  82. // LinkType is an enumeration of link types, and acts as a decoder for any
  83. // link type it supports.
  84. type LinkType uint8
  85. const (
  86. // According to pcap-linktype(7) and http://www.tcpdump.org/linktypes.html
  87. LinkTypeNull LinkType = 0
  88. LinkTypeEthernet LinkType = 1
  89. LinkTypeAX25 LinkType = 3
  90. LinkTypeTokenRing LinkType = 6
  91. LinkTypeArcNet LinkType = 7
  92. LinkTypeSLIP LinkType = 8
  93. LinkTypePPP LinkType = 9
  94. LinkTypeFDDI LinkType = 10
  95. LinkTypePPP_HDLC LinkType = 50
  96. LinkTypePPPEthernet LinkType = 51
  97. LinkTypeATM_RFC1483 LinkType = 100
  98. LinkTypeRaw LinkType = 101
  99. LinkTypeC_HDLC LinkType = 104
  100. LinkTypeIEEE802_11 LinkType = 105
  101. LinkTypeFRelay LinkType = 107
  102. LinkTypeLoop LinkType = 108
  103. LinkTypeLinuxSLL LinkType = 113
  104. LinkTypeLTalk LinkType = 114
  105. LinkTypePFLog LinkType = 117
  106. LinkTypePrismHeader LinkType = 119
  107. LinkTypeIPOverFC LinkType = 122
  108. LinkTypeSunATM LinkType = 123
  109. LinkTypeIEEE80211Radio LinkType = 127
  110. LinkTypeARCNetLinux LinkType = 129
  111. LinkTypeIPOver1394 LinkType = 138
  112. LinkTypeMTP2Phdr LinkType = 139
  113. LinkTypeMTP2 LinkType = 140
  114. LinkTypeMTP3 LinkType = 141
  115. LinkTypeSCCP LinkType = 142
  116. LinkTypeDOCSIS LinkType = 143
  117. LinkTypeLinuxIRDA LinkType = 144
  118. LinkTypeLinuxLAPD LinkType = 177
  119. LinkTypeLinuxUSB LinkType = 220
  120. LinkTypeIPv4 LinkType = 228
  121. LinkTypeIPv6 LinkType = 229
  122. )
  123. // PPPoECode is the PPPoE code enum, taken from http://tools.ietf.org/html/rfc2516
  124. type PPPoECode uint8
  125. const (
  126. PPPoECodePADI PPPoECode = 0x09
  127. PPPoECodePADO PPPoECode = 0x07
  128. PPPoECodePADR PPPoECode = 0x19
  129. PPPoECodePADS PPPoECode = 0x65
  130. PPPoECodePADT PPPoECode = 0xA7
  131. PPPoECodeSession PPPoECode = 0x00
  132. )
  133. // PPPType is an enumeration of PPP type values, and acts as a decoder for any
  134. // type it supports.
  135. type PPPType uint16
  136. const (
  137. PPPTypeIPv4 PPPType = 0x0021
  138. PPPTypeIPv6 PPPType = 0x0057
  139. PPPTypeMPLSUnicast PPPType = 0x0281
  140. PPPTypeMPLSMulticast PPPType = 0x0283
  141. )
  142. // SCTPChunkType is an enumeration of chunk types inside SCTP packets.
  143. type SCTPChunkType uint8
  144. const (
  145. SCTPChunkTypeData SCTPChunkType = 0
  146. SCTPChunkTypeInit SCTPChunkType = 1
  147. SCTPChunkTypeInitAck SCTPChunkType = 2
  148. SCTPChunkTypeSack SCTPChunkType = 3
  149. SCTPChunkTypeHeartbeat SCTPChunkType = 4
  150. SCTPChunkTypeHeartbeatAck SCTPChunkType = 5
  151. SCTPChunkTypeAbort SCTPChunkType = 6
  152. SCTPChunkTypeShutdown SCTPChunkType = 7
  153. SCTPChunkTypeShutdownAck SCTPChunkType = 8
  154. SCTPChunkTypeError SCTPChunkType = 9
  155. SCTPChunkTypeCookieEcho SCTPChunkType = 10
  156. SCTPChunkTypeCookieAck SCTPChunkType = 11
  157. SCTPChunkTypeShutdownComplete SCTPChunkType = 14
  158. )
  159. // FDDIFrameControl is an enumeration of FDDI frame control bytes.
  160. type FDDIFrameControl uint8
  161. const (
  162. FDDIFrameControlLLC FDDIFrameControl = 0x50
  163. )
  164. // EAPOLType is an enumeration of EAPOL packet types.
  165. type EAPOLType uint8
  166. const (
  167. EAPOLTypeEAP EAPOLType = 0
  168. EAPOLTypeStart EAPOLType = 1
  169. EAPOLTypeLogOff EAPOLType = 2
  170. EAPOLTypeKey EAPOLType = 3
  171. EAPOLTypeASFAlert EAPOLType = 4
  172. )
  173. // ProtocolFamily is the set of values defined as PF_* in sys/socket.h
  174. type ProtocolFamily uint8
  175. const (
  176. ProtocolFamilyIPv4 ProtocolFamily = 2
  177. // BSDs use different values for INET6... glory be. These values taken from
  178. // tcpdump 4.3.0.
  179. ProtocolFamilyIPv6BSD ProtocolFamily = 24
  180. ProtocolFamilyIPv6FreeBSD ProtocolFamily = 28
  181. ProtocolFamilyIPv6Darwin ProtocolFamily = 30
  182. ProtocolFamilyIPv6Linux ProtocolFamily = 10
  183. )
  184. // Dot11Type is a combination of IEEE 802.11 frame's Type and Subtype fields.
  185. // By combining these two fields together into a single type, we're able to
  186. // provide a String function that correctly displays the subtype given the
  187. // top-level type.
  188. //
  189. // If you just care about the top-level type, use the MainType function.
  190. type Dot11Type uint8
  191. // MainType strips the subtype information from the given type,
  192. // returning just the overarching type (Mgmt, Ctrl, Data, Reserved).
  193. func (d Dot11Type) MainType() Dot11Type {
  194. return d & dot11TypeMask
  195. }
  196. const (
  197. Dot11TypeMgmt Dot11Type = 0x00
  198. Dot11TypeCtrl Dot11Type = 0x01
  199. Dot11TypeData Dot11Type = 0x02
  200. Dot11TypeReserved Dot11Type = 0x03
  201. dot11TypeMask = 0x03
  202. // The following are type/subtype conglomerations.
  203. // Management
  204. Dot11TypeMgmtAssociationReq Dot11Type = 0x00
  205. Dot11TypeMgmtAssociationResp Dot11Type = 0x04
  206. Dot11TypeMgmtReassociationReq Dot11Type = 0x08
  207. Dot11TypeMgmtReassociationResp Dot11Type = 0x0c
  208. Dot11TypeMgmtProbeReq Dot11Type = 0x10
  209. Dot11TypeMgmtProbeResp Dot11Type = 0x14
  210. Dot11TypeMgmtMeasurementPilot Dot11Type = 0x18
  211. Dot11TypeMgmtBeacon Dot11Type = 0x20
  212. Dot11TypeMgmtATIM Dot11Type = 0x24
  213. Dot11TypeMgmtDisassociation Dot11Type = 0x28
  214. Dot11TypeMgmtAuthentication Dot11Type = 0x2c
  215. Dot11TypeMgmtDeauthentication Dot11Type = 0x30
  216. Dot11TypeMgmtAction Dot11Type = 0x34
  217. Dot11TypeMgmtActionNoAck Dot11Type = 0x38
  218. // Control
  219. Dot11TypeCtrlWrapper Dot11Type = 0x1d
  220. Dot11TypeCtrlBlockAckReq Dot11Type = 0x21
  221. Dot11TypeCtrlBlockAck Dot11Type = 0x25
  222. Dot11TypeCtrlPowersavePoll Dot11Type = 0x29
  223. Dot11TypeCtrlRTS Dot11Type = 0x2d
  224. Dot11TypeCtrlCTS Dot11Type = 0x31
  225. Dot11TypeCtrlAck Dot11Type = 0x35
  226. Dot11TypeCtrlCFEnd Dot11Type = 0x39
  227. Dot11TypeCtrlCFEndAck Dot11Type = 0x3d
  228. // Data
  229. Dot11TypeDataCFAck Dot11Type = 0x06
  230. Dot11TypeDataCFPoll Dot11Type = 0x0a
  231. Dot11TypeDataCFAckPoll Dot11Type = 0x0e
  232. Dot11TypeDataNull Dot11Type = 0x12
  233. Dot11TypeDataCFAckNoData Dot11Type = 0x16
  234. Dot11TypeDataCFPollNoData Dot11Type = 0x1a
  235. Dot11TypeDataCFAckPollNoData Dot11Type = 0x1e
  236. Dot11TypeDataQOSData Dot11Type = 0x22
  237. Dot11TypeDataQOSDataCFAck Dot11Type = 0x26
  238. Dot11TypeDataQOSDataCFPoll Dot11Type = 0x2a
  239. Dot11TypeDataQOSDataCFAckPoll Dot11Type = 0x2e
  240. Dot11TypeDataQOSNull Dot11Type = 0x32
  241. Dot11TypeDataQOSCFPollNoData Dot11Type = 0x3a
  242. Dot11TypeDataQOSCFAckPollNoData Dot11Type = 0x3e
  243. )
  244. // Decode a raw v4 or v6 IP packet.
  245. func decodeIPv4or6(data []byte, p gopacket.PacketBuilder) error {
  246. version := data[0] >> 4
  247. switch version {
  248. case 4:
  249. return decodeIPv4(data, p)
  250. case 6:
  251. return decodeIPv6(data, p)
  252. }
  253. return fmt.Errorf("Invalid IP packet version %v", version)
  254. }
  255. func initActualTypeData() {
  256. // Each of the XXXTypeMetadata arrays contains mappings of how to handle enum
  257. // values for various enum types in gopacket/layers.
  258. // These arrays are actually created by gen2.go and stored in
  259. // enums_generated.go.
  260. //
  261. // So, EthernetTypeMetadata[2] contains information on how to handle EthernetType
  262. // 2, including which name to give it and which decoder to use to decode
  263. // packet data of that type. These arrays are filled by default with all of the
  264. // protocols gopacket/layers knows how to handle, but users of the library can
  265. // add new decoders or override existing ones. For example, if you write a better
  266. // TCP decoder, you can override IPProtocolMetadata[IPProtocolTCP].DecodeWith
  267. // with your new decoder, and all gopacket/layers decoding will use your new
  268. // decoder whenever they encounter that IPProtocol.
  269. // Here we link up all enumerations with their respective names and decoders.
  270. EthernetTypeMetadata[EthernetTypeLLC] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLLC), Name: "LLC", LayerType: LayerTypeLLC}
  271. EthernetTypeMetadata[EthernetTypeIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4}
  272. EthernetTypeMetadata[EthernetTypeIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6}
  273. EthernetTypeMetadata[EthernetTypeARP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeARP), Name: "ARP", LayerType: LayerTypeARP}
  274. EthernetTypeMetadata[EthernetTypeDot1Q] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot1Q), Name: "Dot1Q", LayerType: LayerTypeDot1Q}
  275. EthernetTypeMetadata[EthernetTypePPPoEDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPPoE), Name: "PPPoEDiscovery", LayerType: LayerTypePPPoE}
  276. EthernetTypeMetadata[EthernetTypePPPoESession] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPPoE), Name: "PPPoESession", LayerType: LayerTypePPPoE}
  277. EthernetTypeMetadata[EthernetTypeEthernetCTP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEthernetCTP), Name: "EthernetCTP", LayerType: LayerTypeEthernetCTP}
  278. EthernetTypeMetadata[EthernetTypeCiscoDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeCiscoDiscovery), Name: "CiscoDiscovery", LayerType: LayerTypeCiscoDiscovery}
  279. EthernetTypeMetadata[EthernetTypeNortelDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeNortelDiscovery), Name: "NortelDiscovery", LayerType: LayerTypeNortelDiscovery}
  280. EthernetTypeMetadata[EthernetTypeLinkLayerDiscovery] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLinkLayerDiscovery), Name: "LinkLayerDiscovery", LayerType: LayerTypeLinkLayerDiscovery}
  281. EthernetTypeMetadata[EthernetTypeMPLSUnicast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSUnicast", LayerType: LayerTypeMPLS}
  282. EthernetTypeMetadata[EthernetTypeMPLSMulticast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSMulticast", LayerType: LayerTypeMPLS}
  283. EthernetTypeMetadata[EthernetTypeEAPOL] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEAPOL), Name: "EAPOL", LayerType: LayerTypeEAPOL}
  284. EthernetTypeMetadata[EthernetTypeQinQ] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot1Q), Name: "Dot1Q", LayerType: LayerTypeDot1Q}
  285. EthernetTypeMetadata[EthernetTypeTransparentEthernetBridging] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEthernet), Name: "TransparentEthernetBridging", LayerType: LayerTypeEthernet}
  286. IPProtocolMetadata[IPProtocolIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4}
  287. IPProtocolMetadata[IPProtocolTCP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeTCP), Name: "TCP", LayerType: LayerTypeTCP}
  288. IPProtocolMetadata[IPProtocolUDP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUDP), Name: "UDP", LayerType: LayerTypeUDP}
  289. IPProtocolMetadata[IPProtocolICMPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeICMPv4), Name: "ICMPv4", LayerType: LayerTypeICMPv4}
  290. IPProtocolMetadata[IPProtocolICMPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeICMPv6), Name: "ICMPv6", LayerType: LayerTypeICMPv6}
  291. IPProtocolMetadata[IPProtocolSCTP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTP), Name: "SCTP", LayerType: LayerTypeSCTP}
  292. IPProtocolMetadata[IPProtocolIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6}
  293. IPProtocolMetadata[IPProtocolIPIP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4}
  294. IPProtocolMetadata[IPProtocolEtherIP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEtherIP), Name: "EtherIP", LayerType: LayerTypeEtherIP}
  295. IPProtocolMetadata[IPProtocolRUDP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeRUDP), Name: "RUDP", LayerType: LayerTypeRUDP}
  296. IPProtocolMetadata[IPProtocolGRE] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeGRE), Name: "GRE", LayerType: LayerTypeGRE}
  297. IPProtocolMetadata[IPProtocolIPv6HopByHop] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6HopByHop), Name: "IPv6HopByHop", LayerType: LayerTypeIPv6HopByHop}
  298. IPProtocolMetadata[IPProtocolIPv6Routing] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6Routing), Name: "IPv6Routing", LayerType: LayerTypeIPv6Routing}
  299. IPProtocolMetadata[IPProtocolIPv6Fragment] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6Fragment), Name: "IPv6Fragment", LayerType: LayerTypeIPv6Fragment}
  300. IPProtocolMetadata[IPProtocolIPv6Destination] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6Destination), Name: "IPv6Destination", LayerType: LayerTypeIPv6Destination}
  301. IPProtocolMetadata[IPProtocolOSPF] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeOSPF), Name: "OSPF", LayerType: LayerTypeOSPF}
  302. IPProtocolMetadata[IPProtocolAH] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPSecAH), Name: "IPSecAH", LayerType: LayerTypeIPSecAH}
  303. IPProtocolMetadata[IPProtocolESP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPSecESP), Name: "IPSecESP", LayerType: LayerTypeIPSecESP}
  304. IPProtocolMetadata[IPProtocolUDPLite] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUDPLite), Name: "UDPLite", LayerType: LayerTypeUDPLite}
  305. IPProtocolMetadata[IPProtocolMPLSInIP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLS", LayerType: LayerTypeMPLS}
  306. IPProtocolMetadata[IPProtocolNoNextHeader] = EnumMetadata{DecodeWith: gopacket.DecodePayload, Name: "NoNextHeader", LayerType: gopacket.LayerTypePayload}
  307. IPProtocolMetadata[IPProtocolIGMP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIGMP), Name: "IGMP", LayerType: LayerTypeIGMP}
  308. IPProtocolMetadata[IPProtocolVRRP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeVRRP), Name: "VRRP", LayerType: LayerTypeVRRP}
  309. SCTPChunkTypeMetadata[SCTPChunkTypeData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPData), Name: "Data"}
  310. SCTPChunkTypeMetadata[SCTPChunkTypeInit] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPInit), Name: "Init"}
  311. SCTPChunkTypeMetadata[SCTPChunkTypeInitAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPInit), Name: "InitAck"}
  312. SCTPChunkTypeMetadata[SCTPChunkTypeSack] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPSack), Name: "Sack"}
  313. SCTPChunkTypeMetadata[SCTPChunkTypeHeartbeat] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPHeartbeat), Name: "Heartbeat"}
  314. SCTPChunkTypeMetadata[SCTPChunkTypeHeartbeatAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPHeartbeat), Name: "HeartbeatAck"}
  315. SCTPChunkTypeMetadata[SCTPChunkTypeAbort] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPError), Name: "Abort"}
  316. SCTPChunkTypeMetadata[SCTPChunkTypeError] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPError), Name: "Error"}
  317. SCTPChunkTypeMetadata[SCTPChunkTypeShutdown] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPShutdown), Name: "Shutdown"}
  318. SCTPChunkTypeMetadata[SCTPChunkTypeShutdownAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPShutdownAck), Name: "ShutdownAck"}
  319. SCTPChunkTypeMetadata[SCTPChunkTypeCookieEcho] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPCookieEcho), Name: "CookieEcho"}
  320. SCTPChunkTypeMetadata[SCTPChunkTypeCookieAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPEmptyLayer), Name: "CookieAck"}
  321. SCTPChunkTypeMetadata[SCTPChunkTypeShutdownComplete] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeSCTPEmptyLayer), Name: "ShutdownComplete"}
  322. PPPTypeMetadata[PPPTypeIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4"}
  323. PPPTypeMetadata[PPPTypeIPv6] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6"}
  324. PPPTypeMetadata[PPPTypeMPLSUnicast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSUnicast"}
  325. PPPTypeMetadata[PPPTypeMPLSMulticast] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeMPLS), Name: "MPLSMulticast"}
  326. PPPoECodeMetadata[PPPoECodeSession] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPP), Name: "PPP"}
  327. LinkTypeMetadata[LinkTypeEthernet] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEthernet), Name: "Ethernet"}
  328. LinkTypeMetadata[LinkTypePPP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePPP), Name: "PPP"}
  329. LinkTypeMetadata[LinkTypeFDDI] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeFDDI), Name: "FDDI"}
  330. LinkTypeMetadata[LinkTypeNull] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLoopback), Name: "Null"}
  331. LinkTypeMetadata[LinkTypeIEEE802_11] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11), Name: "Dot11"}
  332. LinkTypeMetadata[LinkTypeLoop] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLoopback), Name: "Loop"}
  333. LinkTypeMetadata[LinkTypeIEEE802_11] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11), Name: "802.11"}
  334. LinkTypeMetadata[LinkTypeRaw] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4or6), Name: "Raw"}
  335. LinkTypeMetadata[LinkTypePFLog] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePFLog), Name: "PFLog"}
  336. LinkTypeMetadata[LinkTypeIEEE80211Radio] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeRadioTap), Name: "RadioTap"}
  337. LinkTypeMetadata[LinkTypeLinuxUSB] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSB), Name: "USB"}
  338. LinkTypeMetadata[LinkTypeLinuxSLL] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLinuxSLL), Name: "Linux SLL"}
  339. LinkTypeMetadata[LinkTypePrismHeader] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodePrismHeader), Name: "Prism"}
  340. FDDIFrameControlMetadata[FDDIFrameControlLLC] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeLLC), Name: "LLC"}
  341. EAPOLTypeMetadata[EAPOLTypeEAP] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeEAP), Name: "EAP", LayerType: LayerTypeEAP}
  342. ProtocolFamilyMetadata[ProtocolFamilyIPv4] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv4), Name: "IPv4", LayerType: LayerTypeIPv4}
  343. ProtocolFamilyMetadata[ProtocolFamilyIPv6BSD] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6}
  344. ProtocolFamilyMetadata[ProtocolFamilyIPv6FreeBSD] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6}
  345. ProtocolFamilyMetadata[ProtocolFamilyIPv6Darwin] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6}
  346. ProtocolFamilyMetadata[ProtocolFamilyIPv6Linux] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeIPv6), Name: "IPv6", LayerType: LayerTypeIPv6}
  347. Dot11TypeMetadata[Dot11TypeMgmtAssociationReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAssociationReq), Name: "MgmtAssociationReq", LayerType: LayerTypeDot11MgmtAssociationReq}
  348. Dot11TypeMetadata[Dot11TypeMgmtAssociationResp] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAssociationResp), Name: "MgmtAssociationResp", LayerType: LayerTypeDot11MgmtAssociationResp}
  349. Dot11TypeMetadata[Dot11TypeMgmtReassociationReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtReassociationReq), Name: "MgmtReassociationReq", LayerType: LayerTypeDot11MgmtReassociationReq}
  350. Dot11TypeMetadata[Dot11TypeMgmtReassociationResp] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtReassociationResp), Name: "MgmtReassociationResp", LayerType: LayerTypeDot11MgmtReassociationResp}
  351. Dot11TypeMetadata[Dot11TypeMgmtProbeReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtProbeReq), Name: "MgmtProbeReq", LayerType: LayerTypeDot11MgmtProbeReq}
  352. Dot11TypeMetadata[Dot11TypeMgmtProbeResp] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtProbeResp), Name: "MgmtProbeResp", LayerType: LayerTypeDot11MgmtProbeResp}
  353. Dot11TypeMetadata[Dot11TypeMgmtMeasurementPilot] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtMeasurementPilot), Name: "MgmtMeasurementPilot", LayerType: LayerTypeDot11MgmtMeasurementPilot}
  354. Dot11TypeMetadata[Dot11TypeMgmtBeacon] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtBeacon), Name: "MgmtBeacon", LayerType: LayerTypeDot11MgmtBeacon}
  355. Dot11TypeMetadata[Dot11TypeMgmtATIM] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtATIM), Name: "MgmtATIM", LayerType: LayerTypeDot11MgmtATIM}
  356. Dot11TypeMetadata[Dot11TypeMgmtDisassociation] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtDisassociation), Name: "MgmtDisassociation", LayerType: LayerTypeDot11MgmtDisassociation}
  357. Dot11TypeMetadata[Dot11TypeMgmtAuthentication] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAuthentication), Name: "MgmtAuthentication", LayerType: LayerTypeDot11MgmtAuthentication}
  358. Dot11TypeMetadata[Dot11TypeMgmtDeauthentication] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtDeauthentication), Name: "MgmtDeauthentication", LayerType: LayerTypeDot11MgmtDeauthentication}
  359. Dot11TypeMetadata[Dot11TypeMgmtAction] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtAction), Name: "MgmtAction", LayerType: LayerTypeDot11MgmtAction}
  360. Dot11TypeMetadata[Dot11TypeMgmtActionNoAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11MgmtActionNoAck), Name: "MgmtActionNoAck", LayerType: LayerTypeDot11MgmtActionNoAck}
  361. Dot11TypeMetadata[Dot11TypeCtrl] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11Ctrl), Name: "Ctrl", LayerType: LayerTypeDot11Ctrl}
  362. Dot11TypeMetadata[Dot11TypeCtrlWrapper] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11Ctrl), Name: "CtrlWrapper", LayerType: LayerTypeDot11Ctrl}
  363. Dot11TypeMetadata[Dot11TypeCtrlBlockAckReq] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlBlockAckReq), Name: "CtrlBlockAckReq", LayerType: LayerTypeDot11CtrlBlockAckReq}
  364. Dot11TypeMetadata[Dot11TypeCtrlBlockAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlBlockAck), Name: "CtrlBlockAck", LayerType: LayerTypeDot11CtrlBlockAck}
  365. Dot11TypeMetadata[Dot11TypeCtrlPowersavePoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlPowersavePoll), Name: "CtrlPowersavePoll", LayerType: LayerTypeDot11CtrlPowersavePoll}
  366. Dot11TypeMetadata[Dot11TypeCtrlRTS] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlRTS), Name: "CtrlRTS", LayerType: LayerTypeDot11CtrlRTS}
  367. Dot11TypeMetadata[Dot11TypeCtrlCTS] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlCTS), Name: "CtrlCTS", LayerType: LayerTypeDot11CtrlCTS}
  368. Dot11TypeMetadata[Dot11TypeCtrlAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlAck), Name: "CtrlAck", LayerType: LayerTypeDot11CtrlAck}
  369. Dot11TypeMetadata[Dot11TypeCtrlCFEnd] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlCFEnd), Name: "CtrlCFEnd", LayerType: LayerTypeDot11CtrlCFEnd}
  370. Dot11TypeMetadata[Dot11TypeCtrlCFEndAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11CtrlCFEndAck), Name: "CtrlCFEndAck", LayerType: LayerTypeDot11CtrlCFEndAck}
  371. Dot11TypeMetadata[Dot11TypeData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11Data), Name: "Data", LayerType: LayerTypeDot11Data}
  372. Dot11TypeMetadata[Dot11TypeDataCFAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAck), Name: "DataCFAck", LayerType: LayerTypeDot11DataCFAck}
  373. Dot11TypeMetadata[Dot11TypeDataCFPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFPoll), Name: "DataCFPoll", LayerType: LayerTypeDot11DataCFPoll}
  374. Dot11TypeMetadata[Dot11TypeDataCFAckPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAckPoll), Name: "DataCFAckPoll", LayerType: LayerTypeDot11DataCFAckPoll}
  375. Dot11TypeMetadata[Dot11TypeDataNull] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataNull), Name: "DataNull", LayerType: LayerTypeDot11DataNull}
  376. Dot11TypeMetadata[Dot11TypeDataCFAckNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAckNoData), Name: "DataCFAckNoData", LayerType: LayerTypeDot11DataCFAckNoData}
  377. Dot11TypeMetadata[Dot11TypeDataCFPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFPollNoData), Name: "DataCFPollNoData", LayerType: LayerTypeDot11DataCFPollNoData}
  378. Dot11TypeMetadata[Dot11TypeDataCFAckPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataCFAckPollNoData), Name: "DataCFAckPollNoData", LayerType: LayerTypeDot11DataCFAckPollNoData}
  379. Dot11TypeMetadata[Dot11TypeDataQOSData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSData), Name: "DataQOSData", LayerType: LayerTypeDot11DataQOSData}
  380. Dot11TypeMetadata[Dot11TypeDataQOSDataCFAck] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSDataCFAck), Name: "DataQOSDataCFAck", LayerType: LayerTypeDot11DataQOSDataCFAck}
  381. Dot11TypeMetadata[Dot11TypeDataQOSDataCFPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSDataCFPoll), Name: "DataQOSDataCFPoll", LayerType: LayerTypeDot11DataQOSDataCFPoll}
  382. Dot11TypeMetadata[Dot11TypeDataQOSDataCFAckPoll] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSDataCFAckPoll), Name: "DataQOSDataCFAckPoll", LayerType: LayerTypeDot11DataQOSDataCFAckPoll}
  383. Dot11TypeMetadata[Dot11TypeDataQOSNull] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSNull), Name: "DataQOSNull", LayerType: LayerTypeDot11DataQOSNull}
  384. Dot11TypeMetadata[Dot11TypeDataQOSCFPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSCFPollNoData), Name: "DataQOSCFPollNoData", LayerType: LayerTypeDot11DataQOSCFPollNoData}
  385. Dot11TypeMetadata[Dot11TypeDataQOSCFAckPollNoData] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeDot11DataQOSCFAckPollNoData), Name: "DataQOSCFAckPollNoData", LayerType: LayerTypeDot11DataQOSCFAckPollNoData}
  386. USBTransportTypeMetadata[USBTransportTypeInterrupt] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSBInterrupt), Name: "Interrupt", LayerType: LayerTypeUSBInterrupt}
  387. USBTransportTypeMetadata[USBTransportTypeControl] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSBControl), Name: "Control", LayerType: LayerTypeUSBControl}
  388. USBTransportTypeMetadata[USBTransportTypeBulk] = EnumMetadata{DecodeWith: gopacket.DecodeFunc(decodeUSBBulk), Name: "Bulk", LayerType: LayerTypeUSBBulk}
  389. }