CCNx-Android-Services/jni/csrc/ccnr/ccnr_util.c File Reference

Part of ccnr - CCNx Repository Daemon. More...

#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <netdb.h>
#include <poll.h>
#include <signal.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <ccn/bloom.h>
#include <ccn/ccn.h>
#include <ccn/ccn_private.h>
#include <ccn/charbuf.h>
#include <ccn/face_mgmt.h>
#include <ccn/hashtb.h>
#include <ccn/indexbuf.h>
#include <ccn/schedule.h>
#include <ccn/reg_mgmt.h>
#include <ccn/uri.h>
#include "ccnr_private.h"
#include "ccnr_util.h"

Functions

PUBLIC struct ccn_charbuf * r_util_charbuf_obtain (struct ccnr_handle *h)
PUBLIC void r_util_charbuf_release (struct ccnr_handle *h, struct ccn_charbuf *c)
PUBLIC struct ccn_indexbuf * r_util_indexbuf_obtain (struct ccnr_handle *h)
PUBLIC void r_util_indexbuf_release (struct ccnr_handle *h, struct ccn_indexbuf *c)
PUBLIC void r_util_reseed (struct ccnr_handle *h)
PUBLIC void r_util_gettime (const struct ccn_gettime *self, struct ccn_timeval *result)
PUBLIC int r_util_timecmp (long secA, unsigned usecA, long secB, unsigned usecB)
PUBLIC intmax_t r_util_segment_from_component (const unsigned char *ccnb, size_t start, size_t stop)
int r_util_name_comp_compare (const unsigned char *data, const struct ccn_indexbuf *indexbuf, unsigned int i, const void *buf, size_t length)
 Compare a name component at index i to bytes in buf and return 0 if they are equal length and equal value.
PUBLIC int r_util_is_final_pco (const unsigned char *ccnb, struct ccn_parsed_ContentObject *pco, struct ccn_indexbuf *comps)
 Given a ccnb encoded content object, the parsed form, and name components report whether this is the last (FinalBlockID) segment of a stream.


Detailed Description

Part of ccnr - CCNx Repository Daemon.


Function Documentation

PUBLIC int r_util_is_final_pco ( const unsigned char *  ccnb,
struct ccn_parsed_ContentObject *  pco,
struct ccn_indexbuf *  comps 
)

Given a ccnb encoded content object, the parsed form, and name components report whether this is the last (FinalBlockID) segment of a stream.

This is very similar to ccn_is_final_block()

int r_util_name_comp_compare ( const unsigned char *  data,
const struct ccn_indexbuf *  indexbuf,
unsigned int  i,
const void *  buf,
size_t  length 
)

Compare a name component at index i to bytes in buf and return 0 if they are equal length and equal value.

In the case of inequality, a negative or positive value is returned, according to the canonical ordering of names.


Generated on Thu Feb 16 00:45:13 2012 for CCNx for Android by  doxygen 1.5.6