10f74e101Schristos /* 20f74e101Schristos * Redistribution and use in source and binary forms, with or without 30f74e101Schristos * modification, are permitted provided that: (1) source code 40f74e101Schristos * distributions retain the above copyright notice and this paragraph 50f74e101Schristos * in its entirety, and (2) distributions including binary code include 60f74e101Schristos * the above copyright notice and this paragraph in its entirety in 70f74e101Schristos * the documentation or other materials provided with the distribution. 80f74e101Schristos * THIS SOFTWARE IS PROVIDED ``AS IS'' AND 90f74e101Schristos * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT 100f74e101Schristos * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 110f74e101Schristos * FOR A PARTICULAR PURPOSE. 120f74e101Schristos * 1372c96ff3Schristos * Original code by Hannes Gredler (hannes@gredler.at) 140f74e101Schristos */ 150f74e101Schristos 1611b3aaa1Schristos #include <sys/cdefs.h> 170f74e101Schristos #ifndef lint 18*26ba0b50Schristos __RCSID("$NetBSD: l2vpn.c,v 1.9 2024/09/02 16:15:30 christos Exp $"); 190f74e101Schristos #endif 200f74e101Schristos 21c74ad251Schristos #include <config.h> 220f74e101Schristos 23c74ad251Schristos #include "netdissect-stdinc.h" 24fdccd7e4Schristos #include "netdissect.h" 250f74e101Schristos #include "l2vpn.h" 260f74e101Schristos 27dc860a36Sspz /* 28dc860a36Sspz * BGP Layer 2 Encapsulation Types 29dc860a36Sspz * 30dc860a36Sspz * RFC 6624 31dc860a36Sspz * 32c74ad251Schristos * https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-l2-encapsulation-types-registry 33dc860a36Sspz */ 340f74e101Schristos const struct tok l2vpn_encaps_values[] = { 35dc860a36Sspz { 0, "Reserved"}, 36dc860a36Sspz { 1, "Frame Relay"}, 37dc860a36Sspz { 2, "ATM AAL5 SDU VCC transport"}, 38dc860a36Sspz { 3, "ATM transparent cell transport"}, 39dc860a36Sspz { 4, "Ethernet (VLAN) Tagged Mode"}, 40dc860a36Sspz { 5, "Ethernet Raw Mode"}, 41dc860a36Sspz { 6, "Cisco HDLC"}, 42dc860a36Sspz { 7, "PPP"}, 43dc860a36Sspz { 8, "SONET/SDH Circuit Emulation Service over MPLS"}, 44dc860a36Sspz { 9, "ATM n-to-one VCC cell transport"}, 45dc860a36Sspz { 10, "ATM n-to-one VPC cell transport"}, 46dc860a36Sspz { 11, "IP layer 2 transport"}, 47dc860a36Sspz { 15, "Frame Relay Port mode"}, 48dc860a36Sspz { 17, "Structure-agnostic E1 over packet"}, 49dc860a36Sspz { 18, "Structure-agnostic T1 (DS1) over packet"}, 50dc860a36Sspz { 19, "VPLS"}, 51dc860a36Sspz { 20, "Structure-agnostic T3 (DS3) over packet"}, 52dc860a36Sspz { 21, "Nx64kbit/s Basic Service using Structure-aware"}, 53dc860a36Sspz { 25, "Frame Relay DLCI"}, 54dc860a36Sspz { 40, "Structure-agnostic E3 over packet"}, 55dc860a36Sspz { 41, "Octet-aligned playload for Structure-agnostic DS1 circuits"}, 56dc860a36Sspz { 42, "E1 Nx64kbit/s with CAS using Structure-aware"}, 57dc860a36Sspz { 43, "DS1 (ESF) Nx64kbit/s with CAS using Structure-aware"}, 58dc860a36Sspz { 44, "DS1 (SF) Nx64kbit/s with CAS using Structure-aware"}, 59dc860a36Sspz { 0, NULL} 60dc860a36Sspz }; 61dc860a36Sspz 62dc860a36Sspz /* 63dc860a36Sspz * MPLS Pseudowire Types 64dc860a36Sspz * 65dc860a36Sspz * RFC 4446 66dc860a36Sspz * 67c74ad251Schristos * https://www.iana.org/assignments/pwe3-parameters/pwe3-parameters.xhtml#pwe3-parameters-2 68dc860a36Sspz */ 69dc860a36Sspz const struct tok mpls_pw_types_values[] = { 70dc860a36Sspz { 0x0000, "Reserved"}, 71dc860a36Sspz { 0x0001, "Frame Relay DLCI (Martini Mode)"}, 72dc860a36Sspz { 0x0002, "ATM AAL5 SDU VCC transport"}, 73dc860a36Sspz { 0x0003, "ATM transparent cell transport"}, 74dc860a36Sspz { 0x0004, "Ethernet VLAN"}, 75dc860a36Sspz { 0x0005, "Ethernet"}, 76dc860a36Sspz { 0x0006, "Cisco-HDLC"}, 77dc860a36Sspz { 0x0007, "PPP"}, 78dc860a36Sspz { 0x0008, "SONET/SDH Circuit Emulation Service over MPLS"}, 79dc860a36Sspz { 0x0009, "ATM n-to-one VCC cell transport"}, 80dc860a36Sspz { 0x000a, "ATM n-to-one VPC cell transport"}, 81dc860a36Sspz { 0x000b, "IP Layer2 Transport"}, 82dc860a36Sspz { 0x000c, "ATM one-to-one VCC Cell Mode"}, 83dc860a36Sspz { 0x000d, "ATM one-to-one VPC Cell Mode"}, 84dc860a36Sspz { 0x000e, "ATM AAL5 PDU VCC transport"}, 85dc860a36Sspz { 0x000f, "Frame-Relay Port mode"}, 86dc860a36Sspz { 0x0010, "SONET/SDH Circuit Emulation over Packet"}, 87dc860a36Sspz { 0x0011, "Structure-agnostic E1 over Packet"}, 88dc860a36Sspz { 0x0012, "Structure-agnostic T1 (DS1) over Packet"}, 89dc860a36Sspz { 0x0013, "Structure-agnostic E3 over Packet"}, 90dc860a36Sspz { 0x0014, "Structure-agnostic T3 (DS3) over Packet"}, 91dc860a36Sspz { 0x0015, "CESoPSN basic mode"}, 92dc860a36Sspz { 0x0016, "TDMoIP basic mode"}, 93dc860a36Sspz { 0x0017, "CESoPSN TDM with CAS"}, 94dc860a36Sspz { 0x0018, "TDMoIP TDM with CAS"}, 95dc860a36Sspz { 0x0019, "Frame Relay DLCI"}, 96dc860a36Sspz { 0x0040, "IP-interworking"}, 970f74e101Schristos { 0, NULL} 980f74e101Schristos }; 99