FD.io VPP  v20.05-21-gb1500e9ff
Vector Packet Processing
vrrp_packet.c File Reference
+ Include dependency graph for vrrp_packet.c:

Go to the source code of this file.

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 }
 
#define IGMP4_MCAST_ADDR_AS_U8   { 224, 0, 0, 22 }
 

Functions

static int vrrp_adv_l2_build_multicast (vrrp_vr_t *vr, vlib_buffer_t *b)
 
static u16 vrrp_adv_payload_len (vrrp_vr_t *vr)
 
static int vrrp_adv_l3_build (vrrp_vr_t *vr, vlib_buffer_t *b, const ip46_address_t *dst)
 
u16 vrrp_adv_csum (void *l3_hdr, void *payload, u8 is_ipv6, u16 len)
 
static int vrrp_adv_payload_build (vrrp_vr_t *vr, vlib_buffer_t *b, int shutdown)
 
static_always_inline u32 vrrp_adv_next_node (vrrp_vr_t *vr)
 
static_always_inline const ip46_address_t * vrrp_adv_mcast_addr (vrrp_vr_t *vr)
 
int vrrp_adv_send (vrrp_vr_t *vr, int shutdown)
 
static void vrrp6_na_pkt_build (vrrp_vr_t *vr, vlib_buffer_t *b, ip6_address_t *addr6)
 
static void vrrp4_garp_pkt_build (vrrp_vr_t *vr, vlib_buffer_t *b, ip4_address_t *ip4)
 
int vrrp_garp_or_na_send (vrrp_vr_t *vr)
 
static void vrrp_igmp_pkt_build (vrrp_vr_t *vr, vlib_buffer_t *b)
 
typedef CLIB_PACKED (struct { ip6_hop_by_hop_ext_t ext_hdr;ip6_router_alert_option_t alert;ip6_padN_option_t pad;icmp46_header_t icmp;u16 rsvd;u16 num_addr_records;icmp6_multicast_address_record_t records[0];})
 
int vrrp_vr_multicast_group_join (vrrp_vr_t *vr)
 

Variables

static const u8 vrrp4_dst_mac [6] = { 0x1, 0x0, 0x5e, 0x0, 0x0, 0x12 }
 
static const u8 vrrp6_dst_mac [6] = { 0x33, 0x33, 0x0, 0x0, 0x0, 0x12 }
 
static const u8 vrrp_src_mac_prefix [4] = { 0x0, 0x0, 0x5e, 0x0 }
 
static const ip46_address_t vrrp4_mcast_addr
 
static const ip46_address_t vrrp6_mcast_addr
 
const mac_address_t broadcast_mac
 
static const ip4_header_t igmp_ip4_mcast
 

Macro Definition Documentation

◆ IGMP4_MCAST_ADDR_AS_U8

#define IGMP4_MCAST_ADDR_AS_U8   { 224, 0, 0, 22 }

Definition at line 524 of file vrrp_packet.c.

◆ VRRP4_MCAST_ADDR_AS_U8

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

Definition at line 76 of file vrrp_packet.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 77 of file vrrp_packet.c.

Function Documentation

◆ CLIB_PACKED()

typedef CLIB_PACKED ( struct { ip6_hop_by_hop_ext_t ext_hdr;ip6_router_alert_option_t alert;ip6_padN_option_t pad;icmp46_header_t icmp;u16 rsvd;u16 num_addr_records;icmp6_multicast_address_record_t records[0];}  )

Definition at line 590 of file vrrp_packet.c.

+ Here is the call graph for this function:

◆ vrrp4_garp_pkt_build()

static void vrrp4_garp_pkt_build ( vrrp_vr_t vr,
vlib_buffer_t b,
ip4_address_t ip4 
)
static

Definition at line 422 of file vrrp_packet.c.

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

◆ vrrp6_na_pkt_build()

static void vrrp6_na_pkt_build ( vrrp_vr_t vr,
vlib_buffer_t b,
ip6_address_t *  addr6 
)
static

Definition at line 347 of file vrrp_packet.c.

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

◆ vrrp_adv_csum()

u16 vrrp_adv_csum ( void *  l3_hdr,
void *  payload,
u8  is_ipv6,
u16  len 
)

Definition at line 143 of file vrrp_packet.c.

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

◆ vrrp_adv_l2_build_multicast()

static int vrrp_adv_l2_build_multicast ( vrrp_vr_t vr,
vlib_buffer_t b 
)
static

Definition at line 31 of file vrrp_packet.c.

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

◆ vrrp_adv_l3_build()

static int vrrp_adv_l3_build ( vrrp_vr_t vr,
vlib_buffer_t b,
const ip46_address_t *  dst 
)
static

Definition at line 98 of file vrrp_packet.c.

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

◆ vrrp_adv_mcast_addr()

static_always_inline const ip46_address_t* vrrp_adv_mcast_addr ( vrrp_vr_t vr)

Definition at line 263 of file vrrp_packet.c.

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

◆ vrrp_adv_next_node()

static_always_inline u32 vrrp_adv_next_node ( vrrp_vr_t vr)

Definition at line 245 of file vrrp_packet.c.

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

◆ vrrp_adv_payload_build()

static int vrrp_adv_payload_build ( vrrp_vr_t vr,
vlib_buffer_t b,
int  shutdown 
)
static

Definition at line 185 of file vrrp_packet.c.

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

◆ vrrp_adv_payload_len()

static u16 vrrp_adv_payload_len ( vrrp_vr_t vr)
inlinestatic

Definition at line 90 of file vrrp_packet.c.

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

◆ vrrp_adv_send()

int vrrp_adv_send ( vrrp_vr_t vr,
int  shutdown 
)

Definition at line 272 of file vrrp_packet.c.

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

◆ vrrp_garp_or_na_send()

int vrrp_garp_or_na_send ( vrrp_vr_t vr)

Definition at line 459 of file vrrp_packet.c.

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

◆ vrrp_igmp_pkt_build()

static void vrrp_igmp_pkt_build ( vrrp_vr_t vr,
vlib_buffer_t b 
)
static

Definition at line 535 of file vrrp_packet.c.

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

◆ vrrp_vr_multicast_group_join()

int vrrp_vr_multicast_group_join ( vrrp_vr_t vr)

Definition at line 682 of file vrrp_packet.c.

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

Variable Documentation

◆ broadcast_mac

const mac_address_t broadcast_mac
Initial value:
= {
.bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,},
}

Definition at line 417 of file vrrp_packet.c.

◆ igmp_ip4_mcast

const ip4_header_t igmp_ip4_mcast
static
Initial value:
= {
.ip_version_and_header_length = 0x46,
.ttl = 1,
.protocol = IP_PROTOCOL_IGMP,
.tos = 0xc0,
.dst_address = {.as_u8 = IGMP4_MCAST_ADDR_AS_U8,},
}
#define IGMP4_MCAST_ADDR_AS_U8
Definition: vrrp_packet.c:524

Definition at line 526 of file vrrp_packet.c.

◆ vrrp4_dst_mac

const u8 vrrp4_dst_mac[6] = { 0x1, 0x0, 0x5e, 0x0, 0x0, 0x12 }
static

Definition at line 26 of file vrrp_packet.c.

◆ vrrp4_mcast_addr

const ip46_address_t vrrp4_mcast_addr
static
Initial value:
= {
.ip4 = {.as_u8 = VRRP4_MCAST_ADDR_AS_U8,},
}
#define VRRP4_MCAST_ADDR_AS_U8
Definition: vrrp_packet.c:76

Definition at line 80 of file vrrp_packet.c.

◆ vrrp6_dst_mac

const u8 vrrp6_dst_mac[6] = { 0x33, 0x33, 0x0, 0x0, 0x0, 0x12 }
static

Definition at line 27 of file vrrp_packet.c.

◆ vrrp6_mcast_addr

const ip46_address_t vrrp6_mcast_addr
static
Initial value:
= {
.ip6 = {.as_u8 = VRRP6_MCAST_ADDR_AS_U8,},
}
#define VRRP6_MCAST_ADDR_AS_U8
Definition: vrrp_packet.c:77

Definition at line 84 of file vrrp_packet.c.

◆ vrrp_src_mac_prefix

const u8 vrrp_src_mac_prefix[4] = { 0x0, 0x0, 0x5e, 0x0 }
static

Definition at line 28 of file vrrp_packet.c.