40 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 47 #define foreach_vpe_api_msg \ 48 _(DHCP_PROXY_CONFIG,dhcp_proxy_config) \ 49 _(DHCP_PROXY_DUMP,dhcp_proxy_dump) \ 50 _(DHCP_PROXY_SET_VSS,dhcp_proxy_set_vss) \ 51 _(DHCP_CLIENT_CONFIG, dhcp_client_config) 57 vl_api_dhcp_proxy_set_vss_reply_t *rmp;
76 vl_api_dhcp_proxy_set_vss_reply_t *rmp;
77 ip46_address_t src, server;
142 mp->_vl_msg_id = ntohs (VL_API_DHCP_PROXY_DETAILS);
209 u8 * router_address,
u8 * host_mac)
230 if (
NULL != host_mac)
233 mp->_vl_msg_id = ntohs (VL_API_DHCP_COMPL_EVENT);
242 vl_api_dhcp_client_config_reply_t *rmp;
265 #define vl_msg_name_crc_list 267 #undef vl_msg_name_crc_list 272 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 273 foreach_vl_msg_name_crc_dhcp;
283 vl_msg_api_set_handlers(VL_API_##N, #n, \ 284 vl_api_##n##_t_handler, \ 286 vl_api_##n##_t_endian, \ 287 vl_api_##n##_t_print, \ 288 sizeof(vl_api_##n##_t), 1);
DHCP Proxy set / unset vss request.
#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_server_t * dhcp_servers
The set of DHCP servers to which messages are relayed.
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.
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.
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 - ...
void * vl_msg_api_alloc(int nbytes)
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.
vl_api_dhcp_server_t servers[count]
static void vl_api_dhcp_proxy_config_t_handler(vl_api_dhcp_proxy_config_t *mp)
#define foreach_vpe_api_msg
u32 server_fib_index
The FIB index (not the external Table-ID) in which the server is reachable.
int dhcp_client_config(vlib_main_t *vm, u32 sw_if_index, u8 *hostname, u8 *client_id, u32 is_add, u32 client_index, void *event_callback, u8 set_broadcast_flag, u32 pid)
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.
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
u8 * vpn_ascii_id
Type 0 ASCII VPN Identifier.
u32 ft_table_id
Table ID (hash key) for this FIB.
uint32_t mask_width(const boost::asio::ip::address &addr)
Get the prefix mask length of a host route from the boost address.
#define clib_memcpy(a, b, c)
void dhcp_compl_event_callback(u32 client_index, u32 pid, u8 *hostname, u8 mask_width, u8 is_ipv6, u8 *host_address, u8 *router_address, u8 *host_mac)
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)
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.
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)
u32 dhcp_proxy_rx_table_get_table_id(fib_protocol_t proto, u32 fib_index)
Tell client about a DHCP completion event.
DHCP Client config add / del request.
DHCP Proxy config add / del request.
#define VALIDATE_SW_IF_INDEX(mp)
A protocol Independent FIB table.