ndn-lite
Data Structures | Typedefs | Functions

Abstract NDN network face. More...

Collaboration diagram for Face:

Data Structures

struct  ndn_face_intf
 Abstract NDN network face. More...
 

Typedefs

typedef int(* ndn_face_intf_up) (struct ndn_face_intf *self)
 Turn on the face. More...
 
typedef int(* ndn_face_intf_send) (struct ndn_face_intf *self, const uint8_t *packet, uint32_t size)
 Send out a packet. More...
 
typedef int(* ndn_face_intf_down) (struct ndn_face_intf *self)
 Shutdown the face temporarily. More...
 
typedef void(* ndn_face_intf_destroy) (struct ndn_face_intf *self)
 Destructor. More...
 
typedef struct ndn_face_intf ndn_face_intf_t
 Abstract NDN network face. More...
 

Functions

static int ndn_face_up (ndn_face_intf_t *self)
 Turn on the face. More...
 
static int ndn_face_send (ndn_face_intf_t *self, const uint8_t *packet, uint32_t size)
 Send out a packet. More...
 
static int ndn_face_down (ndn_face_intf_t *self)
 Shutdown the face temporarily. More...
 
static void ndn_face_destroy (ndn_face_intf_t *self)
 Destructor. More...
 

Detailed Description

Abstract NDN network face.

Typedef Documentation

◆ ndn_face_intf_destroy

typedef void(* ndn_face_intf_destroy) (struct ndn_face_intf *self)

Destructor.

See also
ndn_face_destroy

◆ ndn_face_intf_down

typedef int(* ndn_face_intf_down) (struct ndn_face_intf *self)

Shutdown the face temporarily.

See also
ndn_face_down

◆ ndn_face_intf_send

typedef int(* ndn_face_intf_send) (struct ndn_face_intf *self, const uint8_t *packet, uint32_t size)

Send out a packet.

See also
ndn_face_send

◆ ndn_face_intf_t

Abstract NDN network face.

An abstract base class for all faces. Derived classes should implement the function ndn_face_intf::up, ndn_face_intf::send, ndn_face_intf::down, and ndn_face_intf::destroy with platform-specific APIs via assigning function pointers in ndn_face_intf.

Attention
ndn_face_intf should always be the first member of any face class.

◆ ndn_face_intf_up

typedef int(* ndn_face_intf_up) (struct ndn_face_intf *self)

Turn on the face.

See also
ndn_face_up

Function Documentation

◆ ndn_face_destroy()

static void ndn_face_destroy ( ndn_face_intf_t self)
inlinestatic

Destructor.

Destroy the face permanently.

Parameters
[in,out]selfThe face to destroy.

◆ ndn_face_down()

static int ndn_face_down ( ndn_face_intf_t self)
inlinestatic

Shutdown the face temporarily.

Parameters
[in,out]selfInput. The interface to turn off.
Returns
NDN_SUCCESS if the call succeeded. The error code otherwise.

◆ ndn_face_send()

static int ndn_face_send ( ndn_face_intf_t self,
const uint8_t *  packet,
uint32_t  size 
)
inlinestatic

Send out a packet.

Parameters
[in,out]selfThe face through which to send.
[in]packetThe encoded packet.
[in]sizeThe size of packet.
Returns
NDN_SUCCESS if the call succeeded. The error code otherwise.

◆ ndn_face_up()

static int ndn_face_up ( ndn_face_intf_t self)
inlinestatic

Turn on the face.

Parameters
[in,out]selfThe face to trun on.
Returns
NDN_SUCCESS if the call succeeded. The error code otherwise.