FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
lldp_protocol.h File Reference

LLDP protocol declarations. More...

+ Include dependency graph for lldp_protocol.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lldp_tlv_head
 

Macros

#define foreach_lldp_optional_tlv_type(F)
 
#define foreach_lldp_tlv_type(F)
 
#define LLDP_TLV_NAME(t)   LLDP_TLV_##t
 
#define F(n, t, s)   LLDP_TLV_NAME (t) = n,
 
#define foreach_chassis_id_subtype(F)
 
#define LLDP_CHASS_ID_SUBTYPE_NAME(t)   LLDP_CHASS_ID_SUBTYPE_##t
 
#define LLDP_MIN_CHASS_ID_LEN   (1)
 
#define LLDP_MAX_CHASS_ID_LEN   (255)
 
#define F(n, t, s)   LLDP_CHASS_ID_SUBTYPE_NAME (t) = n,
 
#define foreach_port_id_subtype(F)
 
#define LLDP_PORT_ID_SUBTYPE_NAME(t)   LLDP_PORT_ID_SUBTYPE_##t
 
#define LLDP_MIN_PORT_ID_LEN   (1)
 
#define LLDP_MAX_PORT_ID_LEN   (255)
 
#define F(n, t, s)   LLDP_PORT_ID_SUBTYPE_NAME (t) = n,
 

Enumerations

enum  lldp_tlv_code_t { foreach_lldp_tlv_type =(F) }
 
enum  lldp_chassis_id_subtype_t { foreach_chassis_id_subtype =(F) }
 
enum  lldp_port_id_subtype_t { foreach_port_id_subtype =(F) }
 

Functions

typedef CLIB_PACKED (struct { struct lldp_tlv_head head;u8 v[0];}) lldp_tlv_t
 
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)
 
typedef CLIB_PACKED (struct { struct lldp_tlv_head head;u8 subtype;u8 id[0];}) lldp_chassis_id_tlv_t
 
typedef CLIB_PACKED (struct { struct lldp_tlv_head head;u16 ttl;}) lldp_ttl_tlv_t
 

Detailed Description

LLDP protocol declarations.

Definition in file lldp_protocol.h.

Macro Definition Documentation

◆ F [1/3]

#define F (   n,
  t,
 
)    LLDP_TLV_NAME (t) = n,

Definition at line 116 of file lldp_protocol.h.

◆ F [2/3]

#define F (   n,
  t,
 
)    LLDP_CHASS_ID_SUBTYPE_NAME (t) = n,

Definition at line 116 of file lldp_protocol.h.

◆ F [3/3]

#define F (   n,
  t,
 
)    LLDP_PORT_ID_SUBTYPE_NAME (t) = n,

Definition at line 116 of file lldp_protocol.h.

◆ foreach_chassis_id_subtype

#define foreach_chassis_id_subtype (   F)
Value:
F (0, reserved, "Reserved") \
F (1, chassis_comp, "Chassis component") \
F (2, intf_alias, "Interface alias") \
F (3, port_comp, "Port component") \
F (4, mac_addr, "MAC address") \
F (5, net_addr, "Network address") \
F (6, intf_name, "Interface name") \
F (7, local, "Locally assigned")
vl_api_mac_address_t mac_addr
Definition: l2.api:180
#define F(n, t, s)

Definition at line 71 of file lldp_protocol.h.

◆ foreach_lldp_optional_tlv_type

#define foreach_lldp_optional_tlv_type (   F)
Value:
F (4, port_desc, "Port Description") \
F (5, sys_name, "System name") \
F (6, sys_desc, "System Description") \
F (7, sys_caps, "System Capabilities") \
F (8, mgmt_addr, "Management Address") \
F (127, org_spec, "Organizationally Specific TLV")
#define F(n, t, s)

Definition at line 26 of file lldp_protocol.h.

◆ foreach_lldp_tlv_type

#define foreach_lldp_tlv_type (   F)
Value:
F (0, pdu_end, "End of LLDPDU") \
F (1, chassis_id, "Chassis ID") \
F (2, port_id, "Port ID") \
F (3, ttl, "Time To Live") \
foreach_lldp_optional_tlv_type (F)
u8 ttl
Definition: fib_types.api:26
#define F(n, t, s)

Definition at line 37 of file lldp_protocol.h.

◆ foreach_port_id_subtype

#define foreach_port_id_subtype (   F)
Value:
F (0, reserved, "Reserved") \
F (1, intf_alias, "Interface alias") \
F (2, port_comp, "Port component") \
F (3, mac_addr, "MAC address") \
F (4, net_addr, "Network address") \
F (5, intf_name, "Interface name") \
F (6, agent_circuit_id, "Agent circuit ID") \
F (7, local, "Locally assigned")
vl_api_mac_address_t mac_addr
Definition: l2.api:180
#define F(n, t, s)

Definition at line 100 of file lldp_protocol.h.

◆ LLDP_CHASS_ID_SUBTYPE_NAME

#define LLDP_CHASS_ID_SUBTYPE_NAME (   t)    LLDP_CHASS_ID_SUBTYPE_##t

Definition at line 81 of file lldp_protocol.h.

◆ LLDP_MAX_CHASS_ID_LEN

#define LLDP_MAX_CHASS_ID_LEN   (255)

Definition at line 83 of file lldp_protocol.h.

◆ LLDP_MAX_PORT_ID_LEN

#define LLDP_MAX_PORT_ID_LEN   (255)

Definition at line 112 of file lldp_protocol.h.

◆ LLDP_MIN_CHASS_ID_LEN

#define LLDP_MIN_CHASS_ID_LEN   (1)

Definition at line 82 of file lldp_protocol.h.

◆ LLDP_MIN_PORT_ID_LEN

#define LLDP_MIN_PORT_ID_LEN   (1)

Definition at line 111 of file lldp_protocol.h.

◆ LLDP_PORT_ID_SUBTYPE_NAME

#define LLDP_PORT_ID_SUBTYPE_NAME (   t)    LLDP_PORT_ID_SUBTYPE_##t

Definition at line 110 of file lldp_protocol.h.

◆ LLDP_TLV_NAME

#define LLDP_TLV_NAME (   t)    LLDP_TLV_##t

Definition at line 44 of file lldp_protocol.h.

Enumeration Type Documentation

◆ lldp_chassis_id_subtype_t

Enumerator
foreach_chassis_id_subtype 

Definition at line 85 of file lldp_protocol.h.

◆ lldp_port_id_subtype_t

Enumerator
foreach_port_id_subtype 

Definition at line 114 of file lldp_protocol.h.

◆ lldp_tlv_code_t

Enumerator
foreach_lldp_tlv_type 

Definition at line 46 of file lldp_protocol.h.

Function Documentation

◆ CLIB_PACKED() [1/3]

typedef CLIB_PACKED ( struct { struct lldp_tlv_head head;u8 v[0];}  )

◆ CLIB_PACKED() [2/3]

typedef CLIB_PACKED ( struct { struct lldp_tlv_head head;u8 subtype;u8 id[0];}  )

◆ CLIB_PACKED() [3/3]

typedef CLIB_PACKED ( struct { struct lldp_tlv_head head;u16 ttl;}  )

◆ 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: