FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
adj_delegate.h File Reference
+ Include dependency graph for adj_delegate.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  adj_delegate_t_
 Adj delegate. More...
 
struct  adj_delegate_vft_t_
 An ADJ delegate virtual function table. More...
 

Macros

#define ADJ_DELEGATE_LAST   (ADJ_DELEGATE_MIDCHAIN)
 

Typedefs

typedef 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 functionality through the composition of, and delgation to, other objects. More...
 
typedef struct adj_delegate_t_ adj_delegate_t
 Adj delegate. More...
 
typedef void(* adj_delegate_adj_deleted_t) (adj_delegate_t *aed)
 Indication that the adjacency has been deleted. More...
 
typedef u8 *(* adj_delegate_format_t) (const adj_delegate_t *aed, u8 *s)
 Format function for the delegate. More...
 
typedef void(* adj_delegate_adj_created_t) (adj_index_t ai)
 Notification that an adjacency has been created. More...
 
typedef void(* adj_delegate_adj_modified_t) (adj_delegate_t *aed)
 Indication that the adjacency has been modified. More...
 
typedef struct adj_delegate_vft_t_ adj_delegate_vft_t
 An ADJ delegate virtual function table. More...
 

Enumerations

enum  adj_delegate_type_t_ { ADJ_DELEGATE_BFD, ADJ_DELEGATE_MIDCHAIN }
 A Delagate is a means to implement the Delagation design pattern; the extension of an object's functionality through the composition of, and delgation to, other objects. More...
 

Functions

void adj_delegate_remove (adj_index_t ai, adj_delegate_type_t type)
 Remove a delegate from an adjacency. More...
 
int adj_delegate_add (ip_adjacency_t *adj, adj_delegate_type_t fdt, index_t adi)
 Add a delegate to an adjacency. More...
 
adj_delegate_tadj_delegate_get (const ip_adjacency_t *adj, adj_delegate_type_t type)
 Get a delegate from an adjacency. More...
 
void adj_delegate_register_type (adj_delegate_type_t type, const adj_delegate_vft_t *vft)
 Register a VFT for one of the built-in types. More...
 
adj_delegate_type_t adj_delegate_register_new_type (const adj_delegate_vft_t *vft)
 create a new delegate type and register a new VFT More...
 

Macro Definition Documentation

◆ ADJ_DELEGATE_LAST

#define ADJ_DELEGATE_LAST   (ADJ_DELEGATE_MIDCHAIN)

Definition at line 45 of file adj_delegate.h.

Typedef Documentation

◆ adj_delegate_adj_created_t

typedef void(* adj_delegate_adj_created_t) (adj_index_t ai)

Notification that an adjacency has been created.

Definition at line 83 of file adj_delegate.h.

◆ adj_delegate_adj_deleted_t

typedef void(* adj_delegate_adj_deleted_t) (adj_delegate_t *aed)

Indication that the adjacency has been deleted.

The delegate provider should free the delegate.

Definition at line 73 of file adj_delegate.h.

◆ adj_delegate_adj_modified_t

typedef void(* adj_delegate_adj_modified_t) (adj_delegate_t *aed)

Indication that the adjacency has been modified.

the delegate.

Definition at line 89 of file adj_delegate.h.

◆ adj_delegate_format_t

typedef u8*(* adj_delegate_format_t) (const adj_delegate_t *aed, u8 *s)

Format function for the delegate.

Definition at line 78 of file adj_delegate.h.

◆ adj_delegate_t

Adj delegate.

This object is attached to the adjacency.

◆ adj_delegate_type_t

A Delagate is a means to implement the Delagation design pattern; the extension of an object's functionality through the composition of, and delgation to, other objects.

These 'other' objects are delegates. Delagates are thus attached to ADJ objects to extend their functionality. Built-in delegate types. When adding new types, if your code is within the vnet subsystem, then add a new type here. If not then use the adj_delegate_register_new_type API to register a new type.

◆ adj_delegate_vft_t

An ADJ delegate virtual function table.

Enumeration Type Documentation

◆ adj_delegate_type_t_

A Delagate is a means to implement the Delagation design pattern; the extension of an object's functionality through the composition of, and delgation to, other objects.

These 'other' objects are delegates. Delagates are thus attached to ADJ objects to extend their functionality. Built-in delegate types. When adding new types, if your code is within the vnet subsystem, then add a new type here. If not then use the adj_delegate_register_new_type API to register a new type.

Enumerator
ADJ_DELEGATE_BFD 

BFD session state.

ADJ_DELEGATE_MIDCHAIN 

Stacking of a midchain's nexthop.

Definition at line 34 of file adj_delegate.h.

Function Documentation

◆ adj_delegate_add()

int adj_delegate_add ( ip_adjacency_t adj,
adj_delegate_type_t  fdt,
index_t  adi 
)

Add a delegate to an adjacency.

Parameters
aiThe adjacency to add the delegate to
typeThe type of delegate being added
adiThe provider's [pool] index of its attached objet

Definition at line 107 of file adj_delegate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_delegate_get()

adj_delegate_t* adj_delegate_get ( const ip_adjacency_t adj,
adj_delegate_type_t  type 
)

Get a delegate from an adjacency.

Parameters
aiThe adjacency to get the delegate from
typeThe type of delegate being sought

Definition at line 58 of file adj_delegate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adj_delegate_register_new_type()

adj_delegate_type_t adj_delegate_register_new_type ( const adj_delegate_vft_t vft)

create a new delegate type and register a new VFT

create a new delegate type and register a new VFT

Register the function table for a new type

Definition at line 218 of file adj_delegate.c.

+ Here is the caller graph for this function:

◆ adj_delegate_register_type()

void adj_delegate_register_type ( adj_delegate_type_t  type,
const adj_delegate_vft_t vft 
)

Register a VFT for one of the built-in types.

Register a VFT for one of the built-in types.

Register the function table for a given type

Definition at line 199 of file adj_delegate.c.

+ Here is the caller graph for this function:

◆ adj_delegate_remove()

void adj_delegate_remove ( adj_index_t  ai,
adj_delegate_type_t  type 
)

Remove a delegate from an adjacency.

Parameters
aiThe adjacency to remove the delegate from
typeThe type of delegate being removed

Definition at line 65 of file adj_delegate.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: