ccnd.c File Reference

Go to the source code of this file.

Defines

#define GOT_HERE   ccnd_msg(h, "at ccnd.c:%d", __LINE__);
 Main program of ccnd - the CCNx Daemon.
#define CCN_SKIPLIST_MAX_DEPTH   30

Typedefs

typedef void(* loggerproc )(void *, const char *,...)

Functions

static void cleanup_at_exit (void)
static void unlink_at_exit (const char *path)
static int create_local_listener (struct ccnd_handle *h, const char *sockname, int backlog)
static struct facerecord_connection (struct ccnd_handle *h, int fd, struct sockaddr *who, socklen_t wholen, int setflags)
 Make a new face entered in the faces_by_fd table.
static void process_input_message (struct ccnd_handle *h, struct face *face, unsigned char *msg, size_t size, int pdu_ok)
static void process_input (struct ccnd_handle *h, int fd)
 Process the input from a socket.
static int ccn_stuff_interest (struct ccnd_handle *h, struct face *face, struct ccn_charbuf *c)
 Stuff a PDU with interest messages that will fit.
static void do_deferred_write (struct ccnd_handle *h, int fd)
static void clean_needed (struct ccnd_handle *h)
static struct faceget_dgram_source (struct ccnd_handle *h, struct face *face, struct sockaddr *addr, socklen_t addrlen, int why)
static void content_skiplist_insert (struct ccnd_handle *h, struct content_entry *content)
static void content_skiplist_remove (struct ccnd_handle *h, struct content_entry *content)
static void mark_stale (struct ccnd_handle *h, struct content_entry *content)
 Mark content as stale.
static ccn_accession_t content_skiplist_next (struct ccnd_handle *h, struct content_entry *content)
static void reap_needed (struct ccnd_handle *h, int init_delay_usec)
static void check_comm_file (struct ccnd_handle *h)
static struct nameprefix_entrynameprefix_for_pe (struct ccnd_handle *h, struct propagating_entry *pe)
static int nameprefix_seek (struct ccnd_handle *h, struct hashtb_enumerator *e, const unsigned char *msg, struct ccn_indexbuf *comps, int ncomps)
 Creates a nameprefix entry if it does not already exist, together with all of its parents.
static void register_new_face (struct ccnd_handle *h, struct face *face)
 Called when a face is first created, and (perhaps) a second time in the case that a face transitions from the undecided state.
static void update_forward_to (struct ccnd_handle *h, struct nameprefix_entry *npe)
 Recompute the contents of npe->forward_to and npe->flags from forwarding lists of npe and all of its ancestors.
static void stuff_and_send (struct ccnd_handle *h, struct face *face, const unsigned char *data1, size_t size1, const unsigned char *data2, size_t size2)
 Send a message in a PDU, possibly stuffing other interest messages into it.
static void ccn_link_state_init (struct ccnd_handle *h, struct face *face)
static void ccn_append_link_stuff (struct ccnd_handle *h, struct face *face, struct ccn_charbuf *c)
static int process_incoming_link_message (struct ccnd_handle *h, struct face *face, enum ccn_dtag dtag, unsigned char *msg, size_t size)
static void handle_fatal_signal (int sig)
static int comm_file_ok (void)
static struct ccn_charbufcharbuf_obtain (struct ccnd_handle *h)
static void charbuf_release (struct ccnd_handle *h, struct ccn_charbuf *c)
static struct ccn_indexbufindexbuf_obtain (struct ccnd_handle *h)
static void indexbuf_release (struct ccnd_handle *h, struct ccn_indexbuf *c)
static struct faceface_from_faceid (struct ccnd_handle *h, unsigned faceid)
 Looks up a face based on its faceid (private).
struct faceccnd_face_from_faceid (struct ccnd_handle *h, unsigned faceid)
 Looks up a face based on its faceid.
static int enroll_face (struct ccnd_handle *h, struct face *face)
 Assigns the faceid for a nacent face, calls register_new_face() if successful.
static int choose_face_delay (struct ccnd_handle *h, struct face *face, enum cq_delay_class c)
static struct content_queuecontent_queue_create (struct ccnd_handle *h, struct face *face, enum cq_delay_class c)
static void content_queue_destroy (struct ccnd_handle *h, struct content_queue **pq)
static void close_fd (int *pfd)
 Close an open file descriptor quietly.
static void ccnd_close_fd (struct ccnd_handle *h, unsigned faceid, int *pfd)
 Close an open file descriptor, and grumble about it.
static void finalize_face (struct hashtb_enumerator *e)
static struct content_entrycontent_from_accession (struct ccnd_handle *h, ccn_accession_t accession)
static void cleanout_stragglers (struct ccnd_handle *h)
static int cleanout_empties (struct ccnd_handle *h)
static void enroll_content (struct ccnd_handle *h, struct content_entry *content)
static void finalize_content (struct hashtb_enumerator *content_enumerator)
static int content_skiplist_findbefore (struct ccnd_handle *h, const unsigned char *key, size_t keysize, struct content_entry *wanted_old, struct ccn_indexbuf **ans)
static struct content_entryfind_first_match_candidate (struct ccnd_handle *h, const unsigned char *interest_msg, const struct ccn_parsed_interest *pi)
static int content_matches_interest_prefix (struct ccnd_handle *h, struct content_entry *content, const unsigned char *interest_msg, struct ccn_indexbuf *comps, int prefix_comps)
static void consume (struct ccnd_handle *h, struct propagating_entry *pe)
static void finalize_nameprefix (struct hashtb_enumerator *e)
static void link_propagating_interest_to_nameprefix (struct ccnd_handle *h, struct propagating_entry *pe, struct nameprefix_entry *npe)
static void finalize_propagating (struct hashtb_enumerator *e)
static int establish_min_recv_bufsize (struct ccnd_handle *h, int fd, int minsize)
static void init_face_flags (struct ccnd_handle *h, struct face *face, int setflags)
 Initialize the face flags based upon the addr information and the provided explicit setflags.
static int accept_connection (struct ccnd_handle *h, int listener_fd)
 Accept an incoming DGRAM_STREAM connection, creating a new face.
static struct facemake_connection (struct ccnd_handle *h, struct sockaddr *who, socklen_t wholen, int setflags)
 Make an outbound stream connection.
static int ccnd_getboundsocket (void *dat, struct sockaddr *who, socklen_t wholen)
static unsigned faceid_from_fd (struct ccnd_handle *h, int fd)
static struct facesetup_multicast (struct ccnd_handle *h, struct ccn_face_instance *face_instance, struct sockaddr *who, socklen_t wholen)
static void shutdown_client_fd (struct ccnd_handle *h, int fd)
static void send_content (struct ccnd_handle *h, struct face *face, struct content_entry *content)
static enum cq_delay_class choose_content_delay_class (struct ccnd_handle *h, unsigned faceid, int content_flags)
static unsigned randomize_content_delay (struct ccnd_handle *h, struct content_queue *q)
static int content_sender (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
static int face_send_queue_insert (struct ccnd_handle *h, struct face *face, struct content_entry *content)
static int promote_outbound (struct propagating_entry *pe, unsigned faceid)
 If the pe interest is slated to be sent to the given faceid, promote the faceid to the front of the list, preserving the order of the others.
static int consume_matching_interests (struct ccnd_handle *h, struct nameprefix_entry *npe, struct content_entry *content, struct ccn_parsed_ContentObject *pc, struct face *face)
 Consume matching interests given a nameprefix_entry and a piece of content.
static void adjust_npe_predicted_response (struct ccnd_handle *h, struct nameprefix_entry *npe, int up)
static void adjust_predicted_response (struct ccnd_handle *h, struct propagating_entry *pe, int up)
static void note_content_from (struct ccnd_handle *h, struct nameprefix_entry *npe, unsigned from_faceid, int prefix_comps)
 Keep a little history about where matching content comes from.
static int reorder_outbound_using_history (struct ccnd_handle *h, struct nameprefix_entry *npe, struct propagating_entry *pe)
 Use the history to reorder the interest forwarding.
static int match_interests (struct ccnd_handle *h, struct content_entry *content, struct ccn_parsed_ContentObject *pc, struct face *face, struct face *from_face)
 Find and consume interests that match given content.
static int stuff_link_check (struct ccnd_handle *h, struct face *face, struct ccn_charbuf *c)
 Append a link-check interest if appropriate.
static int check_dgram_faces (struct ccnd_handle *h)
 Checks for inactivity on datagram faces.
int ccnd_destroy_face (struct ccnd_handle *h, unsigned faceid)
 Destroys the face identified by faceid.
static void check_forward_to (struct ccnd_handle *h, struct nameprefix_entry *npe)
 Remove expired faces from npe->forward_to.
static int check_propagating (struct ccnd_handle *h)
 Check for expired propagating interests.
static int check_nameprefix_entries (struct ccnd_handle *h)
 Ages src info and retires unused nameprefix entries.
static int reap (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 Scheduled reap event for retiring expired structures.
static int remove_content (struct ccnd_handle *h, struct content_entry *content)
static int clean_deamon (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 Periodic content cleaning.
static int age_forwarding (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 Age out the old forwarding table entries.
static void age_forwarding_needed (struct ccnd_handle *h)
static struct ccn_forwardingseek_forwarding (struct ccnd_handle *h, struct nameprefix_entry *npe, unsigned faceid)
static int ccnd_reg_prefix (struct ccnd_handle *h, const unsigned char *msg, struct ccn_indexbuf *comps, int ncomps, unsigned faceid, int flags, int expires)
 Register or update a prefix in the forwarding table (FIB).
int ccnd_reg_uri (struct ccnd_handle *h, const char *uri, unsigned faceid, int flags, int expires)
 Register a prefix, expressed in the form of a URI.
void ccnd_reg_uri_list (struct ccnd_handle *h, struct ccn_charbuf *uris, unsigned faceid, int flags, int expires)
 Register prefixes, expressed in the form of a list of URIs.
static int ccnd_nack (struct ccnd_handle *h, struct ccn_charbuf *reply_body, int errcode, const char *errtext)
 Replaces contents of reply_body with a ccnb-encoded StatusResponse.
static int check_ccndid (struct ccnd_handle *h, const void *p, size_t sz, struct ccn_charbuf *reply_body)
 Check that indicated ccndid matches ours.
static int check_face_instance_ccndid (struct ccnd_handle *h, struct ccn_face_instance *f, struct ccn_charbuf *reply_body)
static int check_forwarding_entry_ccndid (struct ccnd_handle *h, struct ccn_forwarding_entry *f, struct ccn_charbuf *reply_body)
int ccnd_req_newface (struct ccnd_handle *h, const unsigned char *msg, size_t size, struct ccn_charbuf *reply_body)
 Process a newface request for the ccnd internal client.
int ccnd_req_destroyface (struct ccnd_handle *h, const unsigned char *msg, size_t size, struct ccn_charbuf *reply_body)
 Process a destroyface request for the ccnd internal client.
static int ccnd_req_prefix_or_self_reg (struct ccnd_handle *h, const unsigned char *msg, size_t size, int selfreg, struct ccn_charbuf *reply_body)
 Worker bee for two very similar public functions.
int ccnd_req_prefixreg (struct ccnd_handle *h, const unsigned char *msg, size_t size, struct ccn_charbuf *reply_body)
 Process a prefixreg request for the ccnd internal client.
int ccnd_req_selfreg (struct ccnd_handle *h, const unsigned char *msg, size_t size, struct ccn_charbuf *reply_body)
 Process a selfreg request for the ccnd internal client.
int ccnd_req_unreg (struct ccnd_handle *h, const unsigned char *msg, size_t size, struct ccn_charbuf *reply_body)
 Process an unreg request for the ccnd internal client.
static struct ccn_indexbufget_outbound_faces (struct ccnd_handle *h, struct face *from, unsigned char *msg, struct ccn_parsed_interest *pi, struct nameprefix_entry *npe)
 This is where we consult the interest forwarding table.
static int pe_next_usec (struct ccnd_handle *h, struct propagating_entry *pe, int next_delay, int lineno)
static void replan_propagation (struct ccnd_handle *, struct propagating_entry *)
static int do_propagate (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
static int adjust_outbound_for_existing_interests (struct ccnd_handle *h, struct face *face, unsigned char *msg, struct ccn_parsed_interest *pi, struct nameprefix_entry *npe, struct ccn_indexbuf *outbound)
 Adjust the outbound face list for a new Interest, based upon existing similar interests.
static void ccnd_append_debug_nonce (struct ccnd_handle *h, struct face *face, struct ccn_charbuf *cb)
static void ccnd_append_plain_nonce (struct ccnd_handle *h, struct face *face, struct ccn_charbuf *cb)
static int propagate_interest (struct ccnd_handle *h, struct face *face, unsigned char *msg, struct ccn_parsed_interest *pi, struct nameprefix_entry *npe)
 Schedules the propagation of an Interest message.
static int is_duplicate_flooded (struct ccnd_handle *h, unsigned char *msg, struct ccn_parsed_interest *pi, unsigned faceid)
 Checks whether this Interest message has been seen before by using its Nonce, recording it in the process.
int nameprefix_longest_match (struct ccnd_handle *h, const unsigned char *msg, struct ccn_indexbuf *comps, int ncomps)
 Finds the longest matching nameprefix, returns the component count or -1 for error.
static struct content_entrynext_child_at_level (struct ccnd_handle *h, struct content_entry *content, int level)
static void process_incoming_interest (struct ccnd_handle *h, struct face *face, unsigned char *msg, size_t size)
static int expire_content (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
 Scheduled event that makes content stale when its FreshnessSeconds has exported.
static void set_content_timer (struct ccnd_handle *h, struct content_entry *content, struct ccn_parsed_ContentObject *pco)
 Schedules content expiration based on its FreshnessSeconds.
static void process_incoming_content (struct ccnd_handle *h, struct face *face, unsigned char *wire_msg, size_t wire_size)
static void ccnd_new_face_msg (struct ccnd_handle *h, struct face *face)
static struct sockaddr * scrub_sockaddr (struct sockaddr *addr, socklen_t addrlen, struct sockaddr_in6 *space)
 Since struct sockaddr_in6 may contain fields that should not participate in comparison / hash, ensure the undesired fields are zero.
static void process_input_buffer (struct ccnd_handle *h, struct face *face)
 Break up data in a face's input buffer buffer into individual messages, and call process_input_message on each one.
static void process_internal_client_buffer (struct ccnd_handle *h)
static int handle_send_error (struct ccnd_handle *h, int errnum, struct face *face, const void *data, size_t size)
 Handle errors after send() or sendto().
static int sending_fd (struct ccnd_handle *h, struct face *face)
void ccnd_send (struct ccnd_handle *h, struct face *face, const void *data, size_t size)
 Send data to the face.
static void prepare_poll_fds (struct ccnd_handle *h)
 Set up the array of fd descriptors for the poll(2) call.
void ccnd_run (struct ccnd_handle *h)
 Run the main loop of the ccnd.
static void ccnd_reseed (struct ccnd_handle *h)
static char * ccnd_get_local_sockname (void)
static void ccnd_gettime (const struct ccn_gettime *self, struct ccn_timeval *result)
void ccnd_setsockopt_v6only (struct ccnd_handle *h, int fd)
static const char * af_name (int family)
static int ccnd_listen_on_wildcards (struct ccnd_handle *h)
static int ccnd_listen_on_address (struct ccnd_handle *h, const char *addr)
static int ccnd_listen_on (struct ccnd_handle *h, const char *addrs)
static struct ccn_charbufccnd_parse_uri_list (struct ccnd_handle *h, const char *what, const char *uris)
struct ccnd_handleccnd_create (const char *progname, ccnd_logger logger, void *loggerdata)
 Start a new ccnd instance.
static void ccnd_shutdown_listeners (struct ccnd_handle *h)
 Shutdown listeners and bound datagram sockets, leaving connected streams.
void ccnd_destroy (struct ccnd_handle **pccnd)
 Destroy the ccnd instance, releasing all associated resources.

Variables

static const char * unlink_this_at_exit = NULL

Define Documentation

#define CCN_SKIPLIST_MAX_DEPTH   30
#define GOT_HERE   ccnd_msg(h, "at ccnd.c:%d", __LINE__);

Main program of ccnd - the CCNx Daemon.

Definition at line 63 of file ccnd.c.


Typedef Documentation

typedef void(* loggerproc)(void *, const char *,...)

Definition at line 1051 of file ccnd.c.


Function Documentation

static int accept_connection ( struct ccnd_handle h,
int  listener_fd 
) [static]

Accept an incoming DGRAM_STREAM connection, creating a new face.

Returns:
fd of new socket, or -1 for an error.

Definition at line 919 of file ccnd.c.

Referenced by process_input().

static void adjust_npe_predicted_response ( struct ccnd_handle h,
struct nameprefix_entry npe,
int  up 
) [static]

Definition at line 1392 of file ccnd.c.

Referenced by adjust_predicted_response(), and note_content_from().

static int adjust_outbound_for_existing_interests ( struct ccnd_handle h,
struct face face,
unsigned char *  msg,
struct ccn_parsed_interest pi,
struct nameprefix_entry npe,
struct ccn_indexbuf outbound 
) [static]

Adjust the outbound face list for a new Interest, based upon existing similar interests.

Returns:
besides possibly updating the outbound set, returns an extra delay time before propagation. A negative return value indicates the interest should be dropped.

Definition at line 3064 of file ccnd.c.

Referenced by propagate_interest().

static void adjust_predicted_response ( struct ccnd_handle h,
struct propagating_entry pe,
int  up 
) [static]

Definition at line 1408 of file ccnd.c.

Referenced by do_propagate().

static const char* af_name ( int  family  )  [static]

Definition at line 4554 of file ccnd.c.

Referenced by ccnd_listen_on_address(), and ccnd_listen_on_wildcards().

static int age_forwarding ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Age out the old forwarding table entries.

Definition at line 2099 of file ccnd.c.

Referenced by age_forwarding_needed().

static void age_forwarding_needed ( struct ccnd_handle h  )  [static]

Definition at line 2153 of file ccnd.c.

Referenced by ccnd_create().

static void ccn_append_link_stuff ( struct ccnd_handle h,
struct face face,
struct ccn_charbuf c 
) [static]

Definition at line 1674 of file ccnd.c.

Referenced by stuff_and_send().

static void ccn_link_state_init ( struct ccnd_handle h,
struct face face 
) [static]

Definition at line 1658 of file ccnd.c.

Referenced by register_new_face().

static int ccn_stuff_interest ( struct ccnd_handle h,
struct face face,
struct ccn_charbuf c 
) [static]

Stuff a PDU with interest messages that will fit.

Note by default stuffing does not happen due to the setting of h->mtu.

Returns:
the number of messages that were stuffed.

Definition at line 1606 of file ccnd.c.

Referenced by stuff_and_send().

static void ccnd_append_debug_nonce ( struct ccnd_handle h,
struct face face,
struct ccn_charbuf cb 
) [static]

Definition at line 3162 of file ccnd.c.

Referenced by ccnd_create().

static void ccnd_append_plain_nonce ( struct ccnd_handle h,
struct face face,
struct ccn_charbuf cb 
) [static]

Definition at line 3180 of file ccnd.c.

Referenced by ccnd_create().

static void ccnd_close_fd ( struct ccnd_handle h,
unsigned  faceid,
int *  pfd 
) [static]

Close an open file descriptor, and grumble about it.

Definition at line 341 of file ccnd.c.

Referenced by finalize_face().

struct ccnd_handle* ccnd_create ( const char *  progname,
ccnd_logger  logger,
void *  loggerdata 
) [read]

Start a new ccnd instance.

Parameters:
progname - name of program binary, used for locating helpers
logger - logger function
loggerdata - data to pass to logger function

Definition at line 4802 of file ccnd.c.

Referenced by main(), and start_ccnd().

void ccnd_destroy ( struct ccnd_handle **  pccnd  ) 

Destroy the ccnd instance, releasing all associated resources.

Definition at line 4954 of file ccnd.c.

Referenced by main().

int ccnd_destroy_face ( struct ccnd_handle h,
unsigned  faceid 
)

Destroys the face identified by faceid.

Returns:
0 for success, -1 for failure.

Definition at line 1798 of file ccnd.c.

Referenced by ccnd_req_destroyface(), and ccnd_stats_handle_http_connection().

struct face* ccnd_face_from_faceid ( struct ccnd_handle h,
unsigned  faceid 
) [read]

Looks up a face based on its faceid.

Definition at line 220 of file ccnd.c.

Referenced by ccnd_collect_stats(), and post_face_notice().

static char* ccnd_get_local_sockname ( void   )  [static]

Definition at line 4521 of file ccnd.c.

Referenced by ccnd_create().

static int ccnd_getboundsocket ( void *  dat,
struct sockaddr *  who,
socklen_t  wholen 
) [static]

Definition at line 1006 of file ccnd.c.

Referenced by setup_multicast().

static void ccnd_gettime ( const struct ccn_gettime self,
struct ccn_timeval result 
) [static]

Definition at line 4529 of file ccnd.c.

Referenced by ccnd_create().

static int ccnd_listen_on ( struct ccnd_handle h,
const char *  addrs 
) [static]

Definition at line 4723 of file ccnd.c.

Referenced by ccnd_create().

static int ccnd_listen_on_address ( struct ccnd_handle h,
const char *  addr 
) [static]

Definition at line 4645 of file ccnd.c.

Referenced by ccnd_listen_on().

static int ccnd_listen_on_wildcards ( struct ccnd_handle h  )  [static]

Definition at line 4567 of file ccnd.c.

Referenced by ccnd_listen_on().

static int ccnd_nack ( struct ccnd_handle h,
struct ccn_charbuf reply_body,
int  errcode,
const char *  errtext 
) [static]

Replaces contents of reply_body with a ccnb-encoded StatusResponse.

Returns:
CCN_CONTENT_NACK, or -1 in case of error.

Definition at line 2335 of file ccnd.c.

Referenced by ccnd_req_destroyface(), ccnd_req_newface(), ccnd_req_prefix_or_self_reg(), ccnd_req_unreg(), and check_ccndid().

static void ccnd_new_face_msg ( struct ccnd_handle h,
struct face face 
) [static]

Definition at line 4004 of file ccnd.c.

Referenced by get_dgram_source().

static struct ccn_charbuf* ccnd_parse_uri_list ( struct ccnd_handle h,
const char *  what,
const char *  uris 
) [static, read]

Definition at line 4756 of file ccnd.c.

Referenced by ccnd_create().

static int ccnd_reg_prefix ( struct ccnd_handle h,
const unsigned char *  msg,
struct ccn_indexbuf comps,
int  ncomps,
unsigned  faceid,
int  flags,
int  expires 
) [static]

Register or update a prefix in the forwarding table (FIB).

Parameters:
h is the ccnd handle.
msg is a ccnb-encoded message containing the name prefix somewhere.
comps contains the delimiting offsets for the name components in msg.
ncomps is the number of relevant components.
faceid indicates which face to forward to.
flags are the forwarding entry flags (CCN_FORW_...), -1 for defaults.
expires tells the remaining lifetime, in seconds.
Returns:
-1 for error, or new flags upon success; the private flag CCN_FORW_REFRESHED indicates a previously existing entry.

Definition at line 2196 of file ccnd.c.

Referenced by ccnd_reg_uri(), and ccnd_req_prefix_or_self_reg().

int ccnd_reg_uri ( struct ccnd_handle h,
const char *  uri,
unsigned  faceid,
int  flags,
int  expires 
)

Register a prefix, expressed in the form of a URI.

Returns:
negative value for error, or new face flags for success.

Definition at line 2264 of file ccnd.c.

Referenced by ccnd_internal_client_start(), ccnd_reg_ccnx_ccndid(), ccnd_reg_uri_list(), and ccnd_uri_listen().

void ccnd_reg_uri_list ( struct ccnd_handle h,
struct ccn_charbuf uris,
unsigned  faceid,
int  flags,
int  expires 
)

Register prefixes, expressed in the form of a list of URIs.

The URIs in the charbuf are each terminated by nul.

Definition at line 2299 of file ccnd.c.

Referenced by register_new_face().

int ccnd_req_destroyface ( struct ccnd_handle h,
const unsigned char *  msg,
size_t  size,
struct ccn_charbuf reply_body 
)

Process a destroyface request for the ccnd internal client.

Parameters:
h is the ccnd handle
msg points to a ccnd-encoded ContentObject containing a FaceInstance in its Content.
size is its size in bytes
reply_body is a buffer to hold the Content of the reply, as a FaceInstance including faceid
Returns:
0 for success, negative for no response, or CCN_CONTENT_NACK to set the response type to NACK.

Is is an error if the face does not exist.

Definition at line 2540 of file ccnd.c.

Referenced by ccnd_answer_req().

int ccnd_req_newface ( struct ccnd_handle h,
const unsigned char *  msg,
size_t  size,
struct ccn_charbuf reply_body 
)

Process a newface request for the ccnd internal client.

Parameters:
h is the ccnd handle
msg points to a ccnd-encoded ContentObject containing a FaceInstance in its Content.
size is its size in bytes
reply_body is a buffer to hold the Content of the reply, as a FaceInstance including faceid
Returns:
0 for success, negative for no response, or CCN_CONTENT_NACK to set the response type to NACK.

Is is permitted for the face to already exist. A newly created face will have no registered prefixes, and so will not receive any traffic.

Definition at line 2391 of file ccnd.c.

Referenced by ccnd_answer_req().

static int ccnd_req_prefix_or_self_reg ( struct ccnd_handle h,
const unsigned char *  msg,
size_t  size,
int  selfreg,
struct ccn_charbuf reply_body 
) [static]

Worker bee for two very similar public functions.

Definition at line 2598 of file ccnd.c.

Referenced by ccnd_req_prefixreg(), and ccnd_req_selfreg().

int ccnd_req_prefixreg ( struct ccnd_handle h,
const unsigned char *  msg,
size_t  size,
struct ccn_charbuf reply_body 
)

Process a prefixreg request for the ccnd internal client.

Parameters:
h is the ccnd handle
msg points to a ccnd-encoded ContentObject containing a ForwardingEntry in its Content.
size is its size in bytes
reply_body is a buffer to hold the Content of the reply, as a FaceInstance including faceid
Returns:
0 for success, negative for no response, or CCN_CONTENT_NACK to set the response type to NACK.

Definition at line 2697 of file ccnd.c.

Referenced by ccnd_answer_req().

int ccnd_req_selfreg ( struct ccnd_handle h,
const unsigned char *  msg,
size_t  size,
struct ccn_charbuf reply_body 
)

Process a selfreg request for the ccnd internal client.

Parameters:
h is the ccnd handle
msg points to a ccnd-encoded ContentObject containing a ForwardingEntry in its Content.
size is its size in bytes
reply_body is a buffer to hold the Content of the reply, as a ccnb-encoded ForwardingEntry
Returns:
0 for success, negative for no response, or CCN_CONTENT_NACK to set the response type to NACK.

Definition at line 2717 of file ccnd.c.

Referenced by ccnd_answer_req().

int ccnd_req_unreg ( struct ccnd_handle h,
const unsigned char *  msg,
size_t  size,
struct ccn_charbuf reply_body 
)

Process an unreg request for the ccnd internal client.

Parameters:
h is the ccnd handle
msg points to a ccnd-encoded ContentObject containing a ForwardingEntry in its Content.
size is its size in bytes
reply_body is a buffer to hold the Content of the reply, as a ccnb-encoded ForwardingEntry
Returns:
0 for success, negative for no response, or CCN_CONTENT_NACK to set the response type to NACK.

Definition at line 2737 of file ccnd.c.

Referenced by ccnd_answer_req().

static void ccnd_reseed ( struct ccnd_handle h  )  [static]

Definition at line 4498 of file ccnd.c.

Referenced by ccnd_create().

void ccnd_run ( struct ccnd_handle h  ) 

Run the main loop of the ccnd.

Definition at line 4455 of file ccnd.c.

Referenced by main(), and start_ccnd().

void ccnd_send ( struct ccnd_handle h,
struct face face,
const void *  data,
size_t  size 
)

Send data to the face.

No direct error result is provided; the face state is updated as needed.

Definition at line 4324 of file ccnd.c.

Referenced by ccnd_stats_handle_http_connection(), send_http_response(), and stuff_and_send().

void ccnd_setsockopt_v6only ( struct ccnd_handle h,
int  fd 
)

Definition at line 4541 of file ccnd.c.

Referenced by ccnd_listen_on_address(), and ccnd_listen_on_wildcards().

static void ccnd_shutdown_listeners ( struct ccnd_handle h  )  [static]

Shutdown listeners and bound datagram sockets, leaving connected streams.

Definition at line 4936 of file ccnd.c.

Referenced by ccnd_destroy().

static struct ccn_charbuf* charbuf_obtain ( struct ccnd_handle h  )  [static, read]

Definition at line 159 of file ccnd.c.

Referenced by process_incoming_content(), propagate_interest(), and stuff_and_send().

static void charbuf_release ( struct ccnd_handle h,
struct ccn_charbuf c 
) [static]

Definition at line 170 of file ccnd.c.

Referenced by process_incoming_content(), propagate_interest(), and stuff_and_send().

static int check_ccndid ( struct ccnd_handle h,
const void *  p,
size_t  sz,
struct ccn_charbuf reply_body 
) [static]

Check that indicated ccndid matches ours.

Returns:
0 if OK, or CCN_CONTENT_NACK if not.

Definition at line 2352 of file ccnd.c.

Referenced by check_face_instance_ccndid(), and check_forwarding_entry_ccndid().

static void check_comm_file ( struct ccnd_handle h  )  [static]

Definition at line 1916 of file ccnd.c.

Referenced by process_input(), reap(), and shutdown_client_fd().

static int check_dgram_faces ( struct ccnd_handle h  )  [static]

Checks for inactivity on datagram faces.

Returns:
number of faces that have gone away.

Definition at line 1761 of file ccnd.c.

Referenced by reap().

static int check_face_instance_ccndid ( struct ccnd_handle h,
struct ccn_face_instance f,
struct ccn_charbuf reply_body 
) [static]

Definition at line 2361 of file ccnd.c.

Referenced by ccnd_req_destroyface(), and ccnd_req_newface().

static void check_forward_to ( struct ccnd_handle h,
struct nameprefix_entry npe 
) [static]

Remove expired faces from npe->forward_to.

Definition at line 1828 of file ccnd.c.

Referenced by check_nameprefix_entries().

static int check_forwarding_entry_ccndid ( struct ccnd_handle h,
struct ccn_forwarding_entry f,
struct ccn_charbuf reply_body 
) [static]

Definition at line 2368 of file ccnd.c.

Referenced by ccnd_req_unreg().

static int check_nameprefix_entries ( struct ccnd_handle h  )  [static]

Ages src info and retires unused nameprefix entries.

Returns:
number that have gone away.

Definition at line 1881 of file ccnd.c.

Referenced by reap().

static int check_propagating ( struct ccnd_handle h  )  [static]

Check for expired propagating interests.

Returns:
number that have gone away.

Definition at line 1852 of file ccnd.c.

Referenced by reap().

static enum cq_delay_class choose_content_delay_class ( struct ccnd_handle h,
unsigned  faceid,
int  content_flags 
) [static]

Definition at line 1155 of file ccnd.c.

Referenced by face_send_queue_insert().

static int choose_face_delay ( struct ccnd_handle h,
struct face face,
enum cq_delay_class  c 
) [static]

Definition at line 269 of file ccnd.c.

Referenced by content_queue_create().

static int clean_deamon ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Periodic content cleaning.

Definition at line 1983 of file ccnd.c.

Referenced by clean_needed().

static void clean_needed ( struct ccnd_handle h  )  [static]

Definition at line 2089 of file ccnd.c.

Referenced by ccnd_create().

static int cleanout_empties ( struct ccnd_handle h  )  [static]

Definition at line 454 of file ccnd.c.

Referenced by enroll_content().

static void cleanout_stragglers ( struct ccnd_handle h  )  [static]

Definition at line 414 of file ccnd.c.

Referenced by cleanout_empties().

static void cleanup_at_exit ( void   )  [static]

Definition at line 116 of file ccnd.c.

Referenced by handle_fatal_signal(), and unlink_at_exit().

static void close_fd ( int *  pfd  )  [static]

Close an open file descriptor quietly.

Definition at line 329 of file ccnd.c.

Referenced by accept_connection().

static int comm_file_ok ( void   )  [static]

Definition at line 146 of file ccnd.c.

Referenced by check_comm_file().

static void consume ( struct ccnd_handle h,
struct propagating_entry pe 
) [static]
static int consume_matching_interests ( struct ccnd_handle h,
struct nameprefix_entry npe,
struct content_entry content,
struct ccn_parsed_ContentObject pc,
struct face face 
) [static]

Consume matching interests given a nameprefix_entry and a piece of content.

If face is not NULL, pay attention only to interests from that face. It is allowed to pass NULL for pc, but if you have a (valid) one it will avoid a re-parse.

Returns:
number of matches found.

Definition at line 1354 of file ccnd.c.

Referenced by match_interests().

static struct content_entry* content_from_accession ( struct ccnd_handle h,
ccn_accession_t  accession 
) [static, read]
static int content_matches_interest_prefix ( struct ccnd_handle h,
struct content_entry content,
const unsigned char *  interest_msg,
struct ccn_indexbuf comps,
int  prefix_comps 
) [static]

Definition at line 691 of file ccnd.c.

Referenced by process_incoming_interest().

static struct content_queue* content_queue_create ( struct ccnd_handle h,
struct face face,
enum cq_delay_class  c 
) [static, read]

Definition at line 288 of file ccnd.c.

Referenced by face_send_queue_insert().

static void content_queue_destroy ( struct ccnd_handle h,
struct content_queue **  pq 
) [static]

Definition at line 310 of file ccnd.c.

Referenced by finalize_face().

static int content_sender ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Definition at line 1186 of file ccnd.c.

Referenced by face_send_queue_insert().

static int content_skiplist_findbefore ( struct ccnd_handle h,
const unsigned char *  key,
size_t  keysize,
struct content_entry wanted_old,
struct ccn_indexbuf **  ans 
) [static]
static void content_skiplist_insert ( struct ccnd_handle h,
struct content_entry content 
) [static]

Definition at line 583 of file ccnd.c.

Referenced by process_incoming_content().

static ccn_accession_t content_skiplist_next ( struct ccnd_handle h,
struct content_entry content 
) [static]

Definition at line 714 of file ccnd.c.

Referenced by next_child_at_level(), and process_incoming_interest().

static void content_skiplist_remove ( struct ccnd_handle h,
struct content_entry content 
) [static]

Definition at line 610 of file ccnd.c.

Referenced by finalize_content().

static int create_local_listener ( struct ccnd_handle h,
const char *  sockname,
int  backlog 
) [static]

Definition at line 780 of file ccnd.c.

Referenced by ccnd_create().

static void do_deferred_write ( struct ccnd_handle h,
int  fd 
) [static]

Definition at line 4371 of file ccnd.c.

Referenced by ccnd_run().

static int do_propagate ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Definition at line 2972 of file ccnd.c.

Referenced by propagate_interest().

static void enroll_content ( struct ccnd_handle h,
struct content_entry content 
) [static]

Definition at line 476 of file ccnd.c.

Referenced by process_incoming_content().

static int enroll_face ( struct ccnd_handle h,
struct face face 
) [static]

Assigns the faceid for a nacent face, calls register_new_face() if successful.

Definition at line 230 of file ccnd.c.

Referenced by ccnd_create(), get_dgram_source(), and record_connection().

static int establish_min_recv_bufsize ( struct ccnd_handle h,
int  fd,
int  minsize 
) [static]

Definition at line 817 of file ccnd.c.

Referenced by setup_multicast().

static int expire_content ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Scheduled event that makes content stale when its FreshnessSeconds has exported.

May actually remove the content if we are over quota.

Definition at line 3719 of file ccnd.c.

Referenced by set_content_timer().

static struct face* face_from_faceid ( struct ccnd_handle h,
unsigned  faceid 
) [static, read]
static int face_send_queue_insert ( struct ccnd_handle h,
struct face face,
struct content_entry content 
) [static]

Definition at line 1279 of file ccnd.c.

Referenced by consume_matching_interests(), and process_incoming_interest().

static unsigned faceid_from_fd ( struct ccnd_handle h,
int  fd 
) [static]

Definition at line 1043 of file ccnd.c.

Referenced by setup_multicast().

static void finalize_content ( struct hashtb_enumerator content_enumerator  )  [static]

Definition at line 509 of file ccnd.c.

Referenced by ccnd_create().

static void finalize_face ( struct hashtb_enumerator e  )  [static]

Definition at line 360 of file ccnd.c.

Referenced by ccnd_create().

static void finalize_nameprefix ( struct hashtb_enumerator e  )  [static]

Definition at line 744 of file ccnd.c.

Referenced by ccnd_create().

static void finalize_propagating ( struct hashtb_enumerator e  )  [static]

Definition at line 773 of file ccnd.c.

Referenced by ccnd_create().

static struct content_entry* find_first_match_candidate ( struct ccnd_handle h,
const unsigned char *  interest_msg,
const struct ccn_parsed_interest pi 
) [static, read]

Definition at line 632 of file ccnd.c.

Referenced by process_incoming_interest().

static struct face * get_dgram_source ( struct ccnd_handle h,
struct face face,
struct sockaddr *  addr,
socklen_t  addrlen,
int  why 
) [static, read]

Definition at line 4063 of file ccnd.c.

Referenced by ccnd_req_newface(), and process_input().

static struct ccn_indexbuf* get_outbound_faces ( struct ccnd_handle h,
struct face from,
unsigned char *  msg,
struct ccn_parsed_interest pi,
struct nameprefix_entry npe 
) [static, read]

This is where we consult the interest forwarding table.

Parameters:
h is the ccnd handle
from is the handle for the originating face (may be NULL).
msg points to the ccnb-encoded interest message
pi must be the parse information for msg
npe should be the result of the prefix lookup
Returns:
Newly allocated set of outgoing faceids (never NULL)

Definition at line 2902 of file ccnd.c.

Referenced by propagate_interest().

static void handle_fatal_signal ( int  sig  )  [static]

Definition at line 125 of file ccnd.c.

Referenced by unlink_at_exit().

static int handle_send_error ( struct ccnd_handle h,
int  errnum,
struct face face,
const void *  data,
size_t  size 
) [static]

Handle errors after send() or sendto().

Returns:
-1 if error has been dealt with, or 0 to defer sending.

Definition at line 4269 of file ccnd.c.

Referenced by ccnd_send().

static struct ccn_indexbuf* indexbuf_obtain ( struct ccnd_handle h  )  [static, read]

Definition at line 180 of file ccnd.c.

Referenced by process_incoming_content(), and process_incoming_interest().

static void indexbuf_release ( struct ccnd_handle h,
struct ccn_indexbuf c 
) [static]

Definition at line 191 of file ccnd.c.

Referenced by process_incoming_content(), and process_incoming_interest().

static void init_face_flags ( struct ccnd_handle h,
struct face face,
int  setflags 
) [static]

Initialize the face flags based upon the addr information and the provided explicit setflags.

Definition at line 842 of file ccnd.c.

Referenced by get_dgram_source(), and record_connection().

static int is_duplicate_flooded ( struct ccnd_handle h,
unsigned char *  msg,
struct ccn_parsed_interest pi,
unsigned  faceid 
) [static]

Checks whether this Interest message has been seen before by using its Nonce, recording it in the process.

Also, if it has been seen and the original is still propagating, remove the face that the duplicate arrived on from the outbound set of the original.

Definition at line 3388 of file ccnd.c.

Referenced by process_incoming_interest().

static void link_propagating_interest_to_nameprefix ( struct ccnd_handle h,
struct propagating_entry pe,
struct nameprefix_entry npe 
) [static]

Definition at line 763 of file ccnd.c.

Referenced by propagate_interest().

static struct face* make_connection ( struct ccnd_handle h,
struct sockaddr *  who,
socklen_t  wholen,
int  setflags 
) [static, read]

Make an outbound stream connection.

Definition at line 945 of file ccnd.c.

Referenced by ccnd_req_newface().

static void mark_stale ( struct ccnd_handle h,
struct content_entry content 
) [static]

Mark content as stale.

Definition at line 3696 of file ccnd.c.

Referenced by clean_deamon(), expire_content(), and process_incoming_interest().

static int match_interests ( struct ccnd_handle h,
struct content_entry content,
struct ccn_parsed_ContentObject pc,
struct face face,
struct face from_face 
) [static]

Find and consume interests that match given content.

Schedules the sending of the content. If face is not NULL, pay attention only to interests from that face. It is allowed to pass NULL for pc, but if you have a (valid) one it will avoid a re-parse. For new content, from_face is the source; for old content, from_face is NULL.

Returns:
number of matches, or -1 if the new content should be dropped.

Definition at line 1481 of file ccnd.c.

Referenced by process_incoming_content(), and process_incoming_interest().

static struct nameprefix_entry * nameprefix_for_pe ( struct ccnd_handle h,
struct propagating_entry pe 
) [static, read]

Definition at line 3319 of file ccnd.c.

Referenced by adjust_predicted_response(), do_propagate(), and replan_propagation().

int nameprefix_longest_match ( struct ccnd_handle h,
const unsigned char *  msg,
struct ccn_indexbuf comps,
int  ncomps 
)

Finds the longest matching nameprefix, returns the component count or -1 for error.

Definition at line 3414 of file ccnd.c.

static int nameprefix_seek ( struct ccnd_handle h,
struct hashtb_enumerator e,
const unsigned char *  msg,
struct ccn_indexbuf comps,
int  ncomps 
) [static]

Creates a nameprefix entry if it does not already exist, together with all of its parents.

Definition at line 3442 of file ccnd.c.

Referenced by ccnd_reg_prefix(), and process_incoming_interest().

static struct content_entry* next_child_at_level ( struct ccnd_handle h,
struct content_entry content,
int  level 
) [static, read]

Definition at line 3487 of file ccnd.c.

Referenced by process_incoming_interest().

static void note_content_from ( struct ccnd_handle h,
struct nameprefix_entry npe,
unsigned  from_faceid,
int  prefix_comps 
) [static]

Keep a little history about where matching content comes from.

Definition at line 1425 of file ccnd.c.

Referenced by match_interests().

static int pe_next_usec ( struct ccnd_handle h,
struct propagating_entry pe,
int  next_delay,
int  lineno 
) [static]

Definition at line 2946 of file ccnd.c.

Referenced by do_propagate(), and propagate_interest().

static void prepare_poll_fds ( struct ccnd_handle h  )  [static]

Set up the array of fd descriptors for the poll(2) call.

Arrange the array so that multicast receivers are early, so that if the same packet arrives on both a multicast socket and a normal socket, we will count is as multicast.

Definition at line 4424 of file ccnd.c.

Referenced by ccnd_run().

static void process_incoming_content ( struct ccnd_handle h,
struct face face,
unsigned char *  wire_msg,
size_t  wire_size 
) [static]

Definition at line 3783 of file ccnd.c.

Referenced by process_input_message().

static void process_incoming_interest ( struct ccnd_handle h,
struct face face,
unsigned char *  msg,
size_t  size 
) [static]

Definition at line 3524 of file ccnd.c.

Referenced by process_input_message().

static int process_incoming_link_message ( struct ccnd_handle h,
struct face face,
enum ccn_dtag  dtag,
unsigned char *  msg,
size_t  size 
) [static]

Definition at line 1692 of file ccnd.c.

Referenced by process_input_message().

static void process_input ( struct ccnd_handle h,
int  fd 
) [static]

Process the input from a socket.

The socket has been found ready for input by the poll call. Decide what face it corresponds to, and after checking for exceptional cases, receive data, parse it into ccnb-encoded messages, and call process_input_message for each one.

Definition at line 4147 of file ccnd.c.

Referenced by ccnd_run().

static void process_input_buffer ( struct ccnd_handle h,
struct face face 
) [static]

Break up data in a face's input buffer buffer into individual messages, and call process_input_message on each one.

This is used to handle things originating from the internal client - its output is input for face 0.

Definition at line 4111 of file ccnd.c.

Referenced by process_internal_client_buffer().

static void process_input_message ( struct ccnd_handle h,
struct face face,
unsigned char *  msg,
size_t  size,
int  pdu_ok 
) [static]

Definition at line 3942 of file ccnd.c.

Referenced by process_input(), and process_input_buffer().

static void process_internal_client_buffer ( struct ccnd_handle h  )  [static]

Definition at line 4251 of file ccnd.c.

Referenced by ccnd_run(), and ccnd_send().

static int promote_outbound ( struct propagating_entry pe,
unsigned  faceid 
) [static]

If the pe interest is slated to be sent to the given faceid, promote the faceid to the front of the list, preserving the order of the others.

Returns:
-1 if not found, or pe->sent if successful.

Definition at line 1326 of file ccnd.c.

Referenced by ccn_stuff_interest(), is_duplicate_flooded(), and reorder_outbound_using_history().

static int propagate_interest ( struct ccnd_handle h,
struct face face,
unsigned char *  msg,
struct ccn_parsed_interest pi,
struct nameprefix_entry npe 
) [static]

Schedules the propagation of an Interest message.

Definition at line 3198 of file ccnd.c.

Referenced by process_incoming_interest().

static unsigned randomize_content_delay ( struct ccnd_handle h,
struct content_queue q 
) [static]

Definition at line 1170 of file ccnd.c.

Referenced by content_sender(), and face_send_queue_insert().

static int reap ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Scheduled reap event for retiring expired structures.

Definition at line 1929 of file ccnd.c.

Referenced by reap_needed().

static void reap_needed ( struct ccnd_handle h,
int  init_delay_usec 
) [static]

Definition at line 1950 of file ccnd.c.

Referenced by do_propagate(), get_dgram_source(), and shutdown_client_fd().

static struct face * record_connection ( struct ccnd_handle h,
int  fd,
struct sockaddr *  who,
socklen_t  wholen,
int  setflags 
) [static, read]

Make a new face entered in the faces_by_fd table.

Definition at line 881 of file ccnd.c.

Referenced by accept_connection(), ccnd_getboundsocket(), ccnd_listen_on_address(), ccnd_listen_on_wildcards(), create_local_listener(), make_connection(), and setup_multicast().

static void register_new_face ( struct ccnd_handle h,
struct face face 
) [static]

Called when a face is first created, and (perhaps) a second time in the case that a face transitions from the undecided state.

Definition at line 2317 of file ccnd.c.

Referenced by enroll_face(), and process_input_message().

static int remove_content ( struct ccnd_handle h,
struct content_entry content 
) [static]

Definition at line 1957 of file ccnd.c.

Referenced by clean_deamon(), expire_content(), and process_incoming_content().

static int reorder_outbound_using_history ( struct ccnd_handle h,
struct nameprefix_entry npe,
struct propagating_entry pe 
) [static]

Use the history to reorder the interest forwarding.

Returns:
number of tap faces that are present.

Definition at line 1449 of file ccnd.c.

Referenced by propagate_interest().

static void replan_propagation ( struct ccnd_handle h,
struct propagating_entry pe 
) [static]

Definition at line 3332 of file ccnd.c.

Referenced by do_propagate().

static struct sockaddr* scrub_sockaddr ( struct sockaddr *  addr,
socklen_t  addrlen,
struct sockaddr_in6 *  space 
) [static, read]

Since struct sockaddr_in6 may contain fields that should not participate in comparison / hash, ensure the undesired fields are zero.

Per RFC 3493, sin6_flowinfo is zeroed.

Parameters:
addr is the sockaddr (any family)
addrlen is its length
space points to a buffer that may be used for the result.
Returns:
either the original addr or a pointer to a scrubbed copy.

Definition at line 4043 of file ccnd.c.

Referenced by get_dgram_source().

static struct ccn_forwarding* seek_forwarding ( struct ccnd_handle h,
struct nameprefix_entry npe,
unsigned  faceid 
) [static, read]

Definition at line 2163 of file ccnd.c.

Referenced by ccnd_reg_prefix().

static void send_content ( struct ccnd_handle h,
struct face face,
struct content_entry content 
) [static]

Definition at line 1131 of file ccnd.c.

Referenced by content_sender().

static int sending_fd ( struct ccnd_handle h,
struct face face 
) [static]

Definition at line 4291 of file ccnd.c.

Referenced by ccnd_send().

static void set_content_timer ( struct ccnd_handle h,
struct content_entry content,
struct ccn_parsed_ContentObject pco 
) [static]

Schedules content expiration based on its FreshnessSeconds.

Definition at line 3751 of file ccnd.c.

Referenced by process_incoming_content().

static struct face* setup_multicast ( struct ccnd_handle h,
struct ccn_face_instance face_instance,
struct sockaddr *  who,
socklen_t  wholen 
) [static, read]

Definition at line 1053 of file ccnd.c.

Referenced by ccnd_req_newface().

static void shutdown_client_fd ( struct ccnd_handle h,
int  fd 
) [static]

Definition at line 1101 of file ccnd.c.

Referenced by ccnd_destroy_face(), ccnd_run(), do_deferred_write(), and process_input().

static void stuff_and_send ( struct ccnd_handle h,
struct face face,
const unsigned char *  data1,
size_t  size1,
const unsigned char *  data2,
size_t  size2 
) [static]

Send a message in a PDU, possibly stuffing other interest messages into it.

The message may be in two pieces.

Definition at line 1520 of file ccnd.c.

Referenced by do_propagate(), and send_content().

static int stuff_link_check ( struct ccnd_handle h,
struct face face,
struct ccn_charbuf c 
) [static]

Append a link-check interest if appropriate.

Returns:
the number of messages that were stuffed.

Definition at line 1561 of file ccnd.c.

Referenced by ccn_stuff_interest().

static void unlink_at_exit ( const char *  path  )  [static]

Definition at line 132 of file ccnd.c.

Referenced by create_local_listener().

static void update_forward_to ( struct ccnd_handle h,
struct nameprefix_entry npe 
) [static]

Recompute the contents of npe->forward_to and npe->flags from forwarding lists of npe and all of its ancestors.

Definition at line 2837 of file ccnd.c.

Referenced by get_outbound_faces(), match_interests(), and replan_propagation().


Variable Documentation

const char* unlink_this_at_exit = NULL [static]

Definition at line 93 of file ccnd.c.

Referenced by check_comm_file(), cleanup_at_exit(), comm_file_ok(), and unlink_at_exit().

Generated on Fri May 13 16:27:06 2011 for Content-Centric Networking in C by  doxygen 1.6.3