FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
dhcp_proxy.h File Reference
+ Include dependency graph for dhcp_proxy.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dhcp_vss_t_
 The Virtual Sub-net Selection information for a given RX FIB. More...
 
struct  dhcp_server_t_
 A representation of a single DHCP Server within a given VRF config. More...
 
struct  dhcp_proxy_t_
 A DHCP proxy representation fpr per-client VRF config. More...
 
struct  dhcp_proxy_main_t
 Collection of global DHCP proxy data. More...
 

Macros

#define dhcp_proxy_error(n, s)   DHCP_PROXY_ERROR_##n,
 
#define dhcpv6_proxy_error(n, s)   DHCPV6_PROXY_ERROR_##n,
 
#define VSS_TYPE_ASCII   0
 
#define VSS_TYPE_VPN_ID   1
 
#define VSS_TYPE_INVALID   123
 
#define VSS_TYPE_DEFAULT   255
 
#define DHCP_N_PROTOS   (FIB_PROTOCOL_IP6 + 1)
 

Typedefs

typedef struct dhcp_vss_t_ dhcp_vss_t
 The Virtual Sub-net Selection information for a given RX FIB. More...
 
typedef struct dhcp_server_t_ dhcp_server_t
 A representation of a single DHCP Server within a given VRF config. More...
 
typedef struct dhcp_proxy_t_ dhcp_proxy_t
 A DHCP proxy representation fpr per-client VRF config. More...
 
typedef 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. More...
 
typedef 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. More...
 

Enumerations

enum  dhcp_proxy_error_t { DHCP_PROXY_N_ERROR }
 
enum  dhcpv6_proxy_error_t { DHCPV6_PROXY_N_ERROR }
 
enum  dhcp_port_reg_flags_t { DHCP_PORT_REG_CLIENT = 0x1, DHCP_PORT_REG_SERVER = 0x2 }
 

Functions

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...
 
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. More...
 
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. More...
 
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. More...
 
void dhcp_proxy_dump (fib_protocol_t proto, void *opaque, u32 context)
 Dump the proxy configs to the API. More...
 
int dhcp_proxy_server_add (fib_protocol_t proto, ip46_address_t *addr, ip46_address_t *src_address, u32 rx_fib_iindex, u32 server_table_id)
 Add a new DHCP proxy server configuration. More...
 
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. More...
 
u32 dhcp_proxy_rx_table_get_table_id (fib_protocol_t proto, u32 fib_index)
 
void dhcp_proxy_walk (fib_protocol_t proto, dhcp_proxy_walk_fn_t fn, void *ctx)
 Walk/Visit each DHCP proxy server. More...
 
void dhcp_vss_walk (fib_protocol_t proto, dhcp_vss_walk_fn_t fn, void *ctx)
 Walk/Visit each DHCP proxy VSS. More...
 
void dhcp_proxy_lock (dhcp_proxy_t *server)
 Lock a proxy object to prevent simultaneous access of its pending store. More...
 
void dhcp_proxy_unlock (dhcp_proxy_t *server)
 Lock a proxy object to prevent simultaneous access of its pending store. More...
 
static dhcp_vss_tdhcp_get_vss_info (dhcp_proxy_main_t *dm, u32 rx_fib_index, fib_protocol_t proto)
 Get the VSS data for the FIB index. More...
 
static dhcp_proxy_tdhcp_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. More...
 
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)
 
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)
 

Variables

dhcp_proxy_main_t dhcp_proxy_main
 Shard 4/6 instance of DHCP main. More...
 

Macro Definition Documentation

◆ DHCP_N_PROTOS

#define DHCP_N_PROTOS   (FIB_PROTOCOL_IP6 + 1)

Definition at line 134 of file dhcp_proxy.h.

◆ dhcp_proxy_error

#define dhcp_proxy_error (   n,
 
)    DHCP_PROXY_ERROR_##n,

Definition at line 32 of file dhcp_proxy.h.

◆ dhcpv6_proxy_error

#define dhcpv6_proxy_error (   n,
 
)    DHCPV6_PROXY_ERROR_##n,

Definition at line 40 of file dhcp_proxy.h.

◆ VSS_TYPE_ASCII

#define VSS_TYPE_ASCII   0

Definition at line 65 of file dhcp_proxy.h.

◆ VSS_TYPE_DEFAULT

#define VSS_TYPE_DEFAULT   255

Definition at line 68 of file dhcp_proxy.h.

◆ VSS_TYPE_INVALID

#define VSS_TYPE_INVALID   123

Definition at line 67 of file dhcp_proxy.h.

◆ VSS_TYPE_VPN_ID

#define VSS_TYPE_VPN_ID   1

Definition at line 66 of file dhcp_proxy.h.

Typedef Documentation

◆ dhcp_proxy_t

typedef struct dhcp_proxy_t_ dhcp_proxy_t

A DHCP proxy representation fpr per-client VRF config.

◆ dhcp_proxy_walk_fn_t

typedef 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.

Definition at line 218 of file dhcp_proxy.h.

◆ dhcp_server_t

typedef struct dhcp_server_t_ dhcp_server_t

A representation of a single DHCP Server within a given VRF config.

◆ dhcp_vss_t

typedef struct dhcp_vss_t_ dhcp_vss_t

The Virtual Sub-net Selection information for a given RX FIB.

◆ dhcp_vss_walk_fn_t

typedef 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.

Definition at line 230 of file dhcp_proxy.h.

Enumeration Type Documentation

◆ dhcp_port_reg_flags_t

Enumerator
DHCP_PORT_REG_CLIENT 
DHCP_PORT_REG_SERVER 

Definition at line 47 of file dhcp_proxy.h.

◆ dhcp_proxy_error_t

Enumerator
DHCP_PROXY_N_ERROR 

Definition at line 30 of file dhcp_proxy.h.

◆ dhcpv6_proxy_error_t

Enumerator
DHCPV6_PROXY_N_ERROR 

Definition at line 38 of file dhcp_proxy.h.

Function Documentation

◆ 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 846 of file dhcp4_proxy_node.c.

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

◆ dhcp6_proxy_set_server()

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 
)

Definition at line 874 of file dhcp6_proxy_node.c.

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

◆ dhcp_get_proxy()

static dhcp_proxy_t* dhcp_get_proxy ( dhcp_proxy_main_t dm,
u32  rx_fib_index,
fib_protocol_t  proto 
)
inlinestatic

Get the DHCP proxy server data for the FIB index.

Definition at line 274 of file dhcp_proxy.h.

+ Here is the caller graph for this function:

◆ dhcp_get_vss_info()

static dhcp_vss_t* dhcp_get_vss_info ( dhcp_proxy_main_t dm,
u32  rx_fib_index,
fib_protocol_t  proto 
)
inlinestatic

Get the VSS data for the FIB index.

Definition at line 254 of file dhcp_proxy.h.

+ 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 809 of file dhcp4_proxy_node.c.

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

◆ dhcp_proxy_dump()

void dhcp_proxy_dump ( fib_protocol_t  proto,
void *  opaque,
u32  context 
)

Dump the proxy configs to the API.

Definition at line 248 of file dhcp_proxy.c.

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

◆ dhcp_proxy_lock()

void dhcp_proxy_lock ( dhcp_proxy_t server)

Lock a proxy object to prevent simultaneous access of its pending store.

◆ dhcp_proxy_rx_table_get_table_id()

u32 dhcp_proxy_rx_table_get_table_id ( fib_protocol_t  proto,
u32  fib_index 
)

Definition at line 46 of file dhcp_proxy.c.

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

◆ dhcp_proxy_server_add()

int dhcp_proxy_server_add ( fib_protocol_t  proto,
ip46_address_t *  addr,
ip46_address_t *  src_address,
u32  rx_fib_iindex,
u32  server_table_id 
)

Add a new DHCP proxy server configuration.

Returns
1 is the config is new, 0 otherwise (implying a modify of an existing)

Definition at line 184 of file dhcp_proxy.c.

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

◆ dhcp_proxy_server_del()

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.

Returns
1 if the proxy is deleted, 0 otherwise

Definition at line 144 of file dhcp_proxy.c.

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

◆ dhcp_proxy_set_vss()

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.

Definition at line 309 of file dhcp_proxy.c.

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

◆ dhcp_proxy_unlock()

void dhcp_proxy_unlock ( dhcp_proxy_t server)

Lock a proxy object to prevent simultaneous access of its pending store.

◆ dhcp_proxy_walk()

void dhcp_proxy_walk ( fib_protocol_t  proto,
dhcp_proxy_walk_fn_t  fn,
void *  ctx 
)

Walk/Visit each DHCP proxy server.

Definition at line 67 of file dhcp_proxy.c.

+ Here is the caller graph for this function:

◆ dhcp_send_details()

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.

Definition at line 176 of file dhcp_api.c.

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

◆ dhcp_vss_show_walk()

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.

Definition at line 259 of file dhcp_proxy.c.

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

◆ dhcp_vss_walk()

void dhcp_vss_walk ( fib_protocol_t  proto,
dhcp_vss_walk_fn_t  fn,
void *  ctx 
)

Walk/Visit each DHCP proxy VSS.

Definition at line 87 of file dhcp_proxy.c.

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

Variable Documentation

◆ dhcp_proxy_main

dhcp_proxy_main_t dhcp_proxy_main

Shard 4/6 instance of DHCP main.

Definition at line 25 of file dhcp_proxy.c.