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

Go to the source code of this file.

Data Structures

struct  tlv_handler_t
 

Macros

#define DEBUG_TLV_DUMP   0 /* 1=> dump TLV's to stdout while processing them */
 
#define format_unused_tlv   format_generic_tlv
 
#define format_device_name_tlv   format_text_tlv
 
#define format_address_tlv   format_generic_tlv
 
#define format_port_id_tlv   format_text_tlv
 
#define format_capabilities_tlv   format_generic_tlv
 
#define format_version_tlv   format_text_tlv
 
#define format_platform_tlv   format_text_tlv
 
#define format_ipprefix_tlv   format_generic_tlv
 
#define format_hello_tlv   format_generic_tlv
 
#define format_vtp_domain_tlv   format_generic_tlv
 
#define format_native_vlan_tlv   format_generic_tlv
 
#define format_duplex_tlv   format_generic_tlv
 
#define format_appl_vlan_tlv   format_generic_tlv
 
#define format_trigger_tlv   format_generic_tlv
 
#define format_power_tlv   format_generic_tlv
 
#define format_mtu_tlv   format_generic_tlv
 
#define format_trust_tlv   format_generic_tlv
 
#define format_cos_tlv   format_generic_tlv
 
#define format_sysname_tlv   format_generic_tlv
 
#define format_sysobject_tlv   format_generic_tlv
 
#define format_mgmt_addr_tlv   format_generic_tlv
 
#define format_physical_loc_tlv   format_generic_tlv
 
#define format_mgmt_addr2_tlv   format_generic_tlv
 
#define format_power_requested_tlv   format_generic_tlv
 
#define format_power_available_tlv   format_generic_tlv
 
#define format_port_unidirectional_tlv   format_generic_tlv
 
#define format_unknown_28_tlv   format_generic_tlv
 
#define format_energywise_tlv   format_generic_tlv
 
#define format_unknown_30_tlv   format_generic_tlv
 
#define format_spare_poe_tlv   format_generic_tlv
 
#define foreach_text_to_struct_tlv
 
#define process_address_tlv   process_generic_tlv
 
#define process_capabilities_tlv   process_generic_tlv
 
#define process_ipprefix_tlv   process_generic_tlv
 
#define process_hello_tlv   process_generic_tlv
 
#define process_vtp_domain_tlv   process_generic_tlv
 
#define process_native_vlan_tlv   process_generic_tlv
 
#define process_duplex_tlv   process_generic_tlv
 
#define process_appl_vlan_tlv   process_generic_tlv
 
#define process_trigger_tlv   process_generic_tlv
 
#define process_power_tlv   process_generic_tlv
 
#define process_mtu_tlv   process_generic_tlv
 
#define process_trust_tlv   process_generic_tlv
 
#define process_cos_tlv   process_generic_tlv
 
#define process_sysname_tlv   process_generic_tlv
 
#define process_sysobject_tlv   process_generic_tlv
 
#define process_mgmt_addr_tlv   process_generic_tlv
 
#define process_physical_loc_tlv   process_generic_tlv
 
#define process_mgmt_addr2_tlv   process_generic_tlv
 
#define process_power_requested_tlv   process_generic_tlv
 
#define process_power_available_tlv   process_generic_tlv
 
#define process_port_unidirectional_tlv   process_generic_tlv
 
#define process_unknown_28_tlv   process_generic_tlv
 
#define process_energywise_tlv   process_generic_tlv
 
#define process_unknown_30_tlv   process_generic_tlv
 
#define process_spare_poe_tlv   process_generic_tlv
 

Functions

u16 cdp_checksum (void *p, int count)
 
static u8format_generic_tlv (u8 *s, va_list *va)
 
static cdp_error_t process_generic_tlv (cdp_main_t *cm, cdp_neighbor_t *n, cdp_tlv_t *t)
 
static u8format_text_tlv (u8 *s, va_list *va)
 
 CLIB_UNUSED (static cdp_error_t process_text_tlv(cdp_main_t *cm, cdp_neighbor_t *n, cdp_tlv_t *t))
 
static cdp_error_t process_text_tlv (cdp_main_t *cm, cdp_neighbor_t *n, cdp_tlv_t *t)
 
static cdp_error_t process_unused_tlv (cdp_main_t *cm, cdp_neighbor_t *n, cdp_tlv_t *t)
 
 CLIB_UNUSED (static u8 *format_cdp_hdr(u8 *s, va_list *va))
 
static u8format_cdp_hdr (u8 *s, va_list *va)
 
static cdp_error_t process_cdp_hdr (cdp_main_t *cm, cdp_neighbor_t *n, cdp_hdr_t *h)
 
static int cdp_packet_scan (cdp_main_t *cm, cdp_neighbor_t *n)
 
cdp_error_t cdp_input (vlib_main_t *vm, vlib_buffer_t *b0, u32 bi0)
 
static clib_error_tcdp_input_init (vlib_main_t *vm)
 
static u8format_cdp_neighbors (u8 *s, va_list *va)
 
static clib_error_tshow_cdp (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
u8cdp_input_format_trace (u8 *s, va_list *args)
 

Variables

cdp_main_t cdp_main
 
static tlv_handler_t tlv_handlers []
 
static vlib_cli_command_t show_cdp_command
 (constructor) VLIB_CLI_COMMAND (show_cdp_command) More...
 

Macro Definition Documentation

◆ DEBUG_TLV_DUMP

#define DEBUG_TLV_DUMP   0 /* 1=> dump TLV's to stdout while processing them */

Definition at line 19 of file cdp_input.c.

◆ foreach_text_to_struct_tlv

#define foreach_text_to_struct_tlv
Value:
_(device_name,DEBUG_TLV_DUMP) \
_(platform,DEBUG_TLV_DUMP) \
_(port_id,DEBUG_TLV_DUMP)
option version
Definition: sample.api:19
#define DEBUG_TLV_DUMP
Definition: cdp_input.c:19

Definition at line 164 of file cdp_input.c.

◆ format_address_tlv

#define format_address_tlv   format_generic_tlv

Definition at line 127 of file cdp_input.c.

◆ format_appl_vlan_tlv

#define format_appl_vlan_tlv   format_generic_tlv

Definition at line 137 of file cdp_input.c.

◆ format_capabilities_tlv

#define format_capabilities_tlv   format_generic_tlv

Definition at line 129 of file cdp_input.c.

◆ format_cos_tlv

#define format_cos_tlv   format_generic_tlv

Definition at line 142 of file cdp_input.c.

◆ format_device_name_tlv

#define format_device_name_tlv   format_text_tlv

Definition at line 126 of file cdp_input.c.

◆ format_duplex_tlv

#define format_duplex_tlv   format_generic_tlv

Definition at line 136 of file cdp_input.c.

◆ format_energywise_tlv

#define format_energywise_tlv   format_generic_tlv

Definition at line 152 of file cdp_input.c.

◆ format_hello_tlv

#define format_hello_tlv   format_generic_tlv

Definition at line 133 of file cdp_input.c.

◆ format_ipprefix_tlv

#define format_ipprefix_tlv   format_generic_tlv

Definition at line 132 of file cdp_input.c.

◆ format_mgmt_addr2_tlv

#define format_mgmt_addr2_tlv   format_generic_tlv

Definition at line 147 of file cdp_input.c.

◆ format_mgmt_addr_tlv

#define format_mgmt_addr_tlv   format_generic_tlv

Definition at line 145 of file cdp_input.c.

◆ format_mtu_tlv

#define format_mtu_tlv   format_generic_tlv

Definition at line 140 of file cdp_input.c.

◆ format_native_vlan_tlv

#define format_native_vlan_tlv   format_generic_tlv

Definition at line 135 of file cdp_input.c.

◆ format_physical_loc_tlv

#define format_physical_loc_tlv   format_generic_tlv

Definition at line 146 of file cdp_input.c.

◆ format_platform_tlv

#define format_platform_tlv   format_text_tlv

Definition at line 131 of file cdp_input.c.

◆ format_port_id_tlv

#define format_port_id_tlv   format_text_tlv

Definition at line 128 of file cdp_input.c.

◆ format_port_unidirectional_tlv

#define format_port_unidirectional_tlv   format_generic_tlv

Definition at line 150 of file cdp_input.c.

◆ format_power_available_tlv

#define format_power_available_tlv   format_generic_tlv

Definition at line 149 of file cdp_input.c.

◆ format_power_requested_tlv

#define format_power_requested_tlv   format_generic_tlv

Definition at line 148 of file cdp_input.c.

◆ format_power_tlv

#define format_power_tlv   format_generic_tlv

Definition at line 139 of file cdp_input.c.

◆ format_spare_poe_tlv

#define format_spare_poe_tlv   format_generic_tlv

Definition at line 154 of file cdp_input.c.

◆ format_sysname_tlv

#define format_sysname_tlv   format_generic_tlv

Definition at line 143 of file cdp_input.c.

◆ format_sysobject_tlv

#define format_sysobject_tlv   format_generic_tlv

Definition at line 144 of file cdp_input.c.

◆ format_trigger_tlv

#define format_trigger_tlv   format_generic_tlv

Definition at line 138 of file cdp_input.c.

◆ format_trust_tlv

#define format_trust_tlv   format_generic_tlv

Definition at line 141 of file cdp_input.c.

◆ format_unknown_28_tlv

#define format_unknown_28_tlv   format_generic_tlv

Definition at line 151 of file cdp_input.c.

◆ format_unknown_30_tlv

#define format_unknown_30_tlv   format_generic_tlv

Definition at line 153 of file cdp_input.c.

◆ format_unused_tlv

#define format_unused_tlv   format_generic_tlv

Definition at line 125 of file cdp_input.c.

◆ format_version_tlv

#define format_version_tlv   format_text_tlv

Definition at line 130 of file cdp_input.c.

◆ format_vtp_domain_tlv

#define format_vtp_domain_tlv   format_generic_tlv

Definition at line 134 of file cdp_input.c.

◆ process_address_tlv

#define process_address_tlv   process_generic_tlv

Definition at line 192 of file cdp_input.c.

◆ process_appl_vlan_tlv

#define process_appl_vlan_tlv   process_generic_tlv

Definition at line 199 of file cdp_input.c.

◆ process_capabilities_tlv

#define process_capabilities_tlv   process_generic_tlv

Definition at line 193 of file cdp_input.c.

◆ process_cos_tlv

#define process_cos_tlv   process_generic_tlv

Definition at line 204 of file cdp_input.c.

◆ process_duplex_tlv

#define process_duplex_tlv   process_generic_tlv

Definition at line 198 of file cdp_input.c.

◆ process_energywise_tlv

#define process_energywise_tlv   process_generic_tlv

Definition at line 214 of file cdp_input.c.

◆ process_hello_tlv

#define process_hello_tlv   process_generic_tlv

Definition at line 195 of file cdp_input.c.

◆ process_ipprefix_tlv

#define process_ipprefix_tlv   process_generic_tlv

Definition at line 194 of file cdp_input.c.

◆ process_mgmt_addr2_tlv

#define process_mgmt_addr2_tlv   process_generic_tlv

Definition at line 209 of file cdp_input.c.

◆ process_mgmt_addr_tlv

#define process_mgmt_addr_tlv   process_generic_tlv

Definition at line 207 of file cdp_input.c.

◆ process_mtu_tlv

#define process_mtu_tlv   process_generic_tlv

Definition at line 202 of file cdp_input.c.

◆ process_native_vlan_tlv

#define process_native_vlan_tlv   process_generic_tlv

Definition at line 197 of file cdp_input.c.

◆ process_physical_loc_tlv

#define process_physical_loc_tlv   process_generic_tlv

Definition at line 208 of file cdp_input.c.

◆ process_port_unidirectional_tlv

#define process_port_unidirectional_tlv   process_generic_tlv

Definition at line 212 of file cdp_input.c.

◆ process_power_available_tlv

#define process_power_available_tlv   process_generic_tlv

Definition at line 211 of file cdp_input.c.

◆ process_power_requested_tlv

#define process_power_requested_tlv   process_generic_tlv

Definition at line 210 of file cdp_input.c.

◆ process_power_tlv

#define process_power_tlv   process_generic_tlv

Definition at line 201 of file cdp_input.c.

◆ process_spare_poe_tlv

#define process_spare_poe_tlv   process_generic_tlv

Definition at line 216 of file cdp_input.c.

◆ process_sysname_tlv

#define process_sysname_tlv   process_generic_tlv

Definition at line 205 of file cdp_input.c.

◆ process_sysobject_tlv

#define process_sysobject_tlv   process_generic_tlv

Definition at line 206 of file cdp_input.c.

◆ process_trigger_tlv

#define process_trigger_tlv   process_generic_tlv

Definition at line 200 of file cdp_input.c.

◆ process_trust_tlv

#define process_trust_tlv   process_generic_tlv

Definition at line 203 of file cdp_input.c.

◆ process_unknown_28_tlv

#define process_unknown_28_tlv   process_generic_tlv

Definition at line 213 of file cdp_input.c.

◆ process_unknown_30_tlv

#define process_unknown_30_tlv   process_generic_tlv

Definition at line 215 of file cdp_input.c.

◆ process_vtp_domain_tlv

#define process_vtp_domain_tlv   process_generic_tlv

Definition at line 196 of file cdp_input.c.

Function Documentation

◆ cdp_checksum()

u16 cdp_checksum ( void *  p,
int  count 
)

Definition at line 26 of file cdp_input.c.

+ Here is the caller graph for this function:

◆ cdp_input()

cdp_error_t cdp_input ( vlib_main_t vm,
vlib_buffer_t b0,
u32  bi0 
)

Definition at line 323 of file cdp_input.c.

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

◆ cdp_input_format_trace()

u8* cdp_input_format_trace ( u8 s,
va_list *  args 
)

Definition at line 484 of file cdp_input.c.

+ Here is the call graph for this function:

◆ cdp_input_init()

static clib_error_t* cdp_input_init ( vlib_main_t vm)
static

Definition at line 409 of file cdp_input.c.

+ Here is the call graph for this function:

◆ cdp_packet_scan()

static int cdp_packet_scan ( cdp_main_t cm,
cdp_neighbor_t n 
)
static

Definition at line 254 of file cdp_input.c.

+ Here is the call graph for this function:

◆ CLIB_UNUSED() [1/2]

CLIB_UNUSED ( static cdp_error_t   process_text_tlvcdp_main_t *cm, cdp_neighbor_t *n, cdp_tlv_t *t)
+ Here is the caller graph for this function:

◆ CLIB_UNUSED() [2/2]

CLIB_UNUSED ( static u8 format_cdp_hdru8 *s, va_list *va)

◆ format_cdp_hdr()

static u8* format_cdp_hdr ( u8 s,
va_list *  va 
)
static

Definition at line 228 of file cdp_input.c.

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

◆ format_cdp_neighbors()

static u8* format_cdp_neighbors ( u8 s,
va_list *  va 
)
static

Definition at line 429 of file cdp_input.c.

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

◆ format_generic_tlv()

static u8* format_generic_tlv ( u8 s,
va_list *  va 
)
static

Definition at line 65 of file cdp_input.c.

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

◆ format_text_tlv()

static u8* format_text_tlv ( u8 s,
va_list *  va 
)
static

Definition at line 88 of file cdp_input.c.

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

◆ process_cdp_hdr()

static cdp_error_t process_cdp_hdr ( cdp_main_t cm,
cdp_neighbor_t n,
cdp_hdr_t *  h 
)
static

Definition at line 238 of file cdp_input.c.

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

◆ process_generic_tlv()

static cdp_error_t process_generic_tlv ( cdp_main_t cm,
cdp_neighbor_t n,
cdp_tlv_t *  t 
)
static

Definition at line 77 of file cdp_input.c.

+ Here is the call graph for this function:

◆ process_text_tlv()

static cdp_error_t process_text_tlv ( cdp_main_t cm,
cdp_neighbor_t n,
cdp_tlv_t *  t 
)
static

Definition at line 115 of file cdp_input.c.

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

◆ process_unused_tlv()

static cdp_error_t process_unused_tlv ( cdp_main_t cm,
cdp_neighbor_t n,
cdp_tlv_t *  t 
)
static

Definition at line 158 of file cdp_input.c.

◆ show_cdp()

static clib_error_t* show_cdp ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 456 of file cdp_input.c.

+ Here is the call graph for this function:

Variable Documentation

◆ cdp_main

cdp_main_t cdp_main

Definition at line 17 of file cdp_input.c.

◆ show_cdp_command

vlib_cli_command_t show_cdp_command
static
Initial value:
= {
.path = "show cdp",
.short_help = "Show cdp command",
.function = show_cdp,
}
static clib_error_t * show_cdp(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cdp_input.c:456

(constructor) VLIB_CLI_COMMAND (show_cdp_command)

Definition at line 470 of file cdp_input.c.

◆ tlv_handlers

static tlv_handler_t tlv_handlers
static
Initial value:

Definition at line 61 of file cdp_input.c.