FD.io VPP  v18.01.1-37-g7ea3975
Vector Packet Processing
client.c File Reference
+ Include dependency graph for client.c:

Go to the source code of this file.

Macros

#define foreach_dhcp_client_process_stat
 

Enumerations

enum  sample_error_t { DHCP_STAT_UNKNOWN, DHCP_STAT_N_STAT, SAMPLE_N_ERROR }
 

Functions

static u8format_dhcp_client_state (u8 *s, va_list *va)
 
static void dhcp_client_add_rx_address (dhcp_client_main_t *dcm, dhcp_client_t *c)
 
static void dhcp_client_remove_rx_address (dhcp_client_main_t *dcm, dhcp_client_t *c)
 
static void dhcp_client_acquire_address (dhcp_client_main_t *dcm, dhcp_client_t *c)
 
static void dhcp_client_release_address (dhcp_client_main_t *dcm, dhcp_client_t *c)
 
static void set_l2_rewrite (dhcp_client_main_t *dcm, dhcp_client_t *c)
 
void vl_api_rpc_call_main_thread (void *fp, u8 *data, u32 data_length)
 
static void dhcp_client_proc_callback (uword *client_index)
 
static void dhcp_client_addr_callback (dhcp_client_t *c)
 
int dhcp_client_for_us (u32 bi, vlib_buffer_t *b, ip4_header_t *ip, udp_header_t *udp, dhcp_header_t *dhcp)
 
static void send_dhcp_pkt (dhcp_client_main_t *dcm, dhcp_client_t *c, dhcp_packet_type_t type, int is_broadcast)
 
static int dhcp_discover_state (dhcp_client_main_t *dcm, dhcp_client_t *c, f64 now)
 
static int dhcp_request_state (dhcp_client_main_t *dcm, dhcp_client_t *c, f64 now)
 
static int dhcp_bound_state (dhcp_client_main_t *dcm, dhcp_client_t *c, f64 now)
 
static f64 dhcp_client_sm (f64 now, f64 timeout, uword pool_index)
 
static uword dhcp_client_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static u8format_dhcp_client (u8 *s, va_list *va)
 
static clib_error_tshow_dhcp_client_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int dhcp_client_add_del (dhcp_client_add_del_args_t *a)
 
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, u32 pid)
 
static clib_error_tdhcp_client_set_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tdhcp_client_init (vlib_main_t *vm)
 

Variables

dhcp_client_main_t dhcp_client_main
 
static vlib_node_registration_t dhcp_client_process_node
 (constructor) VLIB_REGISTER_NODE (dhcp_client_process_node) More...
 
static char * dhcp_client_process_stat_strings []
 
static vlib_cli_command_t show_dhcp_client_command
 (constructor) VLIB_CLI_COMMAND (show_dhcp_client_command) More...
 
static vlib_cli_command_t dhcp_client_set_command
 (constructor) VLIB_CLI_COMMAND (dhcp_client_set_command) More...
 

Macro Definition Documentation

#define foreach_dhcp_client_process_stat
Value:
_(DISCOVER, "DHCP discover packets sent") \
_(OFFER, "DHCP offer packets sent") \
_(REQUEST, "DHCP request packets sent") \
_(ACK, "DHCP ack packets sent")

Definition at line 24 of file client.c.

Enumeration Type Documentation

Enumerator
DHCP_STAT_UNKNOWN 
DHCP_STAT_N_STAT 
SAMPLE_N_ERROR 

Definition at line 30 of file client.c.

Function Documentation

static int dhcp_bound_state ( dhcp_client_main_t dcm,
dhcp_client_t c,
f64  now 
)
static

Definition at line 608 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dhcp_client_acquire_address ( dhcp_client_main_t dcm,
dhcp_client_t c 
)
static

Definition at line 98 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int dhcp_client_add_del ( dhcp_client_add_del_args_t a)

Definition at line 874 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dhcp_client_add_rx_address ( dhcp_client_main_t dcm,
dhcp_client_t c 
)
static

Definition at line 48 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dhcp_client_addr_callback ( dhcp_client_t c)
static

Definition at line 143 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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,
u32  pid 
)

Definition at line 966 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int dhcp_client_for_us ( u32  bi,
vlib_buffer_t b,
ip4_header_t ip,
udp_header_t udp,
dhcp_header_t dhcp 
)

Definition at line 200 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* dhcp_client_init ( vlib_main_t vm)
static

Definition at line 1154 of file client.c.

+ Here is the call graph for this function:

static void dhcp_client_proc_callback ( uword client_index)
static

Definition at line 134 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword dhcp_client_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 715 of file client.c.

+ Here is the call graph for this function:

static void dhcp_client_release_address ( dhcp_client_main_t dcm,
dhcp_client_t c 
)
static

Definition at line 109 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void dhcp_client_remove_rx_address ( dhcp_client_main_t dcm,
dhcp_client_t c 
)
static

Definition at line 75 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* dhcp_client_set_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1049 of file client.c.

+ Here is the call graph for this function:

static f64 dhcp_client_sm ( f64  now,
f64  timeout,
uword  pool_index 
)
static

Definition at line 669 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int dhcp_discover_state ( dhcp_client_main_t dcm,
dhcp_client_t c,
f64  now 
)
static

Definition at line 570 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int dhcp_request_state ( dhcp_client_main_t dcm,
dhcp_client_t c,
f64  now 
)
static

Definition at line 587 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_dhcp_client ( u8 s,
va_list *  va 
)
static

Definition at line 796 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 * format_dhcp_client_state ( u8 s,
va_list *  va 
)
static

Definition at line 774 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_dhcp_pkt ( dhcp_client_main_t dcm,
dhcp_client_t c,
dhcp_packet_type_t  type,
int  is_broadcast 
)
static

Definition at line 359 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void set_l2_rewrite ( dhcp_client_main_t dcm,
dhcp_client_t c 
)
static

Definition at line 122 of file client.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* show_dhcp_client_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 822 of file client.c.

+ Here is the call graph for this function:

void vl_api_rpc_call_main_thread ( void *  fp,
u8 data,
u32  data_length 
)

Definition at line 1916 of file memory_vlib.c.

+ Here is the caller graph for this function:

Variable Documentation

dhcp_client_main_t dhcp_client_main

Definition at line 20 of file client.c.

static vlib_node_registration_t dhcp_client_process_node
static
Initial value:
= {
.function = dhcp_client_process,
.name = "dhcp-client-process",
.process_log2_n_stack_bytes = 16,
}
static char * dhcp_client_process_stat_strings[]
Definition: client.c:39
static uword dhcp_client_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: client.c:715
#define ARRAY_LEN(x)
Definition: clib.h:59

(constructor) VLIB_REGISTER_NODE (dhcp_client_process_node)

Definition at line 22 of file client.c.

char* dhcp_client_process_stat_strings[]
static
Initial value:
= {
#define _(sym,string)
"DHCP unknown packets sent",
}
#define foreach_dhcp_client_process_stat
Definition: client.c:24

Definition at line 39 of file client.c.

vlib_cli_command_t dhcp_client_set_command
static
Initial value:
= {
.path = "set dhcp client",
.short_help = "set dhcp client [del] intfc <interface> [hostname <name>]",
}
static clib_error_t * dhcp_client_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: client.c:1049

(constructor) VLIB_CLI_COMMAND (dhcp_client_set_command)

Definition at line 1146 of file client.c.

vlib_cli_command_t show_dhcp_client_command
static
Initial value:
= {
.path = "show dhcp client",
.short_help = "show dhcp client [intfc <intfc>][verbose]",
}
static clib_error_t * show_dhcp_client_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: client.c:822

(constructor) VLIB_CLI_COMMAND (show_dhcp_client_command)

Definition at line 865 of file client.c.