86 return (aed1->
ad_type - aed2->ad_type);
115 if (
NULL == delegate)
158 s =
format(s,
"{unknown delegate}");
178 ASSERT(
NULL == ad_vfts[type].adv_adj_deleted);
181 ad_vfts[type] = *vft;
197 ad_vfts[type] = *vft;
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
adj_delegate_type_t ad_type
The delagate type.
static int adj_delegate_cmp_for_sort(void *v1, void *v2)
void adj_delegate_adj_deleted(ip_adjacency_t *adj)
adj_delegate_adj_deleted_t adv_adj_deleted
static adj_delegate_t * adj_delegate_find_i(const ip_adjacency_t *adj, adj_delegate_type_t type, u32 *index)
static adj_delegate_vft_t * ad_vfts
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static adj_delegate_type_t ad_max_id
The value of the last dynamically allocated delegeate value.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
int adj_delegate_add(ip_adjacency_t *adj, adj_delegate_type_t adt, index_t adi)
Add a delegate to an adjacency.
enum adj_delegate_type_t_ adj_delegate_type_t
A Delagate is a means to implement the Delagation design pattern; the extension of an object's functi...
static adj_index_t adj_get_index(ip_adjacency_t *adj)
Get a pointer to an adjacency object from its index.
adj_index_t ad_adj_index
The ADJ entry object to which the delagate is attached.
#define vec_del1(v, i)
Delete the element at index I.
static void adj_delegate_init(ip_adjacency_t *adj, adj_delegate_type_t adt, index_t adi)
u32 adj_index_t
An index for adjacencies.
void adj_delegate_register_type(adj_delegate_type_t type, const adj_delegate_vft_t *vft)
adj_delegate_register_type
adj_delegate_type_t adj_delegate_register_new_type(const adj_delegate_vft_t *vft)
adj_delegate_register_new_type
adj_delegate_t * adj_delegate_get(const ip_adjacency_t *adj, adj_delegate_type_t type)
Get a delegate from an adjacency.
adj_delegate_format_t adv_format
u8 * adj_delegate_format(u8 *s, ip_adjacency_t *adj)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
An ADJ delegate virtual function table.
#define vec_foreach(var, vec)
Vector iterator.
void adj_delegate_remove(adj_index_t ai, adj_delegate_type_t type)
Remove a delegate from an adjacency.
struct adj_delegate_t_ * ia_delegates
more control plane members that do not fit on the first cacheline