76 if (~0 == server_index)
81 if (!fn (server, ctx))
123 ip46_address_t *
addr,
u32 server_table_id)
146 ip46_address_t *
addr,
u32 server_table_id)
185 ip46_address_t *
addr,
186 ip46_address_t * src_address,
187 u32 rx_fib_index,
u32 server_table_id)
201 memset (proxy, 0,
sizeof (*proxy));
270 rx_table_id, oui, fib_id);
276 vlib_cli_output (vm,
" fib_table: %d default global vpn", rx_table_id);
283 u8 vss_type,
u8 * vpn_ascii_id,
u32 oui,
u32 vpn_index)
298 v->
vpn_id[0] = (oui >> 16) & 0xff;
299 v->
vpn_id[1] = (oui >> 8) & 0xff;
300 v->
vpn_id[2] = (oui >> 0) & 0xff;
301 v->
vpn_id[3] = (vpn_index >> 24) & 0xff;
302 v->
vpn_id[4] = (vpn_index >> 16) & 0xff;
303 v->
vpn_id[5] = (vpn_index >> 8) & 0xff;
304 v->
vpn_id[6] = (vpn_index >> 0) & 0xff;
312 u8 * vpn_ascii_id,
u32 oui,
u32 vpn_index,
u8 is_del)
341 update_vss (v, vss_type, vpn_ascii_id, oui, vpn_index);
347 rc = VNET_API_ERROR_NO_SUCH_ENTRY;
356 update_vss (v, vss_type, vpn_ascii_id, oui, vpn_index);
u32 mfib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, mfib_source_t src)
Get the index of the FIB for a Table-ID.
#define vec_foreach_index(var, v)
Iterate over vector indices.
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_vss_walk(fib_protocol_t proto, dhcp_vss_walk_fn_t fn, void *ctx)
Walk/Visit each DHCP proxy VSS.
dhcp_server_t * dhcp_servers
The set of DHCP servers to which messages are relayed.
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_vss_show_walk(dhcp_vss_t *vss, u32 rx_table_id, void *ctx)
Show (on CLI) a VSS config during a show walk.
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.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u32 * dhcp_server_index_by_rx_fib_index[DHCP_N_PROTOS]
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.
u32 rx_fib_index
The FIB index (not the external Table-ID) in which the client is resides.
static int dhcp_proxy_dump_walk(dhcp_proxy_t *proxy, void *arg)
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 - ...
static void dhcp_proxy_rx_table_unlock(fib_protocol_t proto, u32 fib_index)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
void dhcp_proxy_dump(fib_protocol_t proto, void *opaque, u32 context)
Dump the proxy configs to the API.
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]
int dhcp_proxy_server_add(fib_protocol_t proto, ip46_address_t *addr, ip46_address_t *src_address, u32 rx_fib_index, u32 server_table_id)
Add a new DHCP proxy server configuration.
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
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.
struct dhcp4_proxy_dump_walk_ctx_t_ dhcp_proxy_dump_walk_cxt_t
void mfib_table_unlock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Take a reference counting lock on the table.
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...
#define pool_put(P, E)
Free an object E in pool P.
#define vec_del1(v, i)
Delete the element at index I.
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.
void mfib_table_lock(u32 fib_index, fib_protocol_t proto, mfib_source_t source)
Release a reference counting lock on the table.
void fib_table_unlock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Take a reference counting lock on the table.
u8 * vpn_ascii_id
Type 0 ASCII VPN Identifier.
u32 ft_table_id
Table ID (hash key) for this FIB.
#define vec_free(V)
Free vector's memory (no header).
A representation of a single DHCP Server within a given VRF config.
void fib_table_lock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Release a reference counting lock on the table.
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...
ip46_address_t dhcp_server
The address of the DHCP server to which to relay the client's messages.
void update_vss(dhcp_vss_t *v, u8 vss_type, u8 *vpn_ascii_id, u32 oui, u32 vpn_index)
u32 fib_table_find_or_create_and_lock(fib_protocol_t proto, u32 table_id, fib_source_t src)
Get the index of the FIB for a Table-ID.
u32 mft_table_id
Table ID (hash key) for this FIB.
static void dhcp_proxy_rx_table_lock(fib_protocol_t proto, u32 fib_index)
static u32 dhcp_proxy_server_find(dhcp_proxy_t *proxy, fib_protocol_t proto, ip46_address_t *addr, u32 server_table_id)
A DHCP proxy represenation fpr per-client VRF config.
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.
mfib_table_t * mfib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
#define ip46_address_is_equal(a1, a2)
#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]
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
A protocol Independent IP multicast FIB table.
u32 dhcp_proxy_rx_table_get_table_id(fib_protocol_t proto, u32 fib_index)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
A protocol Independent FIB table.