FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
lldp_input.c File Reference

LLDP packet parsing implementation. More...

+ Include dependency graph for lldp_input.c:

Go to the source code of this file.

Data Structures

struct  lldp_intf_update_t
 

Macros

#define TLV_VIOLATES_PKT_BOUNDARY(pkt, tlv)
 
#define F(num, type, str)
 

Functions

static void lldp_rpc_update_peer_cb (const lldp_intf_update_t *a)
 
static void lldp_rpc_update_peer (u32 hw_if_index, const u8 *chid, u8 chid_len, u8 chid_subtype, const u8 *portid, u8 portid_len, u8 portid_subtype, u16 ttl)
 
lldp_tlv_code_t lldp_tlv_get_code (const lldp_tlv_t *tlv)
 
void lldp_tlv_set_code (lldp_tlv_t *tlv, lldp_tlv_code_t code)
 
u16 lldp_tlv_get_length (const lldp_tlv_t *tlv)
 
void lldp_tlv_set_length (lldp_tlv_t *tlv, u16 length)
 
static int lldp_packet_scan (u32 hw_if_index, const lldp_tlv_t *pkt)
 
lldp_intf_tlldp_get_intf (lldp_main_t *lm, u32 hw_if_index)
 
lldp_intf_tlldp_create_intf (lldp_main_t *lm, u32 hw_if_index)
 
lldp_error_t lldp_input (vlib_main_t *vm, vlib_buffer_t *b0, u32 bi0)
 
static clib_error_tlldp_init (vlib_main_t *vm)
 

Variables

lldp_main_t lldp_main
 

Detailed Description

LLDP packet parsing implementation.

Definition in file lldp_input.c.

Macro Definition Documentation

◆ F

#define F (   num,
  type,
  str 
)
Value:
/* ignore optional TLV */ \
break;
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define LLDP_TLV_NAME(t)
Definition: lldp_protocol.h:44

◆ TLV_VIOLATES_PKT_BOUNDARY

#define TLV_VIOLATES_PKT_BOUNDARY (   pkt,
  tlv 
)
Value:
(((((u8 *)tlv) + sizeof (lldp_tlv_t)) > ((u8 *)pkt + vec_len (pkt))) || \
((((u8 *)tlv) + lldp_tlv_get_length (tlv)) > ((u8 *)pkt + vec_len (pkt))))
unsigned char u8
Definition: types.h:56
u16 lldp_tlv_get_length(const lldp_tlv_t *tlv)
Definition: lldp_input.c:98
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)

Function Documentation

◆ lldp_create_intf()

lldp_intf_t* lldp_create_intf ( lldp_main_t lm,
u32  hw_if_index 
)

Definition at line 224 of file lldp_input.c.

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

◆ lldp_get_intf()

lldp_intf_t* lldp_get_intf ( lldp_main_t lm,
u32  hw_if_index 
)

Definition at line 212 of file lldp_input.c.

+ Here is the caller graph for this function:

◆ lldp_init()

static clib_error_t* lldp_init ( vlib_main_t vm)
static

Definition at line 278 of file lldp_input.c.

+ Here is the call graph for this function:

◆ lldp_input()

lldp_error_t lldp_input ( vlib_main_t vm,
vlib_buffer_t b0,
u32  bi0 
)

Definition at line 249 of file lldp_input.c.

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

◆ lldp_packet_scan()

static int lldp_packet_scan ( u32  hw_if_index,
const lldp_tlv_t *  pkt 
)
static

Definition at line 120 of file lldp_input.c.

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

◆ lldp_rpc_update_peer()

static void lldp_rpc_update_peer ( u32  hw_if_index,
const u8 chid,
u8  chid_len,
u8  chid_subtype,
const u8 portid,
u8  portid_len,
u8  portid_subtype,
u16  ttl 
)
static

Definition at line 66 of file lldp_input.c.

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

◆ lldp_rpc_update_peer_cb()

static void lldp_rpc_update_peer_cb ( const lldp_intf_update_t a)
static

Definition at line 36 of file lldp_input.c.

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

◆ lldp_tlv_get_code()

lldp_tlv_code_t lldp_tlv_get_code ( const lldp_tlv_t *  tlv)

Definition at line 86 of file lldp_input.c.

+ Here is the caller graph for this function:

◆ lldp_tlv_get_length()

u16 lldp_tlv_get_length ( const lldp_tlv_t *  tlv)

Definition at line 98 of file lldp_input.c.

+ Here is the caller graph for this function:

◆ lldp_tlv_set_code()

void lldp_tlv_set_code ( lldp_tlv_t *  tlv,
lldp_tlv_code_t  code 
)

Definition at line 92 of file lldp_input.c.

+ Here is the caller graph for this function:

◆ lldp_tlv_set_length()

void lldp_tlv_set_length ( lldp_tlv_t *  tlv,
u16  length 
)

Definition at line 104 of file lldp_input.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ lldp_main

lldp_main_t lldp_main

Definition at line 117 of file lldp_input.c.