xref: /freebsd/contrib/tcpdump/l2vpn.c (revision ee67461e56828dd1f8de165947ba83f6d9148a87)
11de50e9fSSam Leffler /*
21de50e9fSSam Leffler  * Redistribution and use in source and binary forms, with or without
31de50e9fSSam Leffler  * modification, are permitted provided that: (1) source code
41de50e9fSSam Leffler  * distributions retain the above copyright notice and this paragraph
51de50e9fSSam Leffler  * in its entirety, and (2) distributions including binary code include
61de50e9fSSam Leffler  * the above copyright notice and this paragraph in its entirety in
71de50e9fSSam Leffler  * the documentation or other materials provided with the distribution.
81de50e9fSSam Leffler  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND
91de50e9fSSam Leffler  * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
101de50e9fSSam Leffler  * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
111de50e9fSSam Leffler  * FOR A PARTICULAR PURPOSE.
121de50e9fSSam Leffler  *
130bff6a5aSEd Maste  * Original code by Hannes Gredler (hannes@gredler.at)
141de50e9fSSam Leffler  */
151de50e9fSSam Leffler 
161de50e9fSSam Leffler #ifdef HAVE_CONFIG_H
17*ee67461eSJoseph Mingrone #include <config.h>
181de50e9fSSam Leffler #endif
191de50e9fSSam Leffler 
20*ee67461eSJoseph Mingrone #include "netdissect-stdinc.h"
213340d773SGleb Smirnoff #include "netdissect.h"
221de50e9fSSam Leffler #include "l2vpn.h"
231de50e9fSSam Leffler 
243340d773SGleb Smirnoff /*
253340d773SGleb Smirnoff  * BGP Layer 2 Encapsulation Types
263340d773SGleb Smirnoff  *
273340d773SGleb Smirnoff  * RFC 6624
283340d773SGleb Smirnoff  *
29*ee67461eSJoseph Mingrone  * https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-l2-encapsulation-types-registry
303340d773SGleb Smirnoff  */
3127df3f5dSRui Paulo const struct tok l2vpn_encaps_values[] = {
323340d773SGleb Smirnoff     { 0, "Reserved"},
333340d773SGleb Smirnoff     { 1, "Frame Relay"},
343340d773SGleb Smirnoff     { 2, "ATM AAL5 SDU VCC transport"},
353340d773SGleb Smirnoff     { 3, "ATM transparent cell transport"},
363340d773SGleb Smirnoff     { 4, "Ethernet (VLAN) Tagged Mode"},
373340d773SGleb Smirnoff     { 5, "Ethernet Raw Mode"},
383340d773SGleb Smirnoff     { 6, "Cisco HDLC"},
393340d773SGleb Smirnoff     { 7, "PPP"},
403340d773SGleb Smirnoff     { 8, "SONET/SDH Circuit Emulation Service over MPLS"},
413340d773SGleb Smirnoff     { 9, "ATM n-to-one VCC cell transport"},
423340d773SGleb Smirnoff     { 10, "ATM n-to-one VPC cell transport"},
433340d773SGleb Smirnoff     { 11, "IP layer 2 transport"},
443340d773SGleb Smirnoff     { 15, "Frame Relay Port mode"},
453340d773SGleb Smirnoff     { 17, "Structure-agnostic E1 over packet"},
463340d773SGleb Smirnoff     { 18, "Structure-agnostic T1 (DS1) over packet"},
473340d773SGleb Smirnoff     { 19, "VPLS"},
483340d773SGleb Smirnoff     { 20, "Structure-agnostic T3 (DS3) over packet"},
493340d773SGleb Smirnoff     { 21, "Nx64kbit/s Basic Service using Structure-aware"},
503340d773SGleb Smirnoff     { 25, "Frame Relay DLCI"},
513340d773SGleb Smirnoff     { 40, "Structure-agnostic E3 over packet"},
523340d773SGleb Smirnoff     { 41, "Octet-aligned playload for Structure-agnostic DS1 circuits"},
533340d773SGleb Smirnoff     { 42, "E1 Nx64kbit/s with CAS using Structure-aware"},
543340d773SGleb Smirnoff     { 43, "DS1 (ESF) Nx64kbit/s with CAS using Structure-aware"},
553340d773SGleb Smirnoff     { 44, "DS1 (SF) Nx64kbit/s with CAS using Structure-aware"},
563340d773SGleb Smirnoff     { 0, NULL}
573340d773SGleb Smirnoff };
583340d773SGleb Smirnoff 
593340d773SGleb Smirnoff /*
603340d773SGleb Smirnoff  * MPLS Pseudowire Types
613340d773SGleb Smirnoff  *
623340d773SGleb Smirnoff  * RFC 4446
633340d773SGleb Smirnoff  *
64*ee67461eSJoseph Mingrone  * https://www.iana.org/assignments/pwe3-parameters/pwe3-parameters.xhtml#pwe3-parameters-2
653340d773SGleb Smirnoff  */
663340d773SGleb Smirnoff const struct tok mpls_pw_types_values[] = {
673340d773SGleb Smirnoff     { 0x0000, "Reserved"},
683340d773SGleb Smirnoff     { 0x0001, "Frame Relay DLCI (Martini Mode)"},
693340d773SGleb Smirnoff     { 0x0002, "ATM AAL5 SDU VCC transport"},
703340d773SGleb Smirnoff     { 0x0003, "ATM transparent cell transport"},
713340d773SGleb Smirnoff     { 0x0004, "Ethernet VLAN"},
723340d773SGleb Smirnoff     { 0x0005, "Ethernet"},
733340d773SGleb Smirnoff     { 0x0006, "Cisco-HDLC"},
743340d773SGleb Smirnoff     { 0x0007, "PPP"},
753340d773SGleb Smirnoff     { 0x0008, "SONET/SDH Circuit Emulation Service over MPLS"},
763340d773SGleb Smirnoff     { 0x0009, "ATM n-to-one VCC cell transport"},
773340d773SGleb Smirnoff     { 0x000a, "ATM n-to-one VPC cell transport"},
783340d773SGleb Smirnoff     { 0x000b, "IP Layer2 Transport"},
793340d773SGleb Smirnoff     { 0x000c, "ATM one-to-one VCC Cell Mode"},
803340d773SGleb Smirnoff     { 0x000d, "ATM one-to-one VPC Cell Mode"},
813340d773SGleb Smirnoff     { 0x000e, "ATM AAL5 PDU VCC transport"},
823340d773SGleb Smirnoff     { 0x000f, "Frame-Relay Port mode"},
833340d773SGleb Smirnoff     { 0x0010, "SONET/SDH Circuit Emulation over Packet"},
843340d773SGleb Smirnoff     { 0x0011, "Structure-agnostic E1 over Packet"},
853340d773SGleb Smirnoff     { 0x0012, "Structure-agnostic T1 (DS1) over Packet"},
863340d773SGleb Smirnoff     { 0x0013, "Structure-agnostic E3 over Packet"},
873340d773SGleb Smirnoff     { 0x0014, "Structure-agnostic T3 (DS3) over Packet"},
883340d773SGleb Smirnoff     { 0x0015, "CESoPSN basic mode"},
893340d773SGleb Smirnoff     { 0x0016, "TDMoIP basic mode"},
903340d773SGleb Smirnoff     { 0x0017, "CESoPSN TDM with CAS"},
913340d773SGleb Smirnoff     { 0x0018, "TDMoIP TDM with CAS"},
923340d773SGleb Smirnoff     { 0x0019, "Frame Relay DLCI"},
933340d773SGleb Smirnoff     { 0x0040, "IP-interworking"},
941de50e9fSSam Leffler     { 0, NULL}
951de50e9fSSam Leffler };
96