diff options
author | Renato Westphal <renato@cvs.openbsd.org> | 2015-07-21 04:52:30 +0000 |
---|---|---|
committer | Renato Westphal <renato@cvs.openbsd.org> | 2015-07-21 04:52:30 +0000 |
commit | a2ae921ed55c91e98ece8ee7f0b365851fb30633 (patch) | |
tree | 40369cff7366d5b45e4df63f807681b223eb63f8 /usr.sbin/ldpd/ldp.h | |
parent | 6e1f964c76fe64a2e4d55765a578dbb338c18266 (diff) |
VPLS signaling support.
This patch introduces full support for pseudowire signaling in ldpd(8),
including Control Word and Status TLV negotiation.
As of now it's not possible to configure a VPWS, but the signaling is
the same. In the future, when VPWS support is available in the kernel,
ldpd(8) can be extended to support VPWS with only a few modifications.
Limitations:
* No support for FEC 129, only FEC 128 (more widely deployed);
* No support for group withdraws (not widely deployed);
* No support for MAC withdraws (not widely deployed).
Related RFCs:
* RFC 3916: Requirements for Pseudo-Wire Emulation Edge-to-Edge (PWE3)
* RFC 3985: Pseudo Wire Emulation Edge-to-Edge (PWE3) Architecture
* RFC 4385: Pseudowire Emulation Edge-to-Edge (PWE3) Control Word for
Use over an MPLS PSN
* RFC 4446: IANA Allocations for Pseudowire Edge to Edge Emulation (PWE3)
* RFC 4447: Pseudowire Setup and Maintenance Using the Label Distribution
Protocol (LDP)
* RFC 4448: Encapsulation Methods for Transport of Ethernet over MPLS
Networks
* RFC 4905: Encapsulation Methods for Transport of Layer 2 Frames over
MPLS Networks
* RFC 4906: Transport of Layer 2 Frames Over MPLS
ok claudio@
Diffstat (limited to 'usr.sbin/ldpd/ldp.h')
-rw-r--r-- | usr.sbin/ldpd/ldp.h | 64 |
1 files changed, 59 insertions, 5 deletions
diff --git a/usr.sbin/ldpd/ldp.h b/usr.sbin/ldpd/ldp.h index e1a4480d8d4..a0830380124 100644 --- a/usr.sbin/ldpd/ldp.h +++ b/usr.sbin/ldpd/ldp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ldp.h,v 1.18 2015/07/19 20:54:17 renato Exp $ */ +/* $OpenBSD: ldp.h,v 1.19 2015/07/21 04:52:29 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -49,6 +49,13 @@ #define INIT_DELAY_TMR 15 #define MAX_DELAY_TMR 120 +#define MIN_PWID_ID 1 +#define MAX_PWID_ID 0xffffffff + +#define DEFAULT_L2VPN_MTU 1500 +#define MIN_L2VPN_MTU 512 +#define MAX_L2VPN_MTU 0xffff + /* LDP message types */ #define MSG_TYPE_NOTIFICATION 0x0001 #define MSG_TYPE_HELLO 0x0100 @@ -82,6 +89,10 @@ #define TLV_TYPE_ATMSESSIONPAR 0x0501 #define TLV_TYPE_FRSESSION 0x0502 #define TLV_TYPE_LABELREQUEST 0x0600 +/* RFC 4447 */ +#define TLV_TYPE_PW_STATUS 0x096A +#define TLV_TYPE_PW_IF_PARAM 0x096B +#define TLV_TYPE_PW_GROUP_ID 0x096C /* LDP header */ struct ldp_hdr { @@ -158,6 +169,15 @@ struct hello_prms_opt4_tlv { #define S_UNSUP_ADDR 0x00000017 #define S_KEEPALIVE_BAD 0x80000018 #define S_INTERN_ERR 0x80000019 +/* RFC 4447 */ +#define S_ILLEGAL_CBIT 0x00000024 +#define S_WRONG_CBIT 0x00000025 +#define S_INCPT_BITRATE 0x00000026 +#define S_CEP_MISCONF 0x00000027 +#define S_PW_STATUS 0x00000028 +#define S_UNASSIGN_TAI 0x00000029 +#define S_MISCONF_ERR 0x0000002A +#define S_WITHDRAW_MTHD 0x0000002B struct sess_prms_tlv { u_int16_t type; @@ -185,6 +205,9 @@ struct status_tlv { #define STATUS_TLV_LEN 10 #define STATUS_FATAL 0x80000000 +#define AF_IPV4 0x1 +#define AF_IPV6 0x2 + struct address_list_tlv { u_int16_t type; u_int16_t length; @@ -192,14 +215,30 @@ struct address_list_tlv { /* address entries */ } __packed; -#define ADDR_IPV4 0x1 -#define ADDR_IPV6 0x2 - #define FEC_ELM_WCARD_LEN 1 #define FEC_ELM_PREFIX_MIN_LEN 4 +#define FEC_PWID_ELM_MIN_LEN 8 #define FEC_WILDCARD 0x01 #define FEC_PREFIX 0x02 -#define FEC_IPV4 0x0001 +#define FEC_PWID 0x80 +#define FEC_GENPWID 0x81 + +#define CONTROL_WORD_FLAG 0x8000 +#define PW_TYPE_ETHERNET_TAGGED 0x0004 +#define PW_TYPE_ETHERNET 0x0005 + +/* RFC 4447 Sub-TLV record */ +struct subtlv { + u_int8_t type; + u_int8_t length; +}; +#define SUBTLV_HDR_LEN 2 + +#define SUBTLV_IFMTU 0x01 +#define SUBTLV_VLANID 0x06 + +#define FEC_SUBTLV_IFMTU_LEN 4 +#define FEC_SUBTLV_VLANID_LEN 4 struct label_tlv { u_int16_t type; @@ -217,6 +256,21 @@ struct reqid_tlv { #define REQID_TLV_LEN 8 +struct pw_status_tlv { + u_int16_t type; + u_int16_t length; + u_int32_t value; +}; + +#define PW_STATUS_TLV_LEN 8 + +#define PW_FORWARDING 0 +#define PW_NOT_FORWARDING (1 << 0) +#define PW_LOCAL_RX_FAULT (1 << 1) +#define PW_LOCAL_TX_FAULT (1 << 2) +#define PW_PSN_RX_FAULT (1 << 3) +#define PW_PSN_TX_FAULT (1 << 4) + #define NO_LABEL UINT_MAX #endif /* !_LDP_H_ */ |