18 #ifndef included_dhcp_proxy_h 19 #define included_dhcp_proxy_h 33 #define dhcp_proxy_error(n,s) DHCP_PROXY_ERROR_##n, 35 #undef dhcp_proxy_error 41 #define dhcpv6_proxy_error(n,s) DHCPV6_PROXY_ERROR_##n, 43 #undef dhcpv6_proxy_error 60 #define VSS_TYPE_ASCII 0 61 #define VSS_TYPE_VPN_ID 1 62 #define VSS_TYPE_INVALID 123 63 #define VSS_TYPE_DEFAULT 255 129 #define DHCP_N_PROTOS (FIB_PROTOCOL_IP6 + 1) 183 ip46_address_t *
addr,
185 u32 rx_fib_iindex,
u32 server_table_id);
193 ip46_address_t *
addr,
u32 server_table_id);
214 u32 rx_table_id,
void *
ctx);
274 ip46_address_t * src_addr,
275 u32 rx_table_id,
u32 server_table_id,
int is_del);
277 ip46_address_t * src_addr,
278 u32 rx_table_id,
u32 server_table_id,
int is_del);
static dhcp_vss_t * dhcp_get_vss_info(dhcp_proxy_main_t *dm, u32 rx_fib_index, fib_protocol_t proto)
Get the VSS data for the FIB index.
void dhcp_proxy_dump(fib_protocol_t proto, void *opaque, u32 context)
Dump the proxy configs to the API.
struct dhcp_proxy_t_ dhcp_proxy_t
A DHCP proxy represenation fpr per-client VRF config.
struct dhcp_server_t_ dhcp_server_t
A representation of a single DHCP Server within a given VRF config.
dhcp_server_t * dhcp_servers
The set of DHCP servers to which messages are relayed.
int dhcp_vss_show_walk(dhcp_vss_t *vss, u32 rx_table_id, void *ctx)
Show (on CLI) a VSS config during a show walk.
int dhcp4_proxy_set_server(ip46_address_t *addr, ip46_address_t *src_addr, u32 rx_table_id, u32 server_table_id, int is_del)
ip46_address_t dhcp_src_address
The source address to use in relayed messaes.
The Virtual Sub-net Selection information for a given RX FIB.
u32 * dhcp_server_index_by_rx_fib_index[DHCP_N_PROTOS]
u32 rx_fib_index
The FIB index (not the external Table-ID) in which the client is resides.
u8 vss_type
VSS type as defined in RFC 6607: 0 for NVT ASCII VPN Identifier 1 for RFC 2685 VPN-ID of 7 octects - ...
u32 error_drop_node_index
void dhcp_proxy_lock(dhcp_proxy_t *server)
Lock a proxy object to prevent simultaneous access of its pending store.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static dhcp_proxy_t * dhcp_get_proxy(dhcp_proxy_main_t *dm, u32 rx_fib_index, fib_protocol_t proto)
Get the DHCP proxy server data for the FIB index.
u32 * vss_index_by_rx_fib_index[DHCP_N_PROTOS]
dhcp_proxy_t * dhcp_servers[DHCP_N_PROTOS]
u32 server_fib_index
The FIB index (not the external Table-ID) in which the server is reachable.
Collection of global DHCP proxy data.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int(* dhcp_vss_walk_fn_t)(dhcp_vss_t *server, u32 rx_table_id, void *ctx)
Callback function invoked for each DHCP VSS entry return 0 to break the walk, non-zero otherwise...
vl_api_address_union_t src_address
int lock
A lock for the pending request DB.
u8 * vpn_ascii_id
Type 0 ASCII VPN Identifier.
void dhcp_vss_walk(fib_protocol_t proto, dhcp_vss_walk_fn_t fn, void *ctx)
Walk/Visit each DHCP proxy VSS.
A representation of a single DHCP Server within a given VRF config.
struct dhcp_vss_t_ dhcp_vss_t
The Virtual Sub-net Selection information for a given RX FIB.
int(* dhcp_proxy_walk_fn_t)(dhcp_proxy_t *server, void *ctx)
Callback function invoked for each DHCP proxy entry return 0 to break the walk, non-zero otherwise...
int dhcp_proxy_server_del(fib_protocol_t proto, u32 rx_fib_index, ip46_address_t *addr, u32 server_table_id)
Delete a DHCP proxy config.
ip46_address_t dhcp_server
The address of the DHCP server to which to relay the client's messages.
int dhcp6_proxy_set_server(ip46_address_t *addr, ip46_address_t *src_addr, u32 rx_table_id, u32 server_table_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)
Configure/set a new VSS info.
uword * dhcp_pending
Hash table of pending requets key'd on the clients MAC address.
void dhcp_proxy_walk(fib_protocol_t proto, dhcp_proxy_walk_fn_t fn, void *ctx)
Walk/Visit each DHCP proxy server.
dhcp_proxy_main_t dhcp_proxy_main
Shard 4/6 instance of DHCP main.
int dhcp_proxy_server_add(fib_protocol_t proto, ip46_address_t *addr, ip46_address_t *src_address, u32 rx_fib_iindex, u32 server_table_id)
Add a new DHCP proxy server configuration.
A DHCP proxy represenation fpr per-client VRF config.
void dhcp_send_details(fib_protocol_t proto, void *opaque, u32 context, dhcp_proxy_t *proxy)
Send the details of a proxy session to the API client during a dump.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 vpn_id[7]
Type 1 VPN-ID.
dhcp_vss_t * vss[DHCP_N_PROTOS]
u32 dhcp_proxy_rx_table_get_table_id(fib_protocol_t proto, u32 fib_index)
void dhcp_proxy_unlock(dhcp_proxy_t *server)
Lock a proxy object to prevent simultaneous access of its pending store.