ccnr_proto.h File Reference

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

Go to the source code of this file.

Data Structures

struct  ccnr_parsed_policy
struct  ccnr_expect_content

Defines

#define REPO_SW   "\xC1.R.sw"
#define REPO_SWC   "\xC1.R.sw-c"
#define REPO_AF   "\xC1.R.af"
#define NAME_BE   "\xC1.E.be"
#define CCNR_PIPELINE   4

Functions

void r_proto_init (struct ccnr_handle *ccnr)
void r_proto_uri_listen (struct ccnr_handle *ccnr, struct ccn *ccn, const char *uri, ccn_handler p, intptr_t intdata)
int r_proto_append_repo_info (struct ccnr_handle *ccnr, struct ccn_charbuf *rinfo, struct ccn_charbuf *names, const char *info)
 Construct a charbuf with an encoding of a RepositoryInfo.
int r_proto_policy_append_basic (struct ccnr_handle *ccnr, struct ccn_charbuf *policy, const char *version, const char *local_name, const char *global_prefix)
int r_proto_policy_append_namespace (struct ccnr_handle *ccnr, struct ccn_charbuf *policy, const char *namespace)
enum ccn_upcall_res r_proto_expect_content (struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info)
int r_proto_parse_policy (struct ccnr_handle *ccnr, const unsigned char *buf, size_t length, struct ccnr_parsed_policy *pp)
 Parse a ccnb-encoded policy content object and fill in a ccn_parsed_policy structure as the result.
void r_proto_activate_policy (struct ccnr_handle *ccnr, struct ccnr_parsed_policy *pp)
 Install the listener for the namespaces that the parsed policy says to serve.
void r_proto_deactivate_policy (struct ccnr_handle *ccnr, struct ccnr_parsed_policy *pp)
 Uninstall the listener for the namespaces that the parsed policy says to serve.
int r_proto_initiate_key_fetch (struct ccnr_handle *ccnr, const unsigned char *msg, struct ccn_parsed_ContentObject *pco, int use_link, ccnr_cookie a)
 Initiate a key fetch if necessary.


Detailed Description

Part of ccnr - CCNx Repository Daemon.

Definition in file ccnr_proto.h.


Define Documentation

#define CCNR_PIPELINE   4

#define NAME_BE   "\xC1.E.be"

Definition at line 31 of file ccnr_proto.h.

Referenced by r_proto_answer_req().

#define REPO_AF   "\xC1.R.af"

Definition at line 30 of file ccnr_proto.h.

Referenced by r_proto_answer_req(), and r_proto_bulk_import().

#define REPO_SW   "\xC1.R.sw"

Definition at line 28 of file ccnr_proto.h.

Referenced by r_proto_answer_req().

#define REPO_SWC   "\xC1.R.sw-c"

Definition at line 29 of file ccnr_proto.h.

Referenced by r_proto_answer_req().


Function Documentation

void r_proto_activate_policy ( struct ccnr_handle ccnr,
struct ccnr_parsed_policy pp 
)

Install the listener for the namespaces that the parsed policy says to serve.

Normal usage is to deactivate the old policy and then activate the new one

Definition at line 249 of file ccnr_proto.c.

Referenced by r_init_create(), and r_proto_policy_update().

int r_proto_append_repo_info ( struct ccnr_handle ccnr,
struct ccn_charbuf rinfo,
struct ccn_charbuf names,
const char *  info 
)

Construct a charbuf with an encoding of a RepositoryInfo.

Definition at line 296 of file ccnr_proto.c.

Referenced by r_proto_bulk_import(), r_proto_start_write(), and r_proto_start_write_checked().

void r_proto_deactivate_policy ( struct ccnr_handle ccnr,
struct ccnr_parsed_policy pp 
)

Uninstall the listener for the namespaces that the parsed policy says to serve.

Definition at line 271 of file ccnr_proto.c.

Referenced by r_proto_policy_update().

enum ccn_upcall_res r_proto_expect_content ( struct ccn_closure selfp,
enum ccn_upcall_kind  kind,
struct ccn_upcall_info info 
)

Definition at line 339 of file ccnr_proto.c.

Referenced by r_proto_initiate_key_fetch(), and r_proto_start_write().

void r_proto_init ( struct ccnr_handle ccnr  ) 

Definition at line 240 of file ccnr_proto.c.

Referenced by r_init_create().

int r_proto_initiate_key_fetch ( struct ccnr_handle ccnr,
const unsigned char *  msg,
struct ccn_parsed_ContentObject pco,
int  use_link,
ccnr_cookie  a 
)

Initiate a key fetch if necessary.

Returns:
-1 if error or no name, 0 if fetch was issued, 1 if already stored.

Definition at line 1454 of file ccnr_proto.c.

Referenced by r_proto_expect_content(), and r_sync_upcall_store().

int r_proto_parse_policy ( struct ccnr_handle ccnr,
const unsigned char *  buf,
size_t  length,
struct ccnr_parsed_policy pp 
)

Parse a ccnb-encoded policy content object and fill in a ccn_parsed_policy structure as the result.

Definition at line 1426 of file ccnr_proto.c.

Referenced by load_policy(), and r_proto_policy_update().

int r_proto_policy_append_basic ( struct ccnr_handle ccnr,
struct ccn_charbuf policy,
const char *  version,
const char *  local_name,
const char *  global_prefix 
)

Definition at line 1394 of file ccnr_proto.c.

Referenced by load_policy().

int r_proto_policy_append_namespace ( struct ccnr_handle ccnr,
struct ccn_charbuf policy,
const char *  namespace 
)

Definition at line 1408 of file ccnr_proto.c.

Referenced by load_policy().

void r_proto_uri_listen ( struct ccnr_handle ccnr,
struct ccn *  ccn,
const char *  uri,
ccn_handler  p,
intptr_t  intdata 
)

Definition at line 220 of file ccnr_proto.c.

Referenced by r_proto_activate_policy(), and r_proto_deactivate_policy().


Generated on Thu Feb 16 00:44:07 2012 for Content-Centric Networking in C by  doxygen 1.5.6