diff options
author | John Lo <loj@cisco.com> | 2017-11-14 13:19:26 -0500 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-11-16 11:25:51 +0000 |
commit | 70bfcaf47779340951c1e6f169b1cedcabe708d1 (patch) | |
tree | b6e1378942f278e914b7139d1210562d943cb680 /src/vnet/dhcp/dhcp_proxy.h | |
parent | 9d72120a6986e642c5b16c8650ad266188adf142 (diff) |
Add Support of DHCP VSS Type 0 where VPN-ID is ASCII
Enhence support of DHCP VSS (Virtual Subnet Selection) to include
VSS type 0 where VSS info is a NVT (Network Virtual Terminal)
ASCII VPN ID where the ASCII string MUST NOT be terminated with a
zero byte. Existing code already support VSS type 1, where VSS
information is a RFC 2685 VPN-ID of 7 bytes with 3 bytes OUI
and 4 bytes VPN index, and VSS type 255 indicating global VPN.
Change-Id: I54edbc447c89a2aacd1cc9fc72bd5ba386037608
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'src/vnet/dhcp/dhcp_proxy.h')
-rw-r--r-- | src/vnet/dhcp/dhcp_proxy.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/vnet/dhcp/dhcp_proxy.h b/src/vnet/dhcp/dhcp_proxy.h index ef2bc0a1926..9b15ac82d1e 100644 --- a/src/vnet/dhcp/dhcp_proxy.h +++ b/src/vnet/dhcp/dhcp_proxy.h @@ -48,13 +48,24 @@ typedef enum { */ typedef struct dhcp_vss_t_ { /** - * @brief ?? RFC doesn't say + * @brief VSS type as defined in RFC 6607: + * 0 for NVT ASCII VPN Identifier + * 1 for RFC 2685 VPN-ID of 7 octects - 3 bytes OUI & 4 bytes VPN index + * 255 for global default VPN */ - u32 oui; + u8 vss_type; +#define VSS_TYPE_ASCII 0 +#define VSS_TYPE_VPN_ID 1 +#define VSS_TYPE_INVALID 123 +#define VSS_TYPE_DEFAULT 255 /** - * @brief VPN-ID + * @brief Type 1 VPN-ID */ - u32 fib_id; + u8 vpn_id[7]; + /** + * @brief Type 0 ASCII VPN Identifier + */ + u8 *vpn_ascii_id; } dhcp_vss_t; /** @@ -152,11 +163,13 @@ int dhcp_vss_show_walk (dhcp_vss_t *vss, /** * @brief Configure/set a new VSS info */ -int dhcp_proxy_set_vss(fib_protocol_t proto, - u32 vrf_id, - u32 oui, - u32 fib_id, - int is_del); +int dhcp_proxy_set_vss (fib_protocol_t proto, + u32 tbl_id, + u8 vss_type, + u8 *vpn_ascii_id, + u32 oui, + u32 vpn_index, + u8 is_del); /** * @brief Dump the proxy configs to the API |