diff options
author | Pierre Pfister <ppfister@cisco.com> | 2016-08-04 14:25:01 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-08-11 14:55:35 +0000 |
commit | 5bcb3391f9eee85b4edcc0e42649ffeeea2dd997 (patch) | |
tree | 8827b22ede9033749e148be332a669ca635b9748 /vnet | |
parent | 041eacc81656d2ed5bc01b96b15a7d03a1700f13 (diff) |
Custom adjacency formatting fix (Revived)
Looks like something strange is going on with indentation.
Change-Id: I8e734a2119a4a744d7ce76ce83ecc7b237828d3b
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r-- | vnet/vnet/ip/lookup.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/vnet/vnet/ip/lookup.h b/vnet/vnet/ip/lookup.h index 808f78df807..2b682d27195 100644 --- a/vnet/vnet/ip/lookup.h +++ b/vnet/vnet/ip/lookup.h @@ -365,16 +365,31 @@ typedef struct { u32 * config_index_by_sw_if_index; } ip_config_main_t; -//Function type used to register formatting of a custom adjacency formatting -typedef u8 *(* ip_adjacency_format_fn)(u8 * s, - struct ip_lookup_main_t * lm, - ip_adjacency_t *adj); - +/** + * This structure is used to dynamically register a custom adjacency + * for ip lookup. + * Typically used with + * VNET_IP4_REGISTER_ADJACENCY or + * VNET_IP6_REGISTER_ADJACENCY macros. + */ typedef struct ip_adj_register_struct { + /** Name of the node for this registered adjacency. */ + char *node_name; + + /** Formatting function for the adjacency. + * Variadic arguments given to the function are: + * - struct ip_lookup_main_t * + * - ip_adjacency_t *adj + */ + format_function_t *fn; + + /** + * When the adjacency is registered, the ip-lookup next index will + * be written where this pointer points. + */ + u32 *next_index; + struct ip_adj_register_struct *next; - char *node_name; //Name of the node for this registered adjacency - ip_adjacency_format_fn fn; //Formatting function of this adjacency - u32 *next_index; //some place where the next index to be used will be put at init } ip_adj_register_t; typedef struct ip_lookup_main_t { |