43 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 50 #define foreach_vpe_api_msg \ 51 _(DHCP_PROXY_CONFIG,dhcp_proxy_config) \ 52 _(DHCP_PROXY_DUMP,dhcp_proxy_dump) \ 53 _(DHCP_PROXY_SET_VSS,dhcp_proxy_set_vss) \ 54 _(DHCP_CLIENT_CONFIG, dhcp_client_config) \ 55 _(DHCP_CLIENT_DUMP, dhcp_client_dump) \ 56 _(WANT_DHCP6_PD_REPLY_EVENTS, want_dhcp6_pd_reply_events) \ 57 _(DHCP6_PD_SEND_CLIENT_MESSAGE, dhcp6_pd_send_client_message) \ 58 _(WANT_DHCP6_REPLY_EVENTS, want_dhcp6_reply_events) \ 59 _(DHCP6_SEND_CLIENT_MESSAGE, dhcp6_send_client_message) \ 60 _(DHCP6_CLIENTS_ENABLE_DISABLE, dhcp6_clients_enable_disable) \ 61 _(DHCP6_DUID_LL_SET, dhcp6_duid_ll_set) 67 vl_api_dhcp_proxy_set_vss_reply_t *rmp;
86 vl_api_dhcp_proxy_set_vss_reply_t *rmp;
87 ip46_address_t
src, server;
152 mp->_vl_msg_id = ntohs (VL_API_DHCP_PROXY_DETAILS);
251 vclient->
id[
len] = 0;
258 vclient->
pid = client->
pid;
276 mp->_vl_msg_id = ntohs (VL_API_DHCP_COMPL_EVENT);
285 vl_api_dhcp_client_config_reply_t *rmp;
292 rv = VNET_API_ERROR_INVALID_SW_IF_INDEX;
293 goto bad_sw_if_index;
329 mp->_vl_msg_id = ntohs (VL_API_DHCP_CLIENT_DETAILS);
363 #define vl_msg_name_crc_list 365 #undef vl_msg_name_crc_list 370 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 371 foreach_vl_msg_name_crc_dhcp;
381 vl_msg_api_set_handlers(VL_API_##N, #n, \ 382 vl_api_##n##_t_handler, \ 384 vl_api_##n##_t_endian, \ 385 vl_api_##n##_t_print, \ 386 sizeof(vl_api_##n##_t), 1);
DHCP Proxy set / unset vss request.
vl_api_dhcp_lease_t lease
#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.
static clib_error_t * dhcp_api_hookup(vlib_main_t *vm)
DHCP Client details returned from dump.
dhcp_server_t * dhcp_servers
The set of DHCP servers to which messages are relayed.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
dhcp_proxy_main_t dhcp_proxy_main
Shard 4/6 instance of DHCP main.
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)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
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.
vlib_node_registration_t dhcp6_reply_process_node
(constructor) VLIB_REGISTER_NODE (dhcp6_reply_process_node)
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.
void dhcp_client_walk(dhcp_client_walk_cb_t cb, void *ctx)
Walk (visit each) DHCP client configuration.
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 vl_api_dhcp_client_dump_t_handler(vl_api_dhcp_client_dump_t *mp)
dhcp_client_state_t state
void * vl_msg_api_alloc(int nbytes)
void dhcp6_set_publisher_node(uword node_index, uword event_type)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
Dump the DHCP client configurations.
#define clib_memcpy(d, s, n)
void dhcp_proxy_dump(fib_protocol_t proto, void *opaque, u32 context)
Dump the proxy configs to the API.
vl_api_dhcp_client_t client
vl_api_dhcp_server_t servers[count]
static void vl_api_dhcp_proxy_config_t_handler(vl_api_dhcp_proxy_config_t *mp)
static int send_dhcp_client_entry(const dhcp_client_t *client, void *arg)
dhcp_event_cb_t event_callback
#define foreach_vpe_api_msg
void dhcp6_pd_set_publisher_node(uword node_index, uword event_type)
u32 server_fib_index
The FIB index (not the external Table-ID) in which the server is reachable.
ip4_address_t leased_address
struct dhcp_client_send_walk_ctx_t_ dhcp_client_send_walk_ctx_t
int dhcp_client_config(u32 is_add, u32 client_index, vlib_main_t *vm, u32 sw_if_index, u8 *hostname, u8 *client_id, dhcp_event_cb_t event_callback, u8 set_broadcast_flag, u32 pid)
Add/Delete DHCP clients.
Data learned by the client during the DHCP process.
static void vl_api_dhcp_proxy_dump_t_handler(vl_api_dhcp_proxy_dump_t *mp)
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.
static void dhcp_client_data_encode(vl_api_dhcp_client_t *vclient, const dhcp_client_t *client)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
static uword vnet_sw_if_index_is_api_valid(u32 sw_if_index)
u8 * vpn_ascii_id
Type 0 ASCII VPN Identifier.
u32 ft_table_id
Table ID (hash key) for this FIB.
static void dhcp_compl_event_callback(u32 client_index, const dhcp_client_t *client)
vl_api_registration_t * reg
A representation of a single DHCP Server within a given VRF config.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
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_server
The address of the DHCP server to which to relay the client's messages.
VLIB_API_INIT_FUNCTION(dhcp_api_hookup)
vl_api_dhcp_lease_t lease
ip4_address_t router_address
static vlib_main_t * vlib_get_main(void)
Tell client about a DHCP completion event.
#define ip46_address_reset(ip46)
A DHCP proxy represenation fpr per-client VRF config.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u8 vpn_id[7]
Type 1 VPN-ID.
vl_api_dhcp_client_t client
static void setup_message_id_table(api_main_t *am)
static void vl_api_dhcp_client_config_t_handler(vl_api_dhcp_client_config_t *mp)
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
static void vl_api_dhcp_proxy_set_vss_t_handler(vl_api_dhcp_proxy_set_vss_t *mp)
vlib_node_registration_t dhcp6_pd_reply_process_node
(constructor) VLIB_REGISTER_NODE (dhcp6_pd_reply_process_node)
u32 dhcp_proxy_rx_table_get_table_id(fib_protocol_t proto, u32 fib_index)
static void dhcp_client_lease_encode(vl_api_dhcp_lease_t *lease, const dhcp_client_t *client)
Tell client about a DHCP completion event.
DHCP Client config add / del request.
DHCP Proxy config add / del request.
A protocol Independent FIB table.