9 #ifndef FORWARDER_FACE_H_ 10 #define FORWARDER_FACE_H_ 15 #include "../ndn-enums.h" 16 #include "../ndn-constants.h" 18 #define container_of(ptr, type, member) \ 19 ((type *)((char *)(1 ? (ptr) : &((type *)0)->member) - offsetof(type, member))) 42 const uint8_t* packet, uint32_t size);
111 return self->up(
self);
126 return self->send(
self, packet, size);
136 return self->down(
self);
156 #endif // #define FORWARDER_FACE_H_ int(* ndn_face_intf_down)(struct ndn_face_intf *self)
Shutdown the face temporarily.
Definition: face.h:47
static void ndn_face_destroy(ndn_face_intf_t *self)
Destructor.
Definition: face.h:145
uint8_t state
The state of the face.
Definition: face.h:93
void(* ndn_face_intf_destroy)(struct ndn_face_intf *self)
Destructor.
Definition: face.h:52
ndn_table_id_t face_id
Unique Face ID.
Definition: face.h:86
struct ndn_face_intf ndn_face_intf_t
Abstract NDN network face.
ndn_face_intf_send send
Send out a packet.
Definition: face.h:71
ndn_face_intf_destroy destroy
Destructor.
Definition: face.h:81
ndn_face_intf_up up
Turn on the face.
Definition: face.h:66
uint8_t type
The type of the face, reserved.
Definition: face.h:100
static int ndn_face_send(ndn_face_intf_t *self, const uint8_t *packet, uint32_t size)
Send out a packet.
Definition: face.h:122
static int ndn_face_up(ndn_face_intf_t *self)
Turn on the face.
Definition: face.h:108
ndn_face_intf_down down
Shutdown the face temporarily.
Definition: face.h:76
int(* ndn_face_intf_send)(struct ndn_face_intf *self, const uint8_t *packet, uint32_t size)
Send out a packet.
Definition: face.h:41
uint16_t ndn_table_id_t
Definition: ndn-constants.h:39
int(* ndn_face_intf_up)(struct ndn_face_intf *self)
Turn on the face.
Definition: face.h:36
Definition: ndn-enums.h:15
Abstract NDN network face.
Definition: face.h:62
static int ndn_face_down(ndn_face_intf_t *self)
Shutdown the face temporarily.
Definition: face.h:134