FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
vrrp.c File Reference
+ Include dependency graph for vrrp.c:

Go to the source code of this file.

Data Structures

struct  vrrp_hwif_vr_count_t
 
struct  vrrp_intf_update_t
 

Macros

#define VRRP4_MCAST_ADDR_AS_U8   { 224, 0, 0, 18 }
 
#define VRRP6_MCAST_ADDR_AS_U8   { 0xff, 0x2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x12 }
 

Enumerations

enum  vrrp_intf_update_type_t { VRRP_IF_UPDATE_IP, VRRP_IF_UPDATE_HW_LINK, VRRP_IF_UPDATE_SW_ADMIN }
 

Functions

static int vrrp_intf_is_up (u32 sw_if_index, u8 is_ipv6, vrrp_intf_update_t *pending)
 
static walk_rc_t vrrp_hwif_master_count_walk (vnet_main_t *vnm, u32 sw_if_index, void *arg)
 
static u32 vrrp_vr_hwif_master_vrs_by_vrid (u32 hw_if_index, u8 vr_id, u8 is_ipv6)
 
void vrrp_vr_transition_vmac (vrrp_vr_t *vr, vrrp_vr_state_t new_state)
 
static void vrrp_vr_transition_intf (vrrp_vr_t *vr, vrrp_vr_state_t new_state)
 
static void vrrp_vr_transition_addrs (vrrp_vr_t *vr, vrrp_vr_state_t new_state)
 
void vrrp_vr_transition (vrrp_vr_t *vr, vrrp_vr_state_t new_state, void *data)
 
static int vrrp_intf_enable_disable_mcast (u8 enable, u32 sw_if_index, u8 is_ipv6)
 
static int vrrp_intf_vr_add_del (u8 is_add, u32 sw_if_index, u32 vr_index, u8 is_ipv6)
 
static int vrrp_vr_valid_addrs_owner (vrrp_vr_config_t *vr_conf)
 
static int vrrp_vr_valid_addrs_unused (vrrp_vr_config_t *vr_conf)
 
static int vrrp_vr_valid_addrs (vrrp_vr_config_t *vr_conf)
 
int vrrp_vr_addr_add_del (vrrp_vr_t *vr, u8 is_add, ip46_address_t *vr_addr)
 
static void vrrp_vr_addrs_add_del (vrrp_vr_t *vr, u8 is_add, ip46_address_t *vr_addrs)
 
int vrrp_vr_add_del (u8 is_add, vrrp_vr_config_t *vr_conf)
 
int vrrp_vr_start_stop (u8 is_start, vrrp_vr_key_t *vr_key)
 
static int vrrp_vr_set_peers_validate (vrrp_vr_t *vr, ip46_address_t *peers)
 
int vrrp_vr_set_peers (vrrp_vr_key_t *vr_key, ip46_address_t *peers)
 
static void vrrp_intf_tracking_vr_add_del (u32 sw_if_index, vrrp_vr_t *vr, u8 is_add)
 
static int vrrp_intf_sw_admin_up (u32 sw_if_index, vrrp_intf_update_t *pending)
 
static int vrrp_intf_hw_link_up (u32 sw_if_index, vrrp_intf_update_t *pending)
 
static int vrrp_intf_ip_up (u32 sw_if_index, u8 is_ipv6, vrrp_intf_update_t *pending)
 
void vrrp_vr_tracking_ifs_compute (vrrp_vr_t *vr, vrrp_intf_update_t *pending)
 
int vrrp_vr_tracking_if_add_del (vrrp_vr_t *vr, u32 sw_if_index, u8 prio, u8 is_add)
 
int vrrp_vr_tracking_ifs_add_del (vrrp_vr_t *vr, vrrp_vr_tracking_if_t *track_ifs, u8 is_add)
 
static void vrrp_intf_tracking_vrs_compute (u32 sw_if_index, vrrp_intf_update_t *pending, u8 is_ipv6)
 
clib_error_tvrrp_sw_interface_up_down (vrrp_intf_update_t *pending)
 
clib_error_tvrrp_sw_interface_admin_up_down (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (vrrp_sw_interface_admin_up_down)
 
static walk_rc_t vrrp_hw_interface_link_up_down_walk (vnet_main_t *vnm, u32 sw_if_index, void *arg)
 
static clib_error_tvrrp_hw_interface_link_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (vrrp_hw_interface_link_up_down)
 
static void vrrp_ip4_add_del_interface_addr (ip4_main_t *im, uword opaque, u32 sw_if_index, ip4_address_t *address, u32 address_length, u32 if_address_index, u32 is_del)
 
static u8format_vrrp_ip6_link (u8 *s, va_list *args)
 
static void vrrp_intf_ip6_enable_disable (u32 sw_if_index, int enable)
 
static void vrrp_intf_ip6_enable (u32 sw_if_index)
 
static void vrrp_intf_ip6_disable (index_t indi)
 
static clib_error_tvrrp_init (vlib_main_t *vm)
 
 VLIB_PLUGIN_REGISTER ()
 

Variables

vrrp_main_t vrrp_main
 
static const mac_address_t ipv4_vmac
 
static const mac_address_t ipv6_vmac
 
static const mfib_prefix_t all_vrrp4_routers
 
static const mfib_prefix_t all_vrrp6_routers
 
static ip6_link_delegate_id_t vrrp_ip6_delegate_id
 
static const ip6_link_delegate_vft_t vrrp_ip6_delegate_vft
 

Macro Definition Documentation

◆ VRRP4_MCAST_ADDR_AS_U8

#define VRRP4_MCAST_ADDR_AS_U8   { 224, 0, 0, 18 }

Definition at line 357 of file vrrp.c.

◆ VRRP6_MCAST_ADDR_AS_U8

#define VRRP6_MCAST_ADDR_AS_U8   { 0xff, 0x2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x12 }

Definition at line 358 of file vrrp.c.

Enumeration Type Documentation

◆ vrrp_intf_update_type_t

Enumerator
VRRP_IF_UPDATE_IP 
VRRP_IF_UPDATE_HW_LINK 
VRRP_IF_UPDATE_SW_ADMIN 

Definition at line 41 of file vrrp.c.

Function Documentation

◆ format_vrrp_ip6_link()

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

Definition at line 1164 of file vrrp.c.

+ Here is the call graph for this function:

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

◆ VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION()

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( vrrp_hw_interface_link_up_down  )
+ Here is the caller graph for this function:

◆ VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION()

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( vrrp_sw_interface_admin_up_down  )
+ Here is the caller graph for this function:

◆ vrrp_hw_interface_link_up_down()

static clib_error_t* vrrp_hw_interface_link_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 1133 of file vrrp.c.

+ Here is the call graph for this function:

◆ vrrp_hw_interface_link_up_down_walk()

static walk_rc_t vrrp_hw_interface_link_up_down_walk ( vnet_main_t vnm,
u32  sw_if_index,
void *  arg 
)
static

Definition at line 1121 of file vrrp.c.

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

◆ vrrp_hwif_master_count_walk()

static walk_rc_t vrrp_hwif_master_count_walk ( vnet_main_t vnm,
u32  sw_if_index,
void *  arg 
)
static

Definition at line 60 of file vrrp.c.

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

◆ vrrp_init()

static clib_error_t* vrrp_init ( vlib_main_t vm)
static

Definition at line 1219 of file vrrp.c.

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

◆ vrrp_intf_enable_disable_mcast()

static int vrrp_intf_enable_disable_mcast ( u8  enable,
u32  sw_if_index,
u8  is_ipv6 
)
static

Definition at line 382 of file vrrp.c.

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

◆ vrrp_intf_hw_link_up()

static int vrrp_intf_hw_link_up ( u32  sw_if_index,
vrrp_intf_update_t pending 
)
static

Definition at line 862 of file vrrp.c.

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

◆ vrrp_intf_ip6_disable()

static void vrrp_intf_ip6_disable ( index_t  indi)
static

Definition at line 1207 of file vrrp.c.

+ Here is the call graph for this function:

◆ vrrp_intf_ip6_enable()

static void vrrp_intf_ip6_enable ( u32  sw_if_index)
static

Definition at line 1200 of file vrrp.c.

+ Here is the call graph for this function:

◆ vrrp_intf_ip6_enable_disable()

static void vrrp_intf_ip6_enable_disable ( u32  sw_if_index,
int  enable 
)
static

Definition at line 1188 of file vrrp.c.

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

◆ vrrp_intf_ip_up()

static int vrrp_intf_ip_up ( u32  sw_if_index,
u8  is_ipv6,
vrrp_intf_update_t pending 
)
static

Definition at line 881 of file vrrp.c.

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

◆ vrrp_intf_is_up()

static int vrrp_intf_is_up ( u32  sw_if_index,
u8  is_ipv6,
vrrp_intf_update_t pending 
)
static

Definition at line 899 of file vrrp.c.

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

◆ vrrp_intf_sw_admin_up()

static int vrrp_intf_sw_admin_up ( u32  sw_if_index,
vrrp_intf_update_t pending 
)
static

Definition at line 847 of file vrrp.c.

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

◆ vrrp_intf_tracking_vr_add_del()

static void vrrp_intf_tracking_vr_add_del ( u32  sw_if_index,
vrrp_vr_t vr,
u8  is_add 
)
static

Definition at line 816 of file vrrp.c.

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

◆ vrrp_intf_tracking_vrs_compute()

static void vrrp_intf_tracking_vrs_compute ( u32  sw_if_index,
vrrp_intf_update_t pending,
u8  is_ipv6 
)
static

Definition at line 1026 of file vrrp.c.

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

◆ vrrp_intf_vr_add_del()

static int vrrp_intf_vr_add_del ( u8  is_add,
u32  sw_if_index,
u32  vr_index,
u8  is_ipv6 
)
static

Definition at line 446 of file vrrp.c.

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

◆ vrrp_ip4_add_del_interface_addr()

static void vrrp_ip4_add_del_interface_addr ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
ip4_address_t address,
u32  address_length,
u32  if_address_index,
u32  is_del 
)
static

Definition at line 1151 of file vrrp.c.

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

◆ vrrp_sw_interface_admin_up_down()

clib_error_t* vrrp_sw_interface_admin_up_down ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)

Definition at line 1106 of file vrrp.c.

+ Here is the call graph for this function:

◆ vrrp_sw_interface_up_down()

clib_error_t* vrrp_sw_interface_up_down ( vrrp_intf_update_t pending)

Definition at line 1048 of file vrrp.c.

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

◆ vrrp_vr_add_del()

int vrrp_vr_add_del ( u8  is_add,
vrrp_vr_config_t vr_conf 
)

Definition at line 608 of file vrrp.c.

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

◆ vrrp_vr_addr_add_del()

int vrrp_vr_addr_add_del ( vrrp_vr_t vr,
u8  is_add,
ip46_address_t *  vr_addr 
)

Definition at line 534 of file vrrp.c.

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

◆ vrrp_vr_addrs_add_del()

static void vrrp_vr_addrs_add_del ( vrrp_vr_t vr,
u8  is_add,
ip46_address_t *  vr_addrs 
)
static

Definition at line 596 of file vrrp.c.

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

◆ vrrp_vr_hwif_master_vrs_by_vrid()

static u32 vrrp_vr_hwif_master_vrs_by_vrid ( u32  hw_if_index,
u8  vr_id,
u8  is_ipv6 
)
static

Definition at line 79 of file vrrp.c.

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

◆ vrrp_vr_set_peers()

int vrrp_vr_set_peers ( vrrp_vr_key_t vr_key,
ip46_address_t *  peers 
)

Definition at line 789 of file vrrp.c.

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

◆ vrrp_vr_set_peers_validate()

static int vrrp_vr_set_peers_validate ( vrrp_vr_t vr,
ip46_address_t *  peers 
)
static

Definition at line 765 of file vrrp.c.

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

◆ vrrp_vr_start_stop()

int vrrp_vr_start_stop ( u8  is_start,
vrrp_vr_key_t vr_key 
)

Definition at line 696 of file vrrp.c.

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

◆ vrrp_vr_tracking_if_add_del()

int vrrp_vr_tracking_if_add_del ( vrrp_vr_t vr,
u32  sw_if_index,
u8  prio,
u8  is_add 
)

Definition at line 941 of file vrrp.c.

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

◆ vrrp_vr_tracking_ifs_add_del()

int vrrp_vr_tracking_ifs_add_del ( vrrp_vr_t vr,
vrrp_vr_tracking_if_t track_ifs,
u8  is_add 
)

Definition at line 984 of file vrrp.c.

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

◆ vrrp_vr_tracking_ifs_compute()

void vrrp_vr_tracking_ifs_compute ( vrrp_vr_t vr,
vrrp_intf_update_t pending 
)

Definition at line 917 of file vrrp.c.

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

◆ vrrp_vr_transition()

void vrrp_vr_transition ( vrrp_vr_t vr,
vrrp_vr_state_t  new_state,
void *  data 
)

Definition at line 282 of file vrrp.c.

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

◆ vrrp_vr_transition_addrs()

static void vrrp_vr_transition_addrs ( vrrp_vr_t vr,
vrrp_vr_state_t  new_state 
)
static

Definition at line 217 of file vrrp.c.

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

◆ vrrp_vr_transition_intf()

static void vrrp_vr_transition_intf ( vrrp_vr_t vr,
vrrp_vr_state_t  new_state 
)
static

Definition at line 139 of file vrrp.c.

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

◆ vrrp_vr_transition_vmac()

void vrrp_vr_transition_vmac ( vrrp_vr_t vr,
vrrp_vr_state_t  new_state 
)

Definition at line 104 of file vrrp.c.

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

◆ vrrp_vr_valid_addrs()

static int vrrp_vr_valid_addrs ( vrrp_vr_config_t vr_conf)
static

Definition at line 518 of file vrrp.c.

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

◆ vrrp_vr_valid_addrs_owner()

static int vrrp_vr_valid_addrs_owner ( vrrp_vr_config_t vr_conf)
static

Definition at line 483 of file vrrp.c.

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

◆ vrrp_vr_valid_addrs_unused()

static int vrrp_vr_valid_addrs_unused ( vrrp_vr_config_t vr_conf)
static

Definition at line 498 of file vrrp.c.

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

Variable Documentation

◆ all_vrrp4_routers

const mfib_prefix_t all_vrrp4_routers
static
Initial value:
= {
.fp_proto = FIB_PROTOCOL_IP4,
.fp_len = 32,
.fp_grp_addr = {
.ip4 = {
},
},
}
#define VRRP4_MCAST_ADDR_AS_U8
Definition: vrrp.c:357

Definition at line 361 of file vrrp.c.

◆ all_vrrp6_routers

const mfib_prefix_t all_vrrp6_routers
static
Initial value:
= {
.fp_proto = FIB_PROTOCOL_IP6,
.fp_len = 128,
.fp_grp_addr = {
.ip6 = {
},
},
}
#define VRRP6_MCAST_ADDR_AS_U8
Definition: vrrp.c:358

Definition at line 371 of file vrrp.c.

◆ ipv4_vmac

const mac_address_t ipv4_vmac
static
Initial value:
= {
.bytes = {0x00, 0x00, 0x5e, 0x00, 0x01, 0x00}
}

Definition at line 27 of file vrrp.c.

◆ ipv6_vmac

const mac_address_t ipv6_vmac
static
Initial value:
= {
.bytes = {0x00, 0x00, 0x5e, 0x00, 0x02, 0x00}
}

Definition at line 31 of file vrrp.c.

◆ vrrp_ip6_delegate_id

ip6_link_delegate_id_t vrrp_ip6_delegate_id
static

Definition at line 1161 of file vrrp.c.

◆ vrrp_ip6_delegate_vft

const ip6_link_delegate_vft_t vrrp_ip6_delegate_vft
static
Initial value:
= {
.ildv_enable = vrrp_intf_ip6_enable,
.ildv_disable = vrrp_intf_ip6_disable,
.ildv_format = format_vrrp_ip6_link,
}
static u8 * format_vrrp_ip6_link(u8 *s, va_list *args)
Definition: vrrp.c:1164
static void vrrp_intf_ip6_disable(index_t indi)
Definition: vrrp.c:1207
static void vrrp_intf_ip6_enable(u32 sw_if_index)
Definition: vrrp.c:1200

Definition at line 1212 of file vrrp.c.

◆ vrrp_main

vrrp_main_t vrrp_main

Definition at line 25 of file vrrp.c.