summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj_delegate.h
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-02-20 06:25:02 -0800
committerNeale Ranns <nranns@cisco.com>2018-02-21 08:34:12 +0000
commit76447a740a6989db08dcd0fcbd066b193a875177 (patch)
tree724e1b2fe1e35202c27a2cdd982bf578cd5c5138 /src/vnet/adj/adj_delegate.h
parent8a3e575dfca22500744df76c40de600d8aa61e12 (diff)
Adj Delegates; don't store raw pointers
... you'd think I'd have leanred by now... Change-Id: I65c54feb2ec016baa07ed96c81ab8f60277c3418 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vnet/adj/adj_delegate.h')
-rw-r--r--src/vnet/adj/adj_delegate.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vnet/adj/adj_delegate.h b/src/vnet/adj/adj_delegate.h
index b57900bf595..c47380012f1 100644
--- a/src/vnet/adj/adj_delegate.h
+++ b/src/vnet/adj/adj_delegate.h
@@ -39,11 +39,7 @@ typedef enum adj_delegate_type_t_ {
} adj_delegate_type_t;
/**
- * Adj delegate. This object should be contained within all type specific
- * delegates. i.e. this is the base class to all type specific derived classes.
- * With this model the delegate provider is free to manage the memory of the
- * delegate in the way it chooses. Specifically it can assign them from its own
- * pools and thus, for example, add the delegates to the FIB node graph.
+ * Adj delegate. This object is attached to the adjacency.
*/
typedef struct adj_delegate_t_
{
@@ -56,6 +52,12 @@ typedef struct adj_delegate_t_
* The delagate type
*/
adj_delegate_type_t ad_type;
+
+ /**
+ * The index passed by the provider to identify its delegate instance.
+ * As with all things VPP this is a pool index.
+ */
+ index_t ad_index;
} adj_delegate_t;
/**
@@ -91,13 +93,11 @@ extern void adj_delegate_remove(adj_index_t ai,
*
* @param ai The adjacency to add the delegate to
* @param type The type of delegate being added
- * @param ad The delegate. The provider should allocate memory for this object
- * Typically this is a 'derived' class with the
- * adj_delegate_t struct embedded within.
+ * @param adi The provider's [pool] index of its attached objet
*/
extern int adj_delegate_add(ip_adjacency_t *adj,
adj_delegate_type_t fdt,
- adj_delegate_t *ad);
+ index_t adi);
/**