FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
dhcp4_proxy_node.c File Reference
+ Include dependency graph for dhcp4_proxy_node.c:

Go to the source code of this file.

Data Structures

struct  dhcp_proxy_trace_t
 

Macros

#define dhcp_proxy_error(n, s)   s,
 
#define foreach_dhcp_proxy_to_server_input_next
 
#define VPP_DHCP_OPTION82_SUB1_SIZE   6
 
#define VPP_DHCP_OPTION82_SUB5_SIZE   6
 
#define VPP_DHCP_OPTION82_VSS_SIZE   12
 
#define VPP_DHCP_OPTION82_SIZE
 

Enumerations

enum  dhcp_proxy_to_server_input_next_t { DHCP_PROXY_TO_SERVER_INPUT_N_NEXT }
 
enum  dhcp4_next_t { DHCP4_PROXY_NEXT_DROP, DHCP4_PROXY_NEXT_TX, DHCP4_PROXY_N_NEXT }
 

Functions

static u8format_dhcp_proxy_trace (u8 *s, va_list *args)
 
static u8format_dhcp_proxy_header_with_length (u8 *s, va_list *args)
 
static uword dhcp_proxy_to_server_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword dhcp_proxy_to_client_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
void dhcp_maybe_register_udp_ports (dhcp_port_reg_flags_t ports)
 Register the dhcp client and/or server ports, if not already done. More...
 
static clib_error_tdhcp4_proxy_init (vlib_main_t *vm)
 
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)
 
static clib_error_tdhcp4_proxy_set_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static u8format_dhcp4_proxy_server (u8 *s, va_list *args)
 
static int dhcp4_proxy_show_walk (dhcp_proxy_t *server, void *ctx)
 
static clib_error_tdhcp4_proxy_show_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tdhcp_option_82_vss_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tdhcp_vss_show_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tdhcp_option_82_address_show_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static char * dhcp_proxy_error_strings []
 
static vlib_node_registration_t dhcp_proxy_to_server_node
 (constructor) VLIB_REGISTER_NODE (dhcp_proxy_to_server_node) More...
 
static vlib_node_registration_t dhcp_proxy_to_client_node
 (constructor) VLIB_REGISTER_NODE (dhcp_proxy_to_client_node) More...
 
static vlib_cli_command_t dhcp_proxy_set_command
 (constructor) VLIB_CLI_COMMAND (dhcp_proxy_set_command) More...
 
static vlib_cli_command_t dhcp_proxy_show_command
 (constructor) VLIB_CLI_COMMAND (dhcp_proxy_show_command) More...
 
static vlib_cli_command_t dhcp_proxy_vss_command
 (constructor) VLIB_CLI_COMMAND (dhcp_proxy_vss_command) More...
 
static vlib_cli_command_t dhcp_proxy_vss_show_command
 (constructor) VLIB_CLI_COMMAND (dhcp_proxy_vss_show_command) More...
 
static vlib_cli_command_t dhcp_proxy_address_show_command
 (constructor) VLIB_CLI_COMMAND (dhcp_proxy_address_show_command) More...
 

Macro Definition Documentation

◆ dhcp_proxy_error

#define dhcp_proxy_error (   n,
 
)    s,

◆ foreach_dhcp_proxy_to_server_input_next

#define foreach_dhcp_proxy_to_server_input_next
Value:
_ (DROP, "error-drop") \
_ (LOOKUP, "ip4-lookup") \
_ (SEND_TO_CLIENT, "dhcp-proxy-to-client")
DROP
Definition: error.def:41

Definition at line 30 of file dhcp4_proxy_node.c.

◆ VPP_DHCP_OPTION82_SIZE

#define VPP_DHCP_OPTION82_SIZE
Value:
VPP_DHCP_OPTION82_SUB5_SIZE + \
VPP_DHCP_OPTION82_VSS_SIZE +3)
#define VPP_DHCP_OPTION82_SUB1_SIZE

Definition at line 60 of file dhcp4_proxy_node.c.

◆ VPP_DHCP_OPTION82_SUB1_SIZE

#define VPP_DHCP_OPTION82_SUB1_SIZE   6

Definition at line 57 of file dhcp4_proxy_node.c.

◆ VPP_DHCP_OPTION82_SUB5_SIZE

#define VPP_DHCP_OPTION82_SUB5_SIZE   6

Definition at line 58 of file dhcp4_proxy_node.c.

◆ VPP_DHCP_OPTION82_VSS_SIZE

#define VPP_DHCP_OPTION82_VSS_SIZE   12

Definition at line 59 of file dhcp4_proxy_node.c.

Enumeration Type Documentation

◆ dhcp4_next_t

Enumerator
DHCP4_PROXY_NEXT_DROP 
DHCP4_PROXY_NEXT_TX 
DHCP4_PROXY_N_NEXT 

Definition at line 493 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_to_server_input_next_t

Enumerator
DHCP_PROXY_TO_SERVER_INPUT_N_NEXT 

Definition at line 35 of file dhcp4_proxy_node.c.

Function Documentation

◆ dhcp4_proxy_init()

static clib_error_t* dhcp4_proxy_init ( vlib_main_t vm)
static

Definition at line 832 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp4_proxy_set_command_fn()

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

Definition at line 901 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp4_proxy_set_server()

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 
)

Definition at line 848 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dhcp4_proxy_show_command_fn()

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

Definition at line 1010 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp4_proxy_show_walk()

static int dhcp4_proxy_show_walk ( dhcp_proxy_t server,
void *  ctx 
)
static

Definition at line 1000 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dhcp_maybe_register_udp_ports()

void dhcp_maybe_register_udp_ports ( dhcp_port_reg_flags_t  ports)

Register the dhcp client and/or server ports, if not already done.

Definition at line 811 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dhcp_option_82_address_show_command_fn()

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

Definition at line 1099 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp_option_82_vss_fn()

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

Definition at line 1031 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp_proxy_to_client_input()

static uword dhcp_proxy_to_client_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 501 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp_proxy_to_server_input()

static uword dhcp_proxy_to_server_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 109 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ dhcp_vss_show_command_fn()

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

Definition at line 1082 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:

◆ format_dhcp4_proxy_server()

static u8* format_dhcp4_proxy_server ( u8 s,
va_list *  args 
)
static

Definition at line 970 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_dhcp_proxy_header_with_length()

static u8* format_dhcp_proxy_header_with_length ( u8 s,
va_list *  args 
)
static

Definition at line 93 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_dhcp_proxy_trace()

static u8* format_dhcp_proxy_trace ( u8 s,
va_list *  args 
)
static

Definition at line 68 of file dhcp4_proxy_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ dhcp_proxy_address_show_command

vlib_cli_command_t dhcp_proxy_address_show_command
static
Initial value:
= {
.path = "show dhcp option-82-address interface",
.short_help = "show dhcp option-82-address interface <interface>",
}
static clib_error_t * dhcp_option_82_address_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (dhcp_proxy_address_show_command)

Definition at line 1140 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_error_strings

char* dhcp_proxy_error_strings[]
static
Initial value:
= {
#define dhcp_proxy_error(n,s)
}

Definition at line 24 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_set_command

vlib_cli_command_t dhcp_proxy_set_command
static
Initial value:
= {
.path = "set dhcp proxy",
.short_help = "set dhcp proxy [del] server <ip-addr> src-address <ip-addr> [server-fib-id <n>] [rx-fib-id <n>]",
}
static clib_error_t * dhcp4_proxy_set_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (dhcp_proxy_set_command)

Definition at line 962 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_show_command

vlib_cli_command_t dhcp_proxy_show_command
static
Initial value:
= {
.path = "show dhcp proxy",
.short_help = "Display dhcp proxy server info",
}
static clib_error_t * dhcp4_proxy_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (dhcp_proxy_show_command)

Definition at line 1023 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_to_client_node

static vlib_node_registration_t dhcp_proxy_to_client_node
static
Initial value:
= {
.name = "dhcp-proxy-to-client",
.vector_size = sizeof (u32),
.n_errors = DHCP_PROXY_N_ERROR,
.error_strings = dhcp_proxy_error_strings,
.format_trace = format_dhcp_proxy_trace,
.n_next_nodes = DHCP4_PROXY_N_NEXT,
.next_nodes = {
[DHCP4_PROXY_NEXT_DROP] = "error-drop",
[DHCP4_PROXY_NEXT_TX] = "interface-output",
},
}
static uword dhcp_proxy_to_client_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
unsigned int u32
Definition: types.h:88
static char * dhcp_proxy_error_strings[]
static u8 * format_dhcp_proxy_trace(u8 *s, va_list *args)
static u8 * format_dhcp_proxy_header_with_length(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (dhcp_proxy_to_client_node)

Definition at line 65 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_to_server_node

static vlib_node_registration_t dhcp_proxy_to_server_node
static
Initial value:
= {
.name = "dhcp-proxy-to-server",
.vector_size = sizeof (u32),
.n_errors = DHCP_PROXY_N_ERROR,
.error_strings = dhcp_proxy_error_strings,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_dhcp_proxy_trace,
}
static uword dhcp_proxy_to_server_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
unsigned int u32
Definition: types.h:88
static char * dhcp_proxy_error_strings[]
static u8 * format_dhcp_proxy_trace(u8 *s, va_list *args)
#define foreach_dhcp_proxy_to_server_input_next
static u8 * format_dhcp_proxy_header_with_length(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (dhcp_proxy_to_server_node)

Definition at line 64 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_vss_command

vlib_cli_command_t dhcp_proxy_vss_command
static
Initial value:
= {
.path = "set dhcp option-82 vss",
.short_help = "set dhcp option-82 vss [del] table <table id> [oui <n> vpn-id <n> | vpn-ascii-id <text>]",
.function = dhcp_option_82_vss_fn,
}
static clib_error_t * dhcp_option_82_vss_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (dhcp_proxy_vss_command)

Definition at line 1074 of file dhcp4_proxy_node.c.

◆ dhcp_proxy_vss_show_command

vlib_cli_command_t dhcp_proxy_vss_show_command
static
Initial value:
= {
.path = "show dhcp vss",
.short_help = "show dhcp VSS",
}
static clib_error_t * dhcp_vss_show_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (dhcp_proxy_vss_show_command)

Definition at line 1091 of file dhcp4_proxy_node.c.