ndn-lite
Data Structures | Macros | Typedefs | Functions
Face Table

Face Table. More...

Collaboration diagram for Face Table:

Data Structures

struct  ndn_face_table
 Face Table. More...
 

Macros

#define NDN_FACE_TABLE_RESERVE_SIZE(entry_count)   (sizeof(ndn_face_table_t) + sizeof(ndn_face_intf_t*) * (entry_count))
 The memory reserved for FaceTable. More...
 

Typedefs

typedef struct ndn_face_table ndn_face_table_t
 Face Table. More...
 

Functions

void ndn_facetab_init (void *memory, ndn_table_id_t capacity)
 Initialize FaceTable at specified memory space. More...
 
ndn_table_id_t ndn_facetab_register (ndn_face_table_t *self, ndn_face_intf_t *face)
 Register a face and assign an ID to it. More...
 
void ndn_facetab_unregister (ndn_face_table_t *self, ndn_table_id_t id)
 Unregister a face from FaceTable only. More...
 

Detailed Description

Face Table.

Macro Definition Documentation

◆ NDN_FACE_TABLE_RESERVE_SIZE

#define NDN_FACE_TABLE_RESERVE_SIZE (   entry_count)    (sizeof(ndn_face_table_t) + sizeof(ndn_face_intf_t*) * (entry_count))

The memory reserved for FaceTable.

Parameters
[in]entry_countMaximum number of entries.

Typedef Documentation

◆ ndn_face_table_t

Face Table.

It assigns an unique ID to all faces.

Function Documentation

◆ ndn_facetab_init()

void ndn_facetab_init ( void *  memory,
ndn_table_id_t  capacity 
)

Initialize FaceTable at specified memory space.

Parameters
[in,out]memoryMemory reserved for FaceTable.
[in]capacityMaximum number of entries.

◆ ndn_facetab_register()

ndn_table_id_t ndn_facetab_register ( ndn_face_table_t self,
ndn_face_intf_t face 
)

Register a face and assign an ID to it.

Parameters
[in,out]selfFaceTable.
[in]faceThe face to register.
Returns
The ID for face if succeeded. NDN_INVALID_ID if FaceTable is full.
Precondition
face should be just created. The constructor should call this function.

◆ ndn_facetab_unregister()

void ndn_facetab_unregister ( ndn_face_table_t self,
ndn_table_id_t  id 
)

Unregister a face from FaceTable only.

Parameters
[in,out]selfFaceTable.
[in]faceThe face to unregister.
Precondition
id < self->ndn_face_table_t::capacity