ndn-lite
face-table.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Xinyu Ma
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v3.0. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #ifndef FORWARDER_FACE_TABLE_H_
10 #define FORWARDER_FACE_TABLE_H_
11 
12 #include "face.h"
13 #include "../ndn-constants.h"
14 
25 typedef struct ndn_face_table{
27 
33 
37 #define NDN_FACE_TABLE_RESERVE_SIZE(entry_count) \
38  (sizeof(ndn_face_table_t) + sizeof(ndn_face_intf_t*) * (entry_count))
39 
44 void
45 ndn_facetab_init(void* memory, ndn_table_id_t capacity);
46 
55 
61 void
63 
66 #endif // FORWARDER_FACE_TABLE_H_
void ndn_facetab_init(void *memory, ndn_table_id_t capacity)
Initialize FaceTable at specified memory space.
Definition: face-table.c:11
ndn_face_intf_t * slots[]
All registered faces.
Definition: face-table.h:31
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.
Definition: face-table.c:20
struct ndn_face_table ndn_face_table_t
Face Table.
void ndn_facetab_unregister(ndn_face_table_t *self, ndn_table_id_t id)
Unregister a face from FaceTable only.
Definition: face-table.c:31
ndn_table_id_t capacity
Definition: face-table.h:26
uint16_t ndn_table_id_t
Definition: ndn-constants.h:39
Face Table.
Definition: face-table.h:25
Abstract NDN network face.
Definition: face.h:62