X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fcdp%2Fcdp.h;fp=src%2Fvnet%2Fcdp%2Fcdp_node.h;h=32a07825ecbf7bcbadcebb6457da57e1aff8748d;hb=aaacfbc5b15b0653489ad2e80db48151a4375ece;hp=21086c02527f9d1f476025b3f3be4c9afbfa13a5;hpb=fde0929d9362eac5c416f658e1d2031d01a02337;p=vpp.git diff --git a/src/vnet/cdp/cdp_node.h b/src/plugins/cdp/cdp.h similarity index 89% rename from src/vnet/cdp/cdp_node.h rename to src/plugins/cdp/cdp.h index 21086c02527..32a07825ecb 100644 --- a/src/vnet/cdp/cdp_node.h +++ b/src/plugins/cdp/cdp.h @@ -1,5 +1,8 @@ + /* - * Copyright (c) 2011-2016 Cisco and/or its affiliates. + * cdp.h - cdp protocol plug-in + * + * Copyright (c) 2011-2018 by Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -12,8 +15,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef __included_cdp_node_h__ -#define __included_cdp_node_h__ +#ifndef __included_cdp_h__ +#define __included_cdp_h__ #include #include @@ -25,7 +28,7 @@ #include #include -#include +#include "cdp_protocol.h" typedef enum { @@ -78,6 +81,9 @@ typedef struct /* pool of cdp neighbors */ cdp_neighbor_t *neighbors; + /* plugin message id base */ + u16 msg_id_base; + /* tx pcap debug enable */ u8 tx_pcap_debug; @@ -87,6 +93,9 @@ typedef struct /* Background process node index */ u32 cdp_process_node_index; + /* top-level state */ + int enabled; + /* Packet templates for different encap types */ vlib_packet_template_t packet_templates[CDP_N_PACKET_TEMPLATES]; @@ -96,6 +105,7 @@ typedef struct } cdp_main_t; extern cdp_main_t cdp_main; +extern vlib_node_registration_t cdp_process_node; /* Packet counters */ #define foreach_cdp_error \ @@ -123,20 +133,17 @@ typedef struct typedef enum { - CDP_EVENT_SEND_NEIGHBOR, - CDP_EVENT_SEND_KEEPALIVE, + CDP_EVENT_ENABLE, + CDP_EVENT_DISABLE, } cdp_process_event_t; - cdp_error_t cdp_input (vlib_main_t * vm, vlib_buffer_t * b0, u32 bi0); void cdp_periodic (vlib_main_t * vm); void cdp_keepalive (cdp_main_t * cm, cdp_neighbor_t * n); u16 cdp_checksum (void *p, int count); u8 *cdp_input_format_trace (u8 * s, va_list * args); -serialize_function_t serialize_cdp_main, unserialize_cdp_main; - -#endif /* __included_cdp_node_h__ */ +#endif /* __included_cdp_h__ */ /* * fd.io coding-style-patch-verification: ON