ndn-lite
Data Structures | Macros | Typedefs | Functions | Variables
forwarder.c File Reference
#include "forwarder.h"
#include "pit.h"
#include "fib.h"
#include "face-table.h"
#include "../ndn-constants.h"
#include "../ndn-error-code.h"
#include "../encode/tlv.h"

Data Structures

struct  ndn_forwarder
 NDN-Lite forwarder. More...
 

Macros

#define NDN_FORWARDER_RESERVE_SIZE(nametree_size, facetab_size, fib_size, pit_size)
 
#define NDN_FORWARDER_DEFAULT_SIZE
 

Typedefs

typedef struct ndn_forwarder ndn_forwarder_t
 NDN-Lite forwarder. More...
 

Functions

static int fwd_on_incoming_interest (uint8_t *interest, size_t length, interest_options_t *options, uint8_t *name, size_t name_len, ndn_table_id_t face_id)
 
static int fwd_on_outgoing_interest (uint8_t *interest, size_t length, uint8_t *name, size_t name_len, ndn_pit_entry_t *entry, ndn_table_id_t face_id)
 
static int fwd_data_pipeline (uint8_t *data, size_t length, uint8_t *name, size_t name_len, ndn_table_id_t face_id)
 
static ndn_bitset_t fwd_multicast (uint8_t *packet, size_t length, ndn_bitset_t out_faces, ndn_table_id_t in_face)
 
void ndn_forwarder_init (void)
 Initialize all components of the forwarder. More...
 
void ndn_forwarder_process (void)
 Process event messages. More...
 
int ndn_forwarder_register_face (ndn_face_intf_t *face)
 Register a new face. More...
 
int ndn_forwarder_unregister_face (ndn_face_intf_t *face)
 Unregister a face. More...
 
int ndn_forwarder_add_route (ndn_face_intf_t *face, uint8_t *prefix, size_t length)
 Add a route into FIB. More...
 
int ndn_forwarder_remove_route (ndn_face_intf_t *face, uint8_t *prefix, size_t length)
 Remove a route from FIB. More...
 
int ndn_forwarder_remove_all_routes (uint8_t *prefix, size_t length)
 Remove all routes of a prefix from FIB. More...
 
int ndn_forwarder_register_prefix (uint8_t *prefix, size_t length, ndn_on_interest_func on_interest, void *userdata)
 Register a prefix. More...
 
int ndn_forwarder_unregister_prefix (uint8_t *prefix, size_t length)
 Unregister a prefix. More...
 
int ndn_forwarder_express_interest (uint8_t *interest, size_t length, ndn_on_data_func on_data, ndn_on_timeout_func on_timeout, void *userdata)
 Express an interest. More...
 
int ndn_forwarder_put_data (uint8_t *data, size_t length)
 Produce a data packet. More...
 
int ndn_forwarder_receive (ndn_face_intf_t *face, uint8_t *packet, size_t length)
 Receive a packet from a face. More...
 

Variables

static ndn_forwarder_t forwarder
 

Macro Definition Documentation

◆ NDN_FORWARDER_DEFAULT_SIZE

#define NDN_FORWARDER_DEFAULT_SIZE
Value:
#define NDN_NAMETREE_MAX_SIZE
Definition: ndn-constants.h:42
#define NDN_PIT_MAX_SIZE
Definition: ndn-constants.h:44
#define NDN_FORWARDER_RESERVE_SIZE(nametree_size, facetab_size, fib_size, pit_size)
Definition: forwarder.c:17
#define NDN_FACE_TABLE_MAX_SIZE
Definition: ndn-constants.h:46
#define NDN_FIB_MAX_SIZE
Definition: ndn-constants.h:43

◆ NDN_FORWARDER_RESERVE_SIZE

#define NDN_FORWARDER_RESERVE_SIZE (   nametree_size,
  facetab_size,
  fib_size,
  pit_size 
)
Value:
(NDN_NAMETREE_RESERVE_SIZE(nametree_size) + \
NDN_FACE_TABLE_RESERVE_SIZE(facetab_size) + \
NDN_FIB_RESERVE_SIZE(fib_size) + \
NDN_PIT_RESERVE_SIZE(pit_size))
#define NDN_NAMETREE_RESERVE_SIZE(entry_count)
Definition: name-splay.h:43

Typedef Documentation

◆ ndn_forwarder_t

NDN-Lite forwarder.

We will support content store in future versions. The NDN forwarder is a singleton in an application.

Function Documentation

◆ fwd_data_pipeline()

static int fwd_data_pipeline ( uint8_t *  data,
size_t  length,
uint8_t *  name,
size_t  name_len,
ndn_table_id_t  face_id 
)
static

◆ fwd_multicast()

static ndn_bitset_t fwd_multicast ( uint8_t *  packet,
size_t  length,
ndn_bitset_t  out_faces,
ndn_table_id_t  in_face 
)
static

◆ fwd_on_incoming_interest()

static int fwd_on_incoming_interest ( uint8_t *  interest,
size_t  length,
interest_options_t options,
uint8_t *  name,
size_t  name_len,
ndn_table_id_t  face_id 
)
static

◆ fwd_on_outgoing_interest()

static int fwd_on_outgoing_interest ( uint8_t *  interest,
size_t  length,
uint8_t *  name,
size_t  name_len,
ndn_pit_entry_t entry,
ndn_table_id_t  face_id 
)
static

Variable Documentation

◆ forwarder

ndn_forwarder_t forwarder
static