diff options
Diffstat (limited to 'src/plugins/lldp')
-rw-r--r-- | src/plugins/lldp/lldp.api | 76 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_api.c | 59 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_cli.c | 16 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_doc.md | 86 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_doc.rst | 84 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_input.c | 4 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_node.c | 6 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_protocol.h | 6 | ||||
-rw-r--r-- | src/plugins/lldp/lldp_test.c | 24 |
9 files changed, 230 insertions, 131 deletions
diff --git a/src/plugins/lldp/lldp.api b/src/plugins/lldp/lldp.api index 6be060b0dd1..c5edee7cf39 100644 --- a/src/plugins/lldp/lldp.api +++ b/src/plugins/lldp/lldp.api @@ -56,3 +56,79 @@ autoreply define sw_interface_set_lldp bool enable [default=true]; string port_desc[]; }; + +/** \brief Dump lldp neighbors + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request +*/ +autoendian define lldp_dump +{ + u32 client_index; + u32 context; + u32 cursor; +}; + +autoendian define lldp_dump_reply +{ + u32 context; + i32 retval; + u32 cursor; +}; + +enum port_id_subtype +{ + PORT_ID_SUBTYPE_RESERVED = 0x00, + PORT_ID_SUBTYPE_INTF_ALIAS = 0x01, + PORT_ID_SUBTYPE_PORT_COMP = 0x02, + PORT_ID_SUBTYPE_MAC_ADDR = 0x03, + PORT_ID_SUBTYPE_NET_ADDR = 0x04, + PORT_ID_SUBTYPE_INTF_NAME = 0x05, + PORT_ID_SUBTYPE_AGENT_CIRCUIT_ID = 0x06, + PORT_ID_SUBTYPE_LOCAL = 0x07, +}; + +enum chassis_id_subtype +{ + CHASSIS_ID_SUBTYPE_RESERVED = 0x00, + CHASSIS_ID_SUBTYPE_CHASSIS_COMP = 0x01, + CHASSIS_ID_SUBTYPE_INTF_ALIAS = 0x02, + CHASSIS_ID_SUBTYPE_PORT_COMP = 0x03, + CHASSIS_ID_SUBTYPE_MAC_ADDR = 0x04, + CHASSIS_ID_SUBTYPE_NET_ADDR = 0x05, + CHASSIS_ID_SUBTYPE_INTF_NAME = 0x06, + CHASSIS_ID_SUBTYPE_LOCAL = 0x07, +}; + +/** \brief Details about neighbor + @param context - returned sender context, to match reply w/ request + @param sw_if_index - interface where neighbor was discovered + @param last_heard - last heard time + @param last_sent - last sent time + @param chassis_id - chassis id value + @param chassis_id_len - length for chassis id + @param port_id - port id value + @param port_id_len - length for port id + @param ttl - time to length for the neighbour + @param port_id_subtype - subtype for port_id + @param chassis_id_sybtype - sybtype for chassis_id +*/ +autoendian define lldp_details +{ + u32 context; + vl_api_interface_index_t sw_if_index; + f64 last_heard; + f64 last_sent; + u8 chassis_id[64]; + u8 chassis_id_len; + u8 port_id[64]; + u8 port_id_len; + u16 ttl; + vl_api_port_id_subtype_t port_id_subtype; + vl_api_chassis_id_subtype_t chassis_id_subtype; + option status="in_progress"; +}; + +service { + rpc lldp_dump returns lldp_dump_reply + stream lldp_details; +}; diff --git a/src/plugins/lldp/lldp_api.c b/src/plugins/lldp/lldp_api.c index 69eab6949c4..bb5d1cbb5e8 100644 --- a/src/plugins/lldp/lldp_api.c +++ b/src/plugins/lldp/lldp_api.c @@ -23,6 +23,7 @@ #include <vnet/interface.h> #include <vnet/api_errno.h> #include <lldp/lldp.h> +#include <lldp/lldp_node.h> #include <vnet/ip/ip4_packet.h> #include <vnet/ip/ip6_packet.h> @@ -42,7 +43,7 @@ static u32 lldp_base_msg_id; #include <vlibapi/api_helper_macros.h> static void -vl_api_lldp_config_t_handler (vl_api_lldp_config_t * mp) +vl_api_lldp_config_t_handler (vl_api_lldp_config_t *mp) { vl_api_lldp_config_reply_t *rmp; int rv = 0; @@ -50,8 +51,8 @@ vl_api_lldp_config_t_handler (vl_api_lldp_config_t * mp) sys_name = vl_api_from_api_to_new_vec (mp, &mp->system_name); - if (lldp_cfg_set (&sys_name, ntohl (mp->tx_hold), ntohl (mp->tx_interval)) - != lldp_ok) + if (lldp_cfg_set (&sys_name, ntohl (mp->tx_hold), ntohl (mp->tx_interval)) != + lldp_ok) { vec_free (sys_name); rv = VNET_API_ERROR_INVALID_VALUE; @@ -61,7 +62,7 @@ vl_api_lldp_config_t_handler (vl_api_lldp_config_t * mp) } static void -vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp) +vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t *mp) { vl_api_sw_interface_set_lldp_reply_t *rmp; int rv = 0; @@ -81,7 +82,7 @@ vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp) if (ip4.as_u32 != 0) { vec_validate (mgmt_ip4, sizeof (ip4_address_t) - 1); - clib_memcpy (mgmt_ip4, &ip4, vec_len (mgmt_ip4)); + clib_memcpy (mgmt_ip4, &ip4, sizeof (ip4)); } ip6_address_decode (mp->mgmt_ip6, &ip6); @@ -89,7 +90,7 @@ vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp) if (!ip6_address_is_zero (&ip6)) { vec_validate (mgmt_ip6, sizeof (ip6_address_t) - 1); - clib_memcpy (mgmt_ip6, &ip6, vec_len (mgmt_ip6)); + clib_memcpy (mgmt_ip6, &ip6, sizeof (ip6)); } if (memcmp (mp->mgmt_oid, no_data, strlen ((char *) mp->mgmt_oid)) != 0) @@ -100,7 +101,7 @@ vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp) VALIDATE_SW_IF_INDEX (mp); - if (lldp_cfg_intf_set (ntohl (mp->sw_if_index), (u8 **) & port_desc, + if (lldp_cfg_intf_set (ntohl (mp->sw_if_index), (u8 **) &port_desc, &mgmt_ip4, &mgmt_ip6, &mgmt_oid, mp->enable) != lldp_ok) { @@ -116,6 +117,41 @@ vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp) REPLY_MACRO (VL_API_SW_INTERFACE_SET_LLDP_REPLY); } +static void +send_lldp (u32 index, vl_api_registration_t *rp, u32 context) +{ + vl_api_lldp_details_t *rmp = 0; + vnet_main_t *vnm = &vnet_main; + lldp_main_t *lm = &lldp_main; + const lldp_intf_t *n = vec_elt_at_index (lm->intfs, index); + const vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, n->hw_if_index); + + REPLY_MACRO_DETAILS4_END ( + VL_API_LLDP_DETAILS, rp, context, ({ + rmp->sw_if_index = hw->sw_if_index; + rmp->last_heard = n->last_heard; + rmp->last_sent = n->last_sent; + rmp->ttl = n->ttl; + rmp->port_id_subtype = (vl_api_port_id_subtype_t) n->port_id_subtype; + rmp->chassis_id_subtype = + (vl_api_chassis_id_subtype_t) n->chassis_id_subtype; + rmp->chassis_id_len = vec_len (n->chassis_id); + clib_memcpy (&rmp->chassis_id, n->chassis_id, rmp->chassis_id_len); + rmp->port_id_len = vec_len (n->port_id); + clib_memcpy (&rmp->port_id, n->port_id, rmp->port_id_len); + })); +} + +static void +vl_api_lldp_dump_t_handler (vl_api_lldp_dump_t *mp) +{ + int rv = 0; + lldp_main_t *lm = &lldp_main; + vl_api_lldp_dump_reply_t *rmp; + + REPLY_AND_DETAILS_MACRO_END (VL_API_LLDP_DUMP_REPLY, lm->intfs, + ({ send_lldp (cursor, rp, mp->context); })); +} /* * * lldp_api_hookup @@ -127,7 +163,7 @@ vl_api_sw_interface_set_lldp_t_handler (vl_api_sw_interface_set_lldp_t * mp) #include <lldp/lldp.api.c> static clib_error_t * -lldp_api_hookup (vlib_main_t * vm) +lldp_api_hookup (vlib_main_t *vm) { /* * Set up the (msg_name, crc, message-id) table @@ -142,13 +178,10 @@ VLIB_API_INIT_FUNCTION (lldp_api_hookup); #include <vlib/unix/plugin.h> #include <vpp/app/version.h> -/* *INDENT-OFF* */ VLIB_PLUGIN_REGISTER () = { - .version = VPP_BUILD_VER, - .description = "Link Layer Discovery Protocol (LLDP)", + .version = VPP_BUILD_VER, + .description = "Link Layer Discovery Protocol (LLDP)", }; -/* *INDENT-ON* */ - /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/lldp/lldp_cli.c b/src/plugins/lldp/lldp_cli.c index e77d699393c..1ed3efa4251 100644 --- a/src/plugins/lldp/lldp_cli.c +++ b/src/plugins/lldp/lldp_cli.c @@ -103,7 +103,7 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4, } /* Add MAC address to an interface's filter */ - if (hi->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_MAC_FILTER) + if (hi->caps & VNET_HW_IF_CAP_MAC_FILTER) { error = vnet_hw_interface_add_del_mac_address (lm->vnet_main, @@ -130,7 +130,7 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4, lldp_intf_t *n = lldp_get_intf (lm, hi->sw_if_index); lldp_delete_intf (lm, n); /* Remove MAC address from the interface's filter */ - if ((n) && (hi->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_MAC_FILTER)) + if ((n) && (hi->caps & VNET_HW_IF_CAP_MAC_FILTER)) { error = vnet_hw_interface_add_del_mac_address (lm->vnet_main, @@ -175,13 +175,13 @@ lldp_intf_cmd (vlib_main_t * vm, unformat_input_t * input, if (unformat (input, "mgmt-ip4 %U", unformat_ip4_address, &ip4_addr)) { vec_validate (mgmt_ip4, sizeof (ip4_address_t) - 1); - clib_memcpy (mgmt_ip4, &ip4_addr, vec_len (mgmt_ip4)); + clib_memcpy (mgmt_ip4, &ip4_addr, sizeof (ip4_addr)); } else if (unformat (input, "mgmt-ip6 %U", unformat_ip6_address, &ip6_addr)) { vec_validate (mgmt_ip6, sizeof (ip6_address_t) - 1); - clib_memcpy (mgmt_ip6, &ip6_addr, vec_len (mgmt_ip6)); + clib_memcpy (mgmt_ip6, &ip6_addr, sizeof (ip6_addr)); } else if (unformat (input, "mgmt-oid %s", &mgmt_oid)) ; @@ -298,7 +298,6 @@ out: return ret; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND(set_interface_lldp_cmd, static) = { .path = "set interface lldp", .short_help = "set interface lldp <interface> | sw_if_index <idx>" @@ -313,7 +312,6 @@ VLIB_CLI_COMMAND(set_lldp_cmd, static) = { "[tx-interval <value>]", .function = lldp_cfg_cmd, }; -/* *INDENT-ON* */ static const char * lldp_chassis_id_subtype_str (lldp_chassis_id_subtype_t t) @@ -580,7 +578,6 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm) s = format (s, "\nLLDP-enabled interface table:\n"); f64 now = vlib_time_now (vm); - /* *INDENT-OFF* */ pool_foreach ( n, lm->intfs) { hw = vnet_get_hw_interface(vnm, n->hw_if_index); @@ -640,7 +637,6 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm) now, format_time_ago, n->last_heard, now); } } - /* *INDENT-ON* */ return s; } @@ -663,7 +659,6 @@ format_lldp_intfs (u8 * s, va_list * va) "Peer chassis ID", "Remote port ID", "Last heard", "Last sent", "Status"); - /* *INDENT-OFF* */ pool_foreach ( n, lm->intfs) { const vnet_hw_interface_t *hw = @@ -689,7 +684,6 @@ format_lldp_intfs (u8 * s, va_list * va) format_time_ago, n->last_sent, now, "inactive"); } } - /* *INDENT-ON* */ return s; } @@ -710,13 +704,11 @@ show_lldp (vlib_main_t * vm, unformat_input_t * input, return 0; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND(show_lldp_command, static) = { .path = "show lldp", .short_help = "show lldp [detail]", .function = show_lldp, }; -/* *INDENT-ON* */ /* * packet trace format function, very similar to diff --git a/src/plugins/lldp/lldp_doc.md b/src/plugins/lldp/lldp_doc.md deleted file mode 100644 index 717de898c4e..00000000000 --- a/src/plugins/lldp/lldp_doc.md +++ /dev/null @@ -1,86 +0,0 @@ -# VPP Link Layer Discovery Protocol (LLDP) implementation {#lldp_doc} - -This is a memo intended to contain documentation of the VPP LLDP implementation -Everything that is not directly obvious should come here. - - -## LLDP -LLDP is a link layer protocol to advertise the capabilities and current status of the system. - -There are 2 nodes handling LLDP - -1.) input-node which processes incoming packets and updates the local database -2.) process-node which is responsible for sending out LLDP packets from VPP side - - -### Configuration - -LLDP has a global configuration and a per-interface enable setting. - -Global configuration is modified using the "set lldp" command - -set lldp [system-name <string>] [tx-hold <value>] [tx-interval <value>] - -system-name: the name of the VPP system sent to peers in the system-name TLV -tx-hold: multiplier for tx-interval when setting time-to-live (TTL) value in the LLDP packets (TTL = tx-hold * tx-interval + 1, if TTL > 65535, then TTL = 65535) -tx-interval: time interval between sending out LLDP packets - -Per interface setting is done using the "set interface lldp" command - -set interface lldp <interface> | if_index <idx> [port-desc <string>] [disable] - -interface: the name of the interface for which to enable/disable LLDP -if_index: sw interface index can be used if interface name is not used. -port-desc: port description -disable: LLDP feature can be enabled or disabled per interface. - -### Configuration example - -Configure system-name as "VPP" and transmit interval to 10 seconds: - -set lldp system-name VPP tx-interval 10 - -Enable LLDP on interface TenGigabitEthernet5/0/1 with port description - -set interface lldp TenGigabitEthernet5/0/1 port-desc vtf:eth0 - - -### Operational data - -The list of LLDP-enabled interfaces which are up can be shown using "show lldp" command - -Example: -DBGvpp# show lldp -Local interface Peer chassis ID Remote port ID Last heard Last sent Status -GigabitEthernet2/0/1 never 27.0s ago inactive -TenGigabitEthernet5/0/1 8c:60:4f:dd:ca:52 Eth1/3/3 20.1s ago 18.3s ago active - -All LLDP configuration data with all LLDP-enabled interfaces can be shown using "show lldp detail" command - -Example: -DBGvpp# show lldp detail -LLDP configuration: -Configured system name: vpp -Configured tx-hold: 4 -Configured tx-interval: 30 - -LLDP-enabled interface table: - -Interface name: GigabitEthernet2/0/1 -Interface/peer state: inactive(timeout) -Last known peer chassis ID: -Last known peer port ID: -Last packet sent: 12.4s ago -Last packet received: never - -Interface name: GigabitEthernet2/0/2 -Interface/peer state: interface down -Last packet sent: never - -Interface name: TenGigabitEthernet5/0/1 -Interface/peer state: active -Peer chassis ID: 8c:60:4f:dd:ca:52(MAC address) -Remote port ID: Eth1/3/3(Locally assigned) -Last packet sent: 3.6s ago -Last packet received: 5.5s ago - diff --git a/src/plugins/lldp/lldp_doc.rst b/src/plugins/lldp/lldp_doc.rst new file mode 100644 index 00000000000..a6737985aab --- /dev/null +++ b/src/plugins/lldp/lldp_doc.rst @@ -0,0 +1,84 @@ +LLDP Protocol +============= + +This is a memo intended to contain documentation of the VPP LLDP (Link +Layer Discovery Protocol) implementation Everything that is not directly +obvious should come here. + +LLDP +---- + +LLDP is a link layer protocol to advertise the capabilities and current +status of the system. + +There are 2 nodes handling LLDP + +1.) input-node which processes incoming packets and updates the local +database 2.) process-node which is responsible for sending out LLDP +packets from VPP side + +Configuration +~~~~~~~~~~~~~ + +LLDP has a global configuration and a per-interface enable setting. + +Global configuration is modified using the “set lldp” command + +set lldp [system-name ] [tx-hold ] [tx-interval ] + +system-name: the name of the VPP system sent to peers in the system-name +TLV tx-hold: multiplier for tx-interval when setting time-to-live (TTL) +value in the LLDP packets (TTL = tx-hold \* tx-interval + 1, if TTL > +65535, then TTL = 65535) tx-interval: time interval between sending out +LLDP packets + +Per interface setting is done using the “set interface lldp” command + +set interface lldp \| if_index [port-desc ] [disable] + +interface: the name of the interface for which to enable/disable LLDP +if_index: sw interface index can be used if interface name is not used. +port-desc: port description disable: LLDP feature can be enabled or +disabled per interface. + +Configuration example +~~~~~~~~~~~~~~~~~~~~~ + +Configure system-name as “VPP” and transmit interval to 10 seconds: + +set lldp system-name VPP tx-interval 10 + +Enable LLDP on interface TenGigabitEthernet5/0/1 with port description + +set interface lldp TenGigabitEthernet5/0/1 port-desc vtf:eth0 + +Operational data +~~~~~~~~~~~~~~~~ + +The list of LLDP-enabled interfaces which are up can be shown using +“show lldp” command + +Example: DBGvpp# show lldp Local interface Peer chassis ID Remote port +ID Last heard Last sent Status GigabitEthernet2/0/1 never 27.0s ago +inactive TenGigabitEthernet5/0/1 8c:60:4f:dd:ca:52 Eth1/3/3 20.1s ago +18.3s ago active + +All LLDP configuration data with all LLDP-enabled interfaces can be +shown using “show lldp detail” command + +Example: DBGvpp# show lldp detail LLDP configuration: Configured system +name: vpp Configured tx-hold: 4 Configured tx-interval: 30 + +LLDP-enabled interface table: + +Interface name: GigabitEthernet2/0/1 Interface/peer state: +inactive(timeout) Last known peer chassis ID: Last known peer port ID: +Last packet sent: 12.4s ago Last packet received: never + +Interface name: GigabitEthernet2/0/2 Interface/peer state: interface +down Last packet sent: never + +Interface name: TenGigabitEthernet5/0/1 Interface/peer state: active +Peer chassis ID: 8c:60:4f:dd:ca:52(MAC address) Remote port ID: +Eth1/3/3(Locally assigned) Last packet sent: 3.6s ago Last packet +received: 5.5s ago diff --git a/src/plugins/lldp/lldp_input.c b/src/plugins/lldp/lldp_input.c index 327ef10f9de..b8aa846e385 100644 --- a/src/plugins/lldp/lldp_input.c +++ b/src/plugins/lldp/lldp_input.c @@ -48,13 +48,13 @@ lldp_rpc_update_peer_cb (const lldp_intf_update_t * a) if (n->chassis_id) { - _vec_len (n->chassis_id) = 0; + vec_set_len (n->chassis_id, 0); } vec_add (n->chassis_id, chassis_id, a->chassis_id_len); n->chassis_id_subtype = a->chassis_id_subtype; if (n->port_id) { - _vec_len (n->port_id) = 0; + vec_set_len (n->port_id, 0); } vec_add (n->port_id, portid, a->portid_len); n->port_id_subtype = a->portid_subtype; diff --git a/src/plugins/lldp/lldp_node.c b/src/plugins/lldp/lldp_node.c index dbb54af91f0..dbbb5d46402 100644 --- a/src/plugins/lldp/lldp_node.c +++ b/src/plugins/lldp/lldp_node.c @@ -102,7 +102,6 @@ lldp_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node, /* * lldp input graph node declaration */ -/* *INDENT-OFF* */ VLIB_REGISTER_NODE(lldp_input_node, static) = { .function = lldp_node_fn, .name = "lldp-input", @@ -120,7 +119,6 @@ VLIB_REGISTER_NODE(lldp_input_node, static) = { [LLDP_INPUT_NEXT_NORMAL] = "error-drop", }, }; -/* *INDENT-ON* */ /* * lldp process node function @@ -220,7 +218,7 @@ lldp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) #endif if (event_data) { - _vec_len (event_data) = 0; + vec_set_len (event_data, 0); } } @@ -230,13 +228,11 @@ lldp_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) /* * lldp process node declaration */ -/* *INDENT-OFF* */ VLIB_REGISTER_NODE(lldp_process_node, static) = { .function = lldp_process, .type = VLIB_NODE_TYPE_PROCESS, .name = "lldp-process", }; -/* *INDENT-ON* */ void lldp_schedule_intf (lldp_main_t * lm, lldp_intf_t * n) diff --git a/src/plugins/lldp/lldp_protocol.h b/src/plugins/lldp/lldp_protocol.h index e641b26e20d..c4219162dfe 100644 --- a/src/plugins/lldp/lldp_protocol.h +++ b/src/plugins/lldp/lldp_protocol.h @@ -56,12 +56,10 @@ struct lldp_tlv_head u8 byte2; /* contains the lower bits of length */ }; -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { struct lldp_tlv_head head; u8 v[0]; }) lldp_tlv_t; -/* *INDENT-ON* */ 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); @@ -89,13 +87,11 @@ typedef enum #undef F } lldp_chassis_id_subtype_t; -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { struct lldp_tlv_head head; u8 subtype; u8 id[0]; }) lldp_chassis_id_tlv_t; -/* *INDENT-ON* */ #define foreach_port_id_subtype(F) \ F (0, reserved, "Reserved") \ @@ -118,7 +114,6 @@ typedef enum #undef F } lldp_port_id_subtype_t; -/* *INDENT-OFF* */ typedef CLIB_PACKED (struct { struct lldp_tlv_head head; u8 subtype; @@ -129,7 +124,6 @@ typedef CLIB_PACKED (struct { struct lldp_tlv_head head; u16 ttl; }) lldp_ttl_tlv_t; -/* *INDENT-ON* */ #endif /* __included_lldp_protocol_h__ */ diff --git a/src/plugins/lldp/lldp_test.c b/src/plugins/lldp/lldp_test.c index 661487c7835..ba5ecb20260 100644 --- a/src/plugins/lldp/lldp_test.c +++ b/src/plugins/lldp/lldp_test.c @@ -38,13 +38,11 @@ lldp_test_main_t lldp_test_main; #define __plugin_msg_base lldp_test_main.msg_id_base #include <vlibapi/vat_helper_macros.h> -/* Macro to finish up custom dump fns */ -#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) -#define FINISH \ - vec_add1 (s, 0); \ - vl_print (handle, (char *)s); \ - vec_free (s); \ - return handle; +#define FINISH \ + vec_add1 (s, 0); \ + vlib_cli_output (handle, (char *) s); \ + vec_free (s); \ + return handle; static int api_lldp_config (vat_main_t * vam) @@ -144,4 +142,16 @@ api_sw_interface_set_lldp (vat_main_t * vam) return ret; } +static int +api_lldp_dump (vat_main_t *vam) +{ + return 0; +} + +static void +vl_api_lldp_dump_reply_t_handler (vl_api_lldp_dump_reply_t *mp) +{ + // not yet implemented +} + #include <lldp/lldp.api_test.c> |