Go to the source code of this file.
Data Structures | |
struct | ccn_closure |
Handle for upcalls that allow clients receive notifications of incoming interests and content. More... | |
struct | ccn_upcall_info |
Additional information provided in the upcall. More... | |
struct | ccn_buf_decoder |
struct | ccn_parsed_interest |
struct | ccn_parsed_Link |
struct | ccn_parsed_ContentObject |
struct | ccn_signing_params |
Parameters for creating signed content objects. More... | |
Defines | |
#define | CCN_API_VERSION 5000 |
A macro that clients may use to cope with an evolving API. | |
#define | CCN_INTEREST_LIFETIME_SEC 4 |
Interest lifetime default. | |
#define | CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000) |
#define | CCN_GET_NOKEYWAIT 1 |
#define | CCN_AOK_CS 0x1 |
#define | CCN_AOK_NEW 0x2 |
#define | CCN_AOK_DEFAULT (CCN_AOK_CS | CCN_AOK_NEW) |
#define | CCN_AOK_STALE 0x4 |
#define | CCN_AOK_EXPIRE 0x10 |
#define | CCN_SIGNING_PARAMS_INIT { CCN_API_VERSION, 0, NULL, {0}, CCN_CONTENT_DATA, -1 } |
#define | CCN_SP_TEMPL_TIMESTAMP 0x0001 |
#define | CCN_SP_TEMPL_FINAL_BLOCK_ID 0x0002 |
#define | CCN_SP_TEMPL_FRESHNESS 0x0004 |
#define | CCN_SP_TEMPL_KEY_LOCATOR 0x0008 |
#define | CCN_SP_FINAL_BLOCK 0x0010 |
#define | CCN_SP_OMIT_KEY_LOCATOR 0x0020 |
#define | CCN_V_REPLACE 1 |
Versioning. | |
#define | CCN_V_LOW 2 |
look for early version | |
#define | CCN_V_HIGH 4 |
look for newer version | |
#define | CCN_V_EST 8 |
look for extreme | |
#define | CCN_V_LOWEST (2|8) |
#define | CCN_V_HIGHEST (4|8) |
#define | CCN_V_NEXT (4|1) |
#define | CCN_V_PREV (2|1) |
#define | CCN_V_NOW 16 |
use current time | |
#define | CCN_V_NESTOK 32 |
version within version is ok | |
Enumerations | |
enum | ccn_upcall_kind { CCN_UPCALL_FINAL, CCN_UPCALL_INTEREST, CCN_UPCALL_CONSUMED_INTEREST, CCN_UPCALL_CONTENT, CCN_UPCALL_INTEREST_TIMED_OUT, CCN_UPCALL_CONTENT_UNVERIFIED, CCN_UPCALL_CONTENT_BAD, CCN_UPCALL_CONTENT_KEYMISSING, CCN_UPCALL_CONTENT_RAW } |
This tells what kind of event the upcall is handling. More... | |
enum | ccn_upcall_res { CCN_UPCALL_RESULT_ERR = -1, CCN_UPCALL_RESULT_OK = 0, CCN_UPCALL_RESULT_REEXPRESS = 1, CCN_UPCALL_RESULT_INTEREST_CONSUMED = 2, CCN_UPCALL_RESULT_VERIFY = 3, CCN_UPCALL_RESULT_FETCHKEY = 4 } |
Upcalls return one of these values. More... | |
enum | ccn_marker { CCN_MARKER_NONE = -1, CCN_MARKER_SEQNUM = 0x00, CCN_MARKER_CONTROL = 0xC1, CCN_MARKER_OSEQNUM = 0xF8, CCN_MARKER_BLKID = 0xFB, CCN_MARKER_VERSION = 0xFD } |
enum | ccn_content_type { CCN_CONTENT_DATA = 0x0C04C0, CCN_CONTENT_ENCR = 0x10D091, CCN_CONTENT_GONE = 0x18E344, CCN_CONTENT_KEY = 0x28463F, CCN_CONTENT_LINK = 0x2C834A, CCN_CONTENT_NACK = 0x34008A } |
enum | ccn_parsed_interest_offsetid { CCN_PI_B_Name, CCN_PI_B_Component0, CCN_PI_B_LastPrefixComponent, CCN_PI_E_LastPrefixComponent, CCN_PI_E_ComponentLast = CCN_PI_E_LastPrefixComponent, CCN_PI_E_Name, CCN_PI_B_MinSuffixComponents, CCN_PI_E_MinSuffixComponents, CCN_PI_B_MaxSuffixComponents, CCN_PI_E_MaxSuffixComponents, CCN_PI_B_PublisherID, CCN_PI_B_PublisherIDKeyDigest, CCN_PI_E_PublisherIDKeyDigest, CCN_PI_E_PublisherID, CCN_PI_B_Exclude, CCN_PI_E_Exclude, CCN_PI_B_ChildSelector, CCN_PI_E_ChildSelector, CCN_PI_B_AnswerOriginKind, CCN_PI_E_AnswerOriginKind, CCN_PI_B_Scope, CCN_PI_E_Scope, CCN_PI_B_InterestLifetime, CCN_PI_E_InterestLifetime, CCN_PI_B_Nonce, CCN_PI_E_Nonce, CCN_PI_B_OTHER, CCN_PI_E_OTHER, CCN_PI_E } |
enum | ccn_parsed_Link_offsetid { CCN_PL_B_Name, CCN_PL_B_Component0, CCN_PL_E_ComponentLast, CCN_PL_E_Name, CCN_PL_B_Label, CCN_PL_E_Label, CCN_PL_B_LinkAuthenticator, CCN_PL_B_PublisherID, CCN_PL_B_PublisherDigest, CCN_PL_E_PublisherDigest, CCN_PL_E_PublisherID, CCN_PL_B_NameComponentCount, CCN_PL_E_NameComponentCount, CCN_PL_B_Timestamp, CCN_PL_E_Timestamp, CCN_PL_B_Type, CCN_PL_E_Type, CCN_PL_B_ContentDigest, CCN_PL_E_ContentDigest, CCN_PL_E_LinkAuthenticator, CCN_PL_E } |
enum | ccn_parsed_content_object_offsetid { CCN_PCO_B_Signature, CCN_PCO_B_DigestAlgorithm, CCN_PCO_E_DigestAlgorithm, CCN_PCO_B_Witness, CCN_PCO_E_Witness, CCN_PCO_B_SignatureBits, CCN_PCO_E_SignatureBits, CCN_PCO_E_Signature, CCN_PCO_B_Name, CCN_PCO_B_Component0, CCN_PCO_E_ComponentN, CCN_PCO_E_ComponentLast = CCN_PCO_E_ComponentN, CCN_PCO_E_Name, CCN_PCO_B_SignedInfo, CCN_PCO_B_PublisherPublicKeyDigest, CCN_PCO_E_PublisherPublicKeyDigest, CCN_PCO_B_Timestamp, CCN_PCO_E_Timestamp, CCN_PCO_B_Type, CCN_PCO_E_Type, CCN_PCO_B_FreshnessSeconds, CCN_PCO_E_FreshnessSeconds, CCN_PCO_B_FinalBlockID, CCN_PCO_E_FinalBlockID, CCN_PCO_B_KeyLocator, CCN_PCO_B_Key_Certificate_KeyName, CCN_PCO_B_KeyName_Name, CCN_PCO_E_KeyName_Name, CCN_PCO_B_KeyName_Pub, CCN_PCO_E_KeyName_Pub, CCN_PCO_E_Key_Certificate_KeyName, CCN_PCO_E_KeyLocator, CCN_PCO_E_SignedInfo, CCN_PCO_B_Content, CCN_PCO_E_Content, CCN_PCO_E } |
Functions | |
struct ccn * | ccn_create (void) |
Create a client handle. | |
int | ccn_connect (struct ccn *h, const char *name) |
Connect to local ccnd. | |
int | ccn_get_connection_fd (struct ccn *h) |
int | ccn_disconnect (struct ccn *h) |
void | ccn_destroy (struct ccn **hp) |
int | ccn_defer_verification (struct ccn *h, int defer) |
Tell the library to defer verification. | |
int | ccn_name_init (struct ccn_charbuf *c) |
Reset charbuf to represent an empty Name in binary format. | |
int | ccn_name_append (struct ccn_charbuf *c, const void *component, size_t n) |
Add a Component to a Name. | |
int | ccn_name_append_str (struct ccn_charbuf *c, const char *s) |
Add a Component that is a NUL-terminated string. | |
int | ccn_name_append_components (struct ccn_charbuf *c, const unsigned char *ccnb, size_t start, size_t stop) |
Add sequence of ccnb-encoded Components to a ccnb-encoded Name. | |
int | ccn_name_append_numeric (struct ccn_charbuf *c, enum ccn_marker tag, uintmax_t value) |
Add a binary Component to a ccnb-encoded Name. | |
int | ccn_name_append_nonce (struct ccn_charbuf *c) |
Add nonce Component to ccnb-encoded Name. | |
int | ccn_name_split (const struct ccn_charbuf *c, struct ccn_indexbuf *components) |
Find Component boundaries in a ccnb-encoded Name. | |
int | ccn_name_chop (struct ccn_charbuf *c, struct ccn_indexbuf *components, int n) |
Chop the name down to n components. | |
int | ccn_express_interest (struct ccn *h, struct ccn_charbuf *namebuf, struct ccn_closure *action, struct ccn_charbuf *interest_template) |
int | ccn_set_interest_filter (struct ccn *h, struct ccn_charbuf *namebuf, struct ccn_closure *action) |
int | ccn_set_interest_filter_with_flags (struct ccn *h, struct ccn_charbuf *namebuf, struct ccn_closure *action, int forw_flags) |
int | ccn_put (struct ccn *h, const void *p, size_t length) |
int | ccn_output_is_pending (struct ccn *h) |
int | ccn_run (struct ccn *h, int timeout) |
Run the ccn client event loop. | |
int | ccn_set_run_timeout (struct ccn *h, int timeout) |
Modify ccn_run timeout. | |
int | ccn_get (struct ccn *h, struct ccn_charbuf *name, struct ccn_charbuf *interest_template, int timeout_ms, struct ccn_charbuf *resultbuf, struct ccn_parsed_ContentObject *pcobuf, struct ccn_indexbuf *compsbuf, int flags) |
Get a single matching ContentObject This is a convenience for getting a single matching ContentObject. | |
int | ccn_verify_content (struct ccn *h, const unsigned char *msg, struct ccn_parsed_ContentObject *pco) |
Verify a ContentObject using the public key from either the object itself or our cache of keys. | |
struct ccn_buf_decoder * | ccn_buf_decoder_start (struct ccn_buf_decoder *d, const unsigned char *buf, size_t size) |
void | ccn_buf_advance (struct ccn_buf_decoder *d) |
int | ccn_buf_advance_past_element (struct ccn_buf_decoder *d) |
int | ccn_buf_match_dtag (struct ccn_buf_decoder *d, enum ccn_dtag dtag) |
int | ccn_buf_match_some_dtag (struct ccn_buf_decoder *d) |
int | ccn_buf_match_some_blob (struct ccn_buf_decoder *d) |
int | ccn_buf_match_blob (struct ccn_buf_decoder *d, const unsigned char **bufp, size_t *sizep) |
int | ccn_buf_match_udata (struct ccn_buf_decoder *d, const char *s) |
int | ccn_buf_match_attr (struct ccn_buf_decoder *d, const char *s) |
int | ccn_parse_required_tagged_BLOB (struct ccn_buf_decoder *d, enum ccn_dtag dtag, int minlen, int maxlen) |
int | ccn_parse_optional_tagged_BLOB (struct ccn_buf_decoder *d, enum ccn_dtag dtag, int minlen, int maxlen) |
int | ccn_parse_nonNegativeInteger (struct ccn_buf_decoder *d) |
int | ccn_parse_optional_tagged_nonNegativeInteger (struct ccn_buf_decoder *d, enum ccn_dtag dtag) |
int | ccn_parse_uintmax (struct ccn_buf_decoder *d, uintmax_t *result) |
Parse a potentially large non-negative integer. | |
int | ccn_parse_tagged_string (struct ccn_buf_decoder *d, enum ccn_dtag dtag, struct ccn_charbuf *store) |
Parses a ccnb-encoded element expected to contain a UDATA string. | |
uintmax_t | ccn_parse_required_tagged_binary_number (struct ccn_buf_decoder *d, enum ccn_dtag dtag, int minlen, int maxlen) |
uintmax_t | ccn_parse_optional_tagged_binary_number (struct ccn_buf_decoder *d, enum ccn_dtag dtag, int minlen, int maxlen, uintmax_t default_value) |
void | ccn_buf_check_close (struct ccn_buf_decoder *d) |
Enter an error state if element closer not found. | |
int | ccn_ref_tagged_BLOB (enum ccn_dtag tt, const unsigned char *buf, size_t start, size_t stop, const unsigned char **presult, size_t *psize) |
int | ccn_fetch_tagged_nonNegativeInteger (enum ccn_dtag tt, const unsigned char *buf, size_t start, size_t stop) |
int | ccn_parse_Link (struct ccn_buf_decoder *d, struct ccn_parsed_Link *link, struct ccn_indexbuf *components) |
int | ccnb_append_Link (struct ccn_charbuf *buf, const struct ccn_charbuf *name, const char *label, const struct ccn_charbuf *linkAuthenticator) |
Append a representation of a Link to a charbuf. | |
int | ccn_parse_LinkAuthenticator (struct ccn_buf_decoder *d, struct ccn_parsed_Link *link) |
int | ccn_parse_Collection_start (struct ccn_buf_decoder *d) |
int | ccn_parse_Collection_next (struct ccn_buf_decoder *d, struct ccn_parsed_Link *link, struct ccn_indexbuf *components) |
int | ccn_parse_interest (const unsigned char *msg, size_t size, struct ccn_parsed_interest *interest, struct ccn_indexbuf *components) |
intmax_t | ccn_interest_lifetime (const unsigned char *msg, const struct ccn_parsed_interest *pi) |
int | ccn_interest_lifetime_seconds (const unsigned char *msg, const struct ccn_parsed_interest *pi) |
int | ccn_parse_ContentObject (const unsigned char *msg, size_t size, struct ccn_parsed_ContentObject *x, struct ccn_indexbuf *components) |
void | ccn_digest_ContentObject (const unsigned char *msg, struct ccn_parsed_ContentObject *pc) |
Compute the digest of the entire ContentObject if necessary, caching the result in pc->digest, pc->digest_bytes. | |
int | ccn_parse_Name (struct ccn_buf_decoder *d, struct ccn_indexbuf *components) |
Parses a ccnb-encoded name. | |
int | ccn_compare_names (const unsigned char *a, size_t asize, const unsigned char *b, size_t bsize) |
int | ccn_name_comp_strcmp (const unsigned char *data, const struct ccn_indexbuf *indexbuf, unsigned int i, const char *val) |
int | ccn_name_comp_get (const unsigned char *data, const struct ccn_indexbuf *indexbuf, unsigned int i, const unsigned char **comp, size_t *size) |
Extract a pointer to and size of component at given index i. | |
int | ccn_name_next_sibling (struct ccn_charbuf *c) |
Advance the last Component of a Name to the next possible value. | |
int | ccn_content_get_value (const unsigned char *data, size_t data_size, const struct ccn_parsed_ContentObject *content, const unsigned char **value, size_t *size) |
int | ccn_is_final_block (struct ccn_upcall_info *info) |
Check whether content described by info is final block. | |
int | ccn_sign_content (struct ccn *h, struct ccn_charbuf *resultbuf, const struct ccn_charbuf *name_prefix, const struct ccn_signing_params *params, const void *data, size_t size) |
Create a signed ContentObject. | |
int | ccn_load_private_key (struct ccn *h, const char *keystore_path, const char *keystore_passphrase, struct ccn_charbuf *pubid_out) |
Load a private key from a keystore file. | |
int | ccn_load_default_key (struct ccn *h, const char *keystore_path, const char *keystore_passphrase) |
Load the handle's default signing key from a keystore. | |
int | ccn_get_public_key (struct ccn *h, const struct ccn_signing_params *params, struct ccn_charbuf *digest_result, struct ccn_charbuf *result) |
Place the public key associated with the params into result buffer, and its digest into digest_result. | |
int | ccn_chk_signing_params (struct ccn *h, const struct ccn_signing_params *params, struct ccn_signing_params *result, struct ccn_charbuf **ptimestamp, struct ccn_charbuf **pfinalblockid, struct ccn_charbuf **pkeylocator) |
This is mostly for use within the library, but may be useful for some clients. | |
int | ccn_signed_info_create (struct ccn_charbuf *c, const void *publisher_key_id, size_t publisher_key_id_size, const struct ccn_charbuf *timestamp, enum ccn_content_type type, int freshness, const struct ccn_charbuf *finalblockid, const struct ccn_charbuf *key_locator) |
Create SignedInfo. | |
int | ccn_encode_ContentObject (struct ccn_charbuf *buf, const struct ccn_charbuf *Name, const struct ccn_charbuf *SignedInfo, const void *data, size_t size, const char *digest_algorithm, const struct ccn_pkey *private_key) |
Encode and sign a ContentObject. | |
int | ccn_content_matches_interest (const unsigned char *content_object, size_t content_object_size, int implicit_content_digest, struct ccn_parsed_ContentObject *pc, const unsigned char *interest_msg, size_t interest_msg_size, const struct ccn_parsed_interest *pi) |
Test for a match between a ContentObject and an Interest. | |
int | ccn_encode_StatusResponse (struct ccn_charbuf *buf, int errcode, const char *errtext) |
void | ccn_perror (struct ccn *h, const char *s) |
Produce message on standard error output describing the last error encountered during a call using the given handle. | |
int | ccn_seterror (struct ccn *h, int error_code) |
Set the error code in a ccn handle. | |
int | ccn_geterror (struct ccn *h) |
Recover last error code. | |
int | ccn_charbuf_append_tt (struct ccn_charbuf *c, size_t val, enum ccn_tt tt) |
Append a ccnb start marker. | |
int | ccn_charbuf_append_closer (struct ccn_charbuf *c) |
Append a CCN_CLOSE. | |
int | ccnb_append_number (struct ccn_charbuf *c, int nni) |
Append a non-negative integer as a UDATA. | |
int | ccnb_append_timestamp_blob (struct ccn_charbuf *c, enum ccn_marker marker, intmax_t secs, int nsecs) |
Append a binary timestamp as a BLOB using the ccn binary Timestamp representation (12-bit fraction). | |
int | ccnb_append_now_blob (struct ccn_charbuf *c, enum ccn_marker marker) |
Append a binary timestamp, using the current time. | |
int | ccnb_element_begin (struct ccn_charbuf *c, enum ccn_dtag dtag) |
Append a start-of-element marker. | |
int | ccnb_element_end (struct ccn_charbuf *c) |
Append an end-of-element marker. | |
int | ccnb_append_tagged_blob (struct ccn_charbuf *c, enum ccn_dtag dtag, const void *data, size_t size) |
Append a tagged BLOB. | |
int | ccnb_tagged_putf (struct ccn_charbuf *c, enum ccn_dtag dtag, const char *fmt,...) |
Append a tagged UDATA string, with printf-style formatting. | |
int | ccn_resolve_version (struct ccn *h, struct ccn_charbuf *name, int versioning_flags, int timeout_ms) |
Resolve the version, based on existing ccn content. | |
int | ccn_create_version (struct ccn *h, struct ccn_charbuf *name, int versioning_flags, intmax_t secs, int nsecs) |
Extend a Name with a new version stamp. | |
Variables | |
enum ccn_upcall_res(* | ccn_handler )(struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
ccn_handler This is the procedure type for the closure's implementation. |
Part of the CCNx C Library.
Copyright (C) 2008-2012 Palo Alto Research Center, Inc.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Definition in file ccn.h.
#define CCN_AOK_CS 0x1 |
Definition at line 600 of file ccn.h.
Referenced by answer_passive(), ccn_parse_interest(), incoming_content(), and process_incoming_interest().
#define CCN_AOK_DEFAULT (CCN_AOK_CS | CCN_AOK_NEW) |
Definition at line 602 of file ccn.h.
Referenced by ccn_parse_interest(), local_scope_rm_template(), main(), and make_template().
#define CCN_AOK_EXPIRE 0x10 |
Definition at line 604 of file ccn.h.
Referenced by ccn_parse_interest(), local_scope_rm_template(), and process_incoming_interest().
#define CCN_AOK_NEW 0x2 |
Definition at line 601 of file ccn.h.
Referenced by ccn_parse_interest(), ccnd_answer_req(), ccnr_answer_req(), incoming_interest(), r_proto_answer_req(), and SyncInterestArrived().
#define CCN_AOK_STALE 0x4 |
Definition at line 603 of file ccn.h.
Referenced by answer_passive(), main(), make_template(), and process_incoming_interest().
#define CCN_API_VERSION 5000 |
A macro that clients may use to cope with an evolving API.
The decimal digits of this use the pattern MMVVXXX, where MM is the major release number and VV is the minor version level. XXX will be bumped when an API change is made, but it will not be directly tied to the patch level in a release number. Thus CCN_API_VERSION=1000 would have corresponded to the first public release (0.1.0), but that version did not have this macro defined.
Definition at line 40 of file ccn.h.
Referenced by collect_stats_html(), and collect_stats_xml().
#define CCN_GET_NOKEYWAIT 1 |
Definition at line 383 of file ccn.h.
Referenced by ccn_get(), ccn_resolve_version(), handle_simple_incoming_content(), and main().
#define CCN_INTEREST_LIFETIME_MICROSEC (CCN_INTEREST_LIFETIME_SEC * 1000000) |
Definition at line 48 of file ccn.h.
Referenced by ccn_construct_interest(), ccn_process_scheduled_operations(), ccnd_internal_client_start(), ccnr_direct_client_refresh(), ccnr_direct_client_start(), ccnr_internal_client_start(), do_propagate(), get_dgram_source(), and reap().
#define CCN_INTEREST_LIFETIME_SEC 4 |
Interest lifetime default.
If the interest lifetime is not explicit, this is the default value.
Definition at line 47 of file ccn.h.
Referenced by ccn_interest_lifetime(), ccn_update_refresh_us(), and main().
#define CCN_SIGNING_PARAMS_INIT { CCN_API_VERSION, 0, NULL, {0}, CCN_CONTENT_DATA, -1 } |
Definition at line 803 of file ccn.h.
Referenced by ccn_get_public_key(), ccn_sign_content(), ccnd_answer_req(), ccnd_init_internal_keystore(), ccnd_init_service_ccnb(), ccnr_answer_req(), ccnr_init_policy_cob(), ccnr_init_policy_link_cob(), ccnr_init_repo_keystore(), ccnr_init_service_ccnb(), localStore(), main(), r_proto_bulk_import(), r_proto_continue_enumeration(), r_proto_start_write(), r_proto_start_write_checked(), seqw_next_cob(), storeHandler(), and SyncSignBuf().
#define CCN_SP_FINAL_BLOCK 0x0010 |
Definition at line 810 of file ccn.h.
Referenced by ccn_chk_signing_params(), ccn_sign_content(), ccnd_init_service_ccnb(), ccnr_init_policy_cob(), ccnr_init_policy_link_cob(), ccnr_init_service_ccnb(), localStore(), main(), r_proto_continue_enumeration(), seqw_next_cob(), storeHandler(), storeStablePoint(), SyncCacheEntryStore(), and SyncInterestArrived().
#define CCN_SP_OMIT_KEY_LOCATOR 0x0020 |
Definition at line 811 of file ccn.h.
Referenced by ccn_chk_signing_params(), and ccn_sign_content().
#define CCN_SP_TEMPL_FINAL_BLOCK_ID 0x0002 |
#define CCN_SP_TEMPL_FRESHNESS 0x0004 |
Definition at line 808 of file ccn.h.
Referenced by ccn_chk_signing_params(), main(), and SyncSignBuf().
#define CCN_SP_TEMPL_KEY_LOCATOR 0x0008 |
Definition at line 809 of file ccn.h.
Referenced by ccn_chk_signing_params(), ccnd_init_service_ccnb(), ccnr_init_service_ccnb(), and main().
#define CCN_SP_TEMPL_TIMESTAMP 0x0001 |
#define CCN_V_EST 8 |
#define CCN_V_HIGH 4 |
look for newer version
Definition at line 974 of file ccn.h.
Referenced by ccn_create_version(), ccn_resolve_version(), getFile(), and main().
#define CCN_V_HIGHEST (4|8) |
#define CCN_V_NESTOK 32 |
version within version is ok
Definition at line 981 of file ccn.h.
Referenced by ccn_create_version(), and ccn_resolve_version().
#define CCN_V_NOW 16 |
use current time
Definition at line 980 of file ccn.h.
Referenced by ccn_create_version(), ccn_seqw_create(), ccnr_init_policy_link_cob(), localStore(), main(), putFile(), r_proto_begin_enumeration(), storeStablePoint(), SyncCacheEntryStore(), and SyncInterestArrived().
#define CCN_V_REPLACE 1 |
Versioning.
if last component is version, replace it
Definition at line 972 of file ccn.h.
Referenced by ccn_create_version(), and main().
enum ccn_content_type |
enum ccn_marker |
enum ccn_upcall_kind |
This tells what kind of event the upcall is handling.
The KEYMISSING and RAW codes are used only if deferred verification has been requested.
enum ccn_upcall_res |
Upcalls return one of these values.
void ccn_buf_advance | ( | struct ccn_buf_decoder * | d | ) |
Definition at line 40 of file ccn_buf_decoder.c.
Referenced by appendExclusions(), ccn_append_link_name(), ccn_btree_match_interest(), ccn_buf_advance_past_element(), ccn_buf_check_close(), ccn_buf_decoder_start_at_components(), ccn_check_namebuf(), ccn_chk_signing_params(), ccn_compare_names(), ccn_content_matches_interest(), ccn_face_instance_parse(), ccn_fetch_tagged_nonNegativeInteger(), ccn_flatname_append_from_ccnb(), ccn_forwarding_entry_parse(), ccn_header_parse(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_Collection_start(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_interest(), ccn_parse_KeyName(), ccn_parse_Link(), ccn_parse_LinkAuthenticator(), ccn_parse_Name(), ccn_parse_nonNegativeInteger(), ccn_parse_optional_Any_or_Bloom(), ccn_parse_optional_tagged_nonNegativeInteger(), ccn_parse_PublisherID(), ccn_parse_required_tagged_binary_number(), ccn_parse_required_tagged_BLOB(), ccn_parse_required_tagged_timestamp(), ccn_parse_required_tagged_UDATA(), ccn_parse_Signature(), ccn_parse_SignedInfo(), ccn_parse_tagged_required_uintmax(), ccn_parse_tagged_string(), ccn_parse_timestamp(), ccn_parse_uintmax(), ccn_pubid_matches(), ccn_ref_tagged_BLOB(), ccn_uri_append(), fetchStablePoint(), find_first_match_candidate(), make_template(), r_proto_check_exclude(), r_proto_initiate_key_fetch(), r_proto_parse_policy(), r_store_find_first_match_candidate(), reportExclude(), SyncAppendAllComponents(), SyncAppendElementInner(), SyncCmpNamesInner(), SyncComponentCount(), SyncComponentMatch(), SyncGetComponentPtr(), SyncGetHashPtr(), SyncParseComposite(), SyncParseName(), SyncParseUnsigned(), SyncPatternMatch(), SyncPrefixMatch(), and SyncRootDecodeAndAdd().
int ccn_buf_advance_past_element | ( | struct ccn_buf_decoder * | d | ) |
Definition at line 119 of file ccn_buf_decoder.c.
Referenced by ccn_chk_signing_params(), ccn_flatname_append_from_ccnb(), ccn_uri_append(), find_first_match_candidate(), and r_store_find_first_match_candidate().
void ccn_buf_check_close | ( | struct ccn_buf_decoder * | d | ) |
Enter an error state if element closer not found.
Definition at line 108 of file ccn_buf_decoder.c.
Referenced by ccn_append_link_name(), ccn_btree_match_interest(), ccn_buf_advance_past_element(), ccn_check_namebuf(), ccn_chk_signing_params(), ccn_compare_names(), ccn_content_matches_interest(), ccn_face_instance_parse(), ccn_fetch_tagged_nonNegativeInteger(), ccn_flatname_append_from_ccnb(), ccn_forwarding_entry_parse(), ccn_header_parse(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_Collection_next(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_interest(), ccn_parse_KeyName(), ccn_parse_Link(), ccn_parse_LinkAuthenticator(), ccn_parse_Name(), ccn_parse_optional_Any_or_Bloom(), ccn_parse_optional_tagged_nonNegativeInteger(), ccn_parse_PublisherID(), ccn_parse_required_tagged_binary_number(), ccn_parse_required_tagged_BLOB(), ccn_parse_required_tagged_timestamp(), ccn_parse_required_tagged_UDATA(), ccn_parse_Signature(), ccn_parse_SignedInfo(), ccn_parse_tagged_required_uintmax(), ccn_parse_tagged_string(), ccn_ref_tagged_BLOB(), ccn_uri_append(), find_first_match_candidate(), make_template(), r_proto_check_exclude(), r_proto_initiate_key_fetch(), r_proto_parse_policy(), r_store_find_first_match_candidate(), reportExclude(), SyncAppendAllComponents(), SyncAppendElementInner(), SyncCmpNamesInner(), SyncComponentCount(), SyncComponentMatch(), SyncGetComponentPtr(), SyncGetHashPtr(), SyncParseComposite(), SyncParseName(), SyncParseUnsigned(), SyncPatternMatch(), SyncPrefixMatch(), and SyncRootDecodeAndAdd().
struct ccn_buf_decoder* ccn_buf_decoder_start | ( | struct ccn_buf_decoder * | d, | |
const unsigned char * | buf, | |||
size_t | size | |||
) | [read] |
Definition at line 28 of file ccn_buf_decoder.c.
Referenced by ccn_append_link_name(), ccn_btree_match_interest(), ccn_buf_decoder_start_at_components(), ccn_check_namebuf(), ccn_chk_signing_params(), ccn_content_matches_interest(), ccn_face_instance_parse(), ccn_fetch_tagged_nonNegativeInteger(), ccn_flatname_append_from_ccnb(), ccn_forwarding_entry_parse(), ccn_get_public_key(), ccn_header_parse(), ccn_interest_lifetime(), ccn_locate_key(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_name_split(), ccn_parse_ContentObject(), ccn_parse_interest(), ccn_pubid_matches(), ccn_ref_tagged_BLOB(), ccn_uri_append(), ccnd_reg_uri(), extractNode(), fetchStablePoint(), find_first_match_candidate(), load_policy(), main(), make_template(), process_incoming_link_message(), r_proto_check_exclude(), r_proto_initiate_key_fetch(), r_proto_parse_policy(), r_store_find_first_match_candidate(), SyncCacheEntryFetch(), SyncHandleSlice(), SyncInitDecoderFromCharbufRange(), SyncInterestArrived(), and testRootBasic().
int ccn_buf_match_attr | ( | struct ccn_buf_decoder * | d, | |
const char * | s | |||
) |
Definition at line 98 of file ccn_buf_decoder.c.
int ccn_buf_match_blob | ( | struct ccn_buf_decoder * | d, | |
const unsigned char ** | bufp, | |||
size_t * | sizep | |||
) |
Definition at line 70 of file ccn_buf_decoder.c.
Referenced by appendExclusions(), ccn_btree_match_interest(), ccn_check_namebuf(), ccn_compare_names(), ccn_content_matches_interest(), ccn_face_instance_parse(), ccn_flatname_append_from_ccnb(), ccn_forwarding_entry_parse(), ccn_get_public_key(), ccn_header_parse(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_Name(), ccn_parse_required_tagged_binary_number(), ccn_ref_tagged_BLOB(), ccn_uri_append(), fetchStablePoint(), make_template(), r_proto_check_exclude(), reportExclude(), SyncAppendAllComponents(), SyncAppendElementInner(), SyncCmpNamesInner(), SyncComponentCount(), SyncComponentMatch(), SyncGetComponentPtr(), SyncGetHashPtr(), SyncParseComposite(), SyncParseName(), SyncPatternMatch(), and SyncPrefixMatch().
int ccn_buf_match_dtag | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag | |||
) |
Definition at line 48 of file ccn_buf_decoder.c.
Referenced by appendExclusions(), ccn_append_link_name(), ccn_btree_match_interest(), ccn_buf_decoder_start_at_components(), ccn_check_namebuf(), ccn_chk_signing_params(), ccn_compare_names(), ccn_content_matches_interest(), ccn_face_instance_parse(), ccn_fetch_tagged_nonNegativeInteger(), ccn_flatname_append_from_ccnb(), ccn_forwarding_entry_parse(), ccn_header_parse(), ccn_locate_key(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_Collection_next(), ccn_parse_Collection_start(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_interest(), ccn_parse_KeyName(), ccn_parse_Link(), ccn_parse_LinkAuthenticator(), ccn_parse_Name(), ccn_parse_optional_Any_or_Bloom(), ccn_parse_optional_tagged_binary_number(), ccn_parse_optional_tagged_BLOB(), ccn_parse_optional_tagged_nonNegativeInteger(), ccn_parse_optional_tagged_UDATA(), ccn_parse_PublisherID(), ccn_parse_required_tagged_binary_number(), ccn_parse_required_tagged_BLOB(), ccn_parse_required_tagged_timestamp(), ccn_parse_required_tagged_UDATA(), ccn_parse_Signature(), ccn_parse_SignedInfo(), ccn_parse_tagged_required_uintmax(), ccn_parse_tagged_string(), ccn_ref_tagged_BLOB(), ccn_uri_append(), fetchStablePoint(), find_first_match_candidate(), main(), make_template(), r_proto_check_exclude(), r_proto_initiate_key_fetch(), r_proto_parse_policy(), r_store_find_first_match_candidate(), reportExclude(), SyncAppendAllComponents(), SyncAppendElementInner(), SyncCmpNamesInner(), SyncComponentCount(), SyncComponentMatch(), SyncExtractName(), SyncGetComponentPtr(), SyncGetHashPtr(), SyncIsName(), SyncParseComposite(), SyncParseName(), SyncParseUnsigned(), SyncPatternMatch(), SyncPrefixMatch(), and SyncRootDecodeAndAdd().
int ccn_buf_match_some_blob | ( | struct ccn_buf_decoder * | d | ) |
Definition at line 63 of file ccn_buf_decoder.c.
Referenced by ccn_buf_match_blob(), ccn_chk_signing_params(), ccn_parse_LinkAuthenticator(), ccn_parse_PublisherID(), ccn_parse_required_tagged_BLOB(), and ccn_pubid_matches().
int ccn_buf_match_some_dtag | ( | struct ccn_buf_decoder * | d | ) |
Definition at line 56 of file ccn_buf_decoder.c.
int ccn_buf_match_udata | ( | struct ccn_buf_decoder * | d, | |
const char * | s | |||
) |
Definition at line 88 of file ccn_buf_decoder.c.
int ccn_charbuf_append_closer | ( | struct ccn_charbuf * | c | ) |
Append a CCN_CLOSE.
Use this to close off an element in ccnb-encoded data.
c | is the buffer to append to. |
Definition at line 273 of file ccn_buf_encoder.c.
Referenced by answer_passive(), append_Any_filter(), append_bf_all(), append_bloom_element(), append_filter_all(), append_future_vcomp(), appendExclusions(), ccn_construct_interest(), ccn_create_version(), ccn_encode_ContentObject(), ccn_encode_Signature(), ccn_encode_StatusResponse(), ccn_initiate_key_fetch(), ccn_name_append_components(), ccn_name_from_uri(), ccn_name_init(), ccn_sign_content(), ccn_signed_info_create(), ccnb_append_Link(), ccnb_append_tagged_blob(), ccnb_element_end(), ccnb_tagged_putf(), ccnd_answer_req(), ccnd_append_plain_nonce(), ccnd_init_service_ccnb(), ccnr_answer_req(), ccnr_init_service_ccnb(), create_passive_templ(), express_bulkdata_interest(), express_my_interest(), find_first_match_candidate(), handle_key(), incoming_content(), initialize_global_data(), local_scope(), local_scope_rm_template(), main(), make_data_template(), make_template(), process_incoming_content(), r_proto_initiate_key_fetch(), r_proto_start_write(), r_proto_start_write_checked(), r_store_find_first_match_candidate(), resolve_templ(), stuff_and_send(), stuff_link_check(), SyncAppendElementInner(), SyncAppendRandomHash(), SyncAppendRandomName(), SyncGenInterest(), and SyncSignBuf().
int ccn_charbuf_append_tt | ( | struct ccn_charbuf * | c, | |
size_t | val, | |||
enum ccn_tt | tt | |||
) |
Append a ccnb start marker.
This forms the basic building block of ccnb-encoded data.
c | is the buffer to append to. | |
val | is the numval, intepreted according to tt (see enum ccn_tt). | |
tt | is the type field. |
Definition at line 255 of file ccn_buf_encoder.c.
Referenced by answer_passive(), append_Any_filter(), append_bf_all(), append_bloom_element(), append_filter_all(), append_future_vcomp(), appendExclusions(), ccn_append_link_stuff(), ccn_append_pubkey_blob(), ccn_construct_interest(), ccn_create_version(), ccn_encode_ContentObject(), ccn_encode_Signature(), ccn_encode_StatusResponse(), ccn_initiate_key_fetch(), ccn_name_append(), ccn_name_init(), ccn_sign_content(), ccn_signed_info_create(), ccnb_append_Link(), ccnb_append_number(), ccnb_append_tagged_blob(), ccnb_append_timestamp_blob(), ccnb_element_begin(), ccnb_tagged_putf(), ccnd_append_plain_nonce(), ccnd_init_service_ccnb(), ccnr_init_service_ccnb(), create_passive_templ(), express_bulkdata_interest(), express_my_interest(), handle_key(), incoming_content(), initialize_global_data(), local_scope(), local_scope_rm_template(), main(), make_data_template(), make_template(), process_incoming_content(), r_proto_initiate_key_fetch(), resolve_templ(), stuff_and_send(), stuff_link_check(), SyncAppendElementInner(), SyncAppendRandomHash(), SyncAppendRandomName(), SyncGenInterest(), and SyncSignBuf().
int ccn_chk_signing_params | ( | struct ccn * | h, | |
const struct ccn_signing_params * | params, | |||
struct ccn_signing_params * | result, | |||
struct ccn_charbuf ** | ptimestamp, | |||
struct ccn_charbuf ** | pfinalblockid, | |||
struct ccn_charbuf ** | pkeylocator | |||
) |
This is mostly for use within the library, but may be useful for some clients.
Definition at line 2142 of file ccn_client.c.
Referenced by ccn_get_public_key(), ccn_sign_content(), ccnd_init_internal_keystore(), and ccnr_init_repo_keystore().
int ccn_compare_names | ( | const unsigned char * | a, | |
size_t | asize, | |||
const unsigned char * | b, | |||
size_t | bsize | |||
) |
Definition at line 889 of file ccn_buf_decoder.c.
Referenced by content_skiplist_findbefore(), namecompare(), and r_proto_start_write().
int ccn_connect | ( | struct ccn * | h, | |
const char * | name | |||
) |
Connect to local ccnd.
h | is a ccn library handle | |
name | is the name of the unix-domain socket to connect to; use NULL to get the default. |
Definition at line 322 of file ccn_client.c.
Referenced by ccn_fetch_new(), ccn_get(), existingRootOp(), getFile(), main(), putFile(), r_init_create(), and sendSlice().
int ccn_content_get_value | ( | const unsigned char * | data, | |
size_t | data_size, | |||
const struct ccn_parsed_ContentObject * | content, | |||
const unsigned char ** | value, | |||
size_t * | size | |||
) |
Definition at line 876 of file ccn_buf_decoder.c.
Referenced by CallMe(), ccn_cache_key(), ccn_get_header(), ccnd_req_destroyface(), ccnd_req_newface(), ccnd_req_prefix_or_self_reg(), ccnd_req_unreg(), create_face(), decode_message(), extractNode(), handle_key(), handle_prefix_reg_reply(), incoming_content(), main(), process_test(), r_proto_initiate_key_fetch(), register_unregister_prefix(), SyncCacheEntryFetch(), and SyncPointerToContent().
int ccn_content_matches_interest | ( | const unsigned char * | content_object, | |
size_t | content_object_size, | |||
int | implicit_content_digest, | |||
struct ccn_parsed_ContentObject * | pc, | |||
const unsigned char * | interest_msg, | |||
size_t | interest_msg_size, | |||
const struct ccn_parsed_interest * | pi | |||
) |
Test for a match between a ContentObject and an Interest.
content_object | ccnb-encoded ContentObject | |
content_object_size | its size in bytes | |
implicit_content_digest | boolean indicating whether the final name component is implicit (as in the on-wire format) or explicit (as within ccnd's content store). | |
pc | Valid parse information may be provided to speed things up. If NULL it will be reconstructed internally. | |
interest_msg | ccnb-encoded Interest | |
interest_msg_size | its size in bytes | |
pi | see _pc_ |
Definition at line 110 of file ccn_match.c.
Referenced by ccn_dispatch_message(), ccnd_answer_req(), ccnr_answer_req(), consume_matching_interests(), incoming_interest(), interest_handler(), process_incoming_interest(), r_match_consume_matching_interests(), r_proto_begin_enumeration(), r_proto_continue_enumeration(), seqw_incoming_interest(), and SyncInterestArrived().
struct ccn* ccn_create | ( | void | ) | [read] |
Create a client handle.
The new handle is not yet connected. On error, returns NULL and sets errno. Errors: ENOMEM
Definition at line 240 of file ccn_client.c.
Referenced by ccn_fetch_new(), ccn_get(), ccnd_internal_client_start(), ccnr_direct_client_start(), ccnr_internal_client_start(), existingRootOp(), getFile(), main(), putFile(), and sendSlice().
int ccn_create_version | ( | struct ccn * | h, | |
struct ccn_charbuf * | name, | |||
int | versioning_flags, | |||
intmax_t | secs, | |||
int | nsecs | |||
) |
Extend a Name with a new version stamp.
h | is the the ccn handle. May be NULL. This procedure does not use the connection. | |
name | is a ccnb-encoded Name prefix. By default it gets extended in-place with one additional Component that conforms to the versioning profile and is based on the supplied time, unless a version component is already present. | |
versioning_flags | modifies the default behavior: CCN_V_REPLACE causes the last component to be replaced if it appears to be a version stamp. If CCN_V_HIGH is set as well, an attempt will be made to generate a new version stamp that is later than the existing one, or to return an error. CCN_V_NOW bases the version on the current time rather than the supplied time. CCN_V_NESTOK will allow the new version component to be appended even if there is one there (this makes no difference if CCN_V_REPLACE is also set). | |
secs | is the desired time, in seconds since epoch (ignored if CCN_V_NOW is set). | |
nsecs | is the number of nanoseconds. |
Definition at line 215 of file ccn_versioning.c.
Referenced by ccn_seqw_create(), ccnd_init_service_ccnb(), ccnr_init_policy_link_cob(), ccnr_init_service_ccnb(), load_policy(), localStore(), main(), putFile(), r_proto_begin_enumeration(), storeStablePoint(), SyncCacheEntryStore(), and SyncInterestArrived().
int ccn_defer_verification | ( | struct ccn * | h, | |
int | defer | |||
) |
Tell the library to defer verification.
For some specialized applications (performance testing being an example), the normal verification done within the library may be undesirable. Setting the "defer validation" flag will cause the library to pass content to the application without attempting to verify it. In this case, the CCN_UPCALL_CONTENT_RAW upcall kind will be passed instead of CCN_UPCALL_CONTENT, and CCN_UPCALL_CONTENT_KEYMISSING instead of CCN_UPCALL_CONTENT_UNVERIFIED. If the application wants do still do key fetches, it may use the CCN_UPCALL_RESULT_FETCHKEY response instead of CCN_UPCALL_RESULT_VERIFY.
Calling this while there are interests outstanding is not recommended.
This call is available beginning with CCN_API_VERSION 4004.
defer | is 0 to verify, 1 to defer, -1 to leave unchanged. |
Definition at line 302 of file ccn_client.c.
Referenced by getFile(), main(), r_init_create(), and SyncInit().
void ccn_destroy | ( | struct ccn ** | hp | ) |
Definition at line 452 of file ccn_client.c.
Referenced by ccn_fetch_destroy(), ccn_fetch_new(), ccn_get(), ccnd_internal_client_start(), ccnd_internal_client_stop(), ccnr_direct_client_start(), ccnr_direct_client_stop(), ccnr_internal_client_start(), ccnr_internal_client_stop(), existingRootOp(), getFile(), main(), putFile(), and sendSlice().
void ccn_digest_ContentObject | ( | const unsigned char * | msg, | |
struct ccn_parsed_ContentObject * | pc | |||
) |
Compute the digest of the entire ContentObject if necessary, caching the result in pc->digest, pc->digest_bytes.
Definition at line 33 of file ccn_match.c.
Referenced by ccn_content_matches_interest(), incoming_content(), process_incoming_content(), r_store_set_flatname(), and test_insert_content().
int ccn_disconnect | ( | struct ccn * | h | ) |
Definition at line 357 of file ccn_client.c.
Referenced by ccn_destroy(), ccn_fetch_destroy(), ccn_process_input(), ccn_run(), main(), r_init_create(), and r_io_shutdown_client_fd().
int ccn_encode_ContentObject | ( | struct ccn_charbuf * | buf, | |
const struct ccn_charbuf * | Name, | |||
const struct ccn_charbuf * | SignedInfo, | |||
const void * | data, | |||
size_t | size, | |||
const char * | digest_algorithm, | |||
const struct ccn_pkey * | private_key | |||
) |
Encode and sign a ContentObject.
buf | is the output buffer where encoded object is written. | |
Name | is the ccnb-encoded name from ccn_name_init and friends. | |
SignedInfo | is the ccnb-encoded info from ccn_signed_info_create. | |
data | pintes to the raw data to be encoded. | |
size | is the size, in bytes, of the raw data to be encoded. | |
digest_algorithm | may be NULL for default. | |
private_key | is the private key to use for signing. |
Definition at line 160 of file ccn_buf_encoder.c.
Referenced by ccn_sign_content(), encode_message(), and main().
int ccn_encode_StatusResponse | ( | struct ccn_charbuf * | buf, | |
int | errcode, | |||
const char * | errtext | |||
) |
int ccn_express_interest | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
struct ccn_closure * | action, | |||
struct ccn_charbuf * | interest_template | |||
) |
Definition at line 574 of file ccn_client.c.
Referenced by ask_more(), ccn_get(), ccn_initiate_ccndid_fetch(), ccn_initiate_key_fetch(), ccn_initiate_prefix_reg(), express_bulkdata_interest(), express_my_interest(), fill_holes(), handle_key(), incoming_content(), main(), NeedSegment(), r_proto_expect_content(), r_proto_initiate_key_fetch(), r_proto_start_write(), SyncSendRootAdviseInterest(), SyncStartContentFetch(), and SyncStartNodeFetch().
int ccn_fetch_tagged_nonNegativeInteger | ( | enum ccn_dtag | tt, | |
const unsigned char * | buf, | |||
size_t | start, | |||
size_t | stop | |||
) |
Definition at line 539 of file ccn_buf_decoder.c.
Referenced by r_store_set_content_timer(), and set_content_timer().
int ccn_get | ( | struct ccn * | h, | |
struct ccn_charbuf * | name, | |||
struct ccn_charbuf * | interest_template, | |||
int | timeout_ms, | |||
struct ccn_charbuf * | resultbuf, | |||
struct ccn_parsed_ContentObject * | pcobuf, | |||
struct ccn_indexbuf * | compsbuf, | |||
int | flags | |||
) |
Get a single matching ContentObject This is a convenience for getting a single matching ContentObject.
Blocks until a matching ContentObject arrives or there is a timeout.
h | is the ccn handle. If NULL or ccn_get is called from inside an upcall, a new connection will be used and upcalls from other requests will not be processed while ccn_get is active. | |
name | holds a ccnb-encoded Name | |
interest_template | conveys other fields to be used in the interest (may be NULL). | |
timeout_ms | limits the time spent waiting for an answer (milliseconds). | |
resultbuf | is updated to contain the ccnb-encoded ContentObject. | |
pcobuf | may be supplied to save the client the work of re-parsing the ContentObject; may be NULL if this information is not actually needed. | |
compsbuf | works similarly. | |
flags | - CCN_GET_NOKEYWAIT means that it is permitted to return unverified data. |
Definition at line 1697 of file ccn_client.c.
Referenced by ccn_get_header(), ccn_resolve_version(), create_face(), existingRootOp(), get_ccndid(), getFile(), localStore(), main(), putFile(), and register_unregister_prefix().
int ccn_get_connection_fd | ( | struct ccn * | h | ) |
Definition at line 351 of file ccn_client.c.
Referenced by ccnr_direct_client_refresh(), main(), r_dispatch_run(), r_init_create(), r_proto_answer_req(), r_proto_expect_content(), and r_sync_upcall_store().
int ccn_get_public_key | ( | struct ccn * | h, | |
const struct ccn_signing_params * | params, | |||
struct ccn_charbuf * | digest_result, | |||
struct ccn_charbuf * | result | |||
) |
Place the public key associated with the params into result buffer, and its digest into digest_result.
This is for one of our signing keys, not just any key. Result buffers may be NULL if the corresponding result is not wanted.
Definition at line 2090 of file ccn_client.c.
Referenced by ccnd_init_service_ccnb(), ccnr_init_policy_cob(), ccnr_init_policy_link_cob(), and ccnr_init_service_ccnb().
int ccn_geterror | ( | struct ccn * | h | ) |
Recover last error code.
h | is the ccn handle - may be NULL. |
Definition at line 187 of file ccn_client.c.
intmax_t ccn_interest_lifetime | ( | const unsigned char * | msg, | |
const struct ccn_parsed_interest * | pi | |||
) |
Definition at line 32 of file ccn_interest.c.
Referenced by ccn_construct_interest(), ccn_interest_lifetime_seconds(), main(), process_incoming_interest(), and propagate_interest().
int ccn_interest_lifetime_seconds | ( | const unsigned char * | msg, | |
const struct ccn_parsed_interest * | pi | |||
) |
Definition at line 56 of file ccn_interest.c.
Referenced by main(), process_incoming_interest(), and r_proto_begin_enumeration().
int ccn_is_final_block | ( | struct ccn_upcall_info * | info | ) |
Check whether content described by info is final block.
info | - the ccn_upcall_info describing the ContentObject |
Definition at line 2391 of file ccn_client.c.
Referenced by r_proto_expect_content().
int ccn_load_default_key | ( | struct ccn * | h, | |
const char * | keystore_path, | |||
const char * | keystore_passphrase | |||
) |
Load the handle's default signing key from a keystore.
This call is only required for applications that use something other than the user's default signing key as the handle's default. It should be called early and at most once.
h | is the ccn handle | |
keystore_path | is the pathname of the keystore file | |
keystore_passphrase | is the passphase needed to unlock the keystore |
Definition at line 2052 of file ccn_client.c.
Referenced by ccnd_init_internal_keystore(), and ccnr_init_repo_keystore().
int ccn_load_private_key | ( | struct ccn * | h, | |
const char * | keystore_path, | |||
const char * | keystore_passphrase, | |||
struct ccn_charbuf * | pubid_out | |||
) |
Load a private key from a keystore file.
This call is only required for applications that use something other than the user's default signing key.
h | is the ccn handle | |
keystore_path | is the pathname of the keystore file | |
keystore_passphrase | is the passphase needed to unlock the keystore | |
pubid_out,if | not NULL, is loaded with the digest of the public key |
Definition at line 1987 of file ccn_client.c.
Referenced by ccn_chk_signing_params(), and ccn_load_default_key().
int ccn_name_append | ( | struct ccn_charbuf * | c, | |
const void * | component, | |||
size_t | n | |||
) |
Add a Component to a Name.
The component is an arbitrary string of n octets, no escaping required.
Definition at line 50 of file ccn_name_util.c.
Referenced by ccn_get_header(), ccn_initiate_prefix_reg(), ccn_name_append_flatname(), ccn_name_append_nonce(), ccn_name_append_numeric(), ccn_name_append_str(), ccn_name_from_uri(), ccn_name_next_sibling(), ccn_resolve_version(), ccnd_init_service_ccnb(), ccnd_reg_ccnx_ccndid(), ccnd_start_notice(), ccnr_init_policy_link_cob(), ccnr_init_service_ccnb(), constructCommandPrefix(), create_face(), exclusionsFromHashList(), express_bulkdata_interest(), incoming_content(), main(), r_proto_begin_enumeration(), r_store_next_child_at_level(), register_unregister_prefix(), sendSlice(), sequenced_name(), SyncAppendAllComponents(), SyncAppendElementInner(), SyncAppendRandomName(), SyncInterestArrived(), SyncNameForIndexbuf(), SyncNameForLocalNode(), SyncSendRootAdviseInterest(), and SyncStartNodeFetch().
int ccn_name_append_components | ( | struct ccn_charbuf * | c, | |
const unsigned char * | ccnb, | |||
size_t | start, | |||
size_t | stop | |||
) |
Add sequence of ccnb-encoded Components to a ccnb-encoded Name.
start and stop are offsets from ccnb
Definition at line 131 of file ccn_name_util.c.
Referenced by age_forwarding(), ccn_initiate_prefix_reg(), ccnd_reg_prefix(), collect_forwarding_html(), collect_forwarding_xml(), incoming_content(), next_child_at_level(), r_proto_append_repo_info(), r_proto_begin_enumeration(), r_proto_bulk_import(), r_proto_continue_enumeration(), r_proto_expect_content(), r_proto_policy_complete(), r_proto_start_write(), and r_proto_start_write_checked().
int ccn_name_append_nonce | ( | struct ccn_charbuf * | c | ) |
Add nonce Component to ccnb-encoded Name.
Uses C1.N namespace.
Definition at line 114 of file ccn_name_util.c.
Referenced by localStore(), main(), and putFile().
int ccn_name_append_numeric | ( | struct ccn_charbuf * | c, | |
enum ccn_marker | marker, | |||
uintmax_t | value | |||
) |
Add a binary Component to a ccnb-encoded Name.
These are special components used for marking versions, fragments, etc.
Definition at line 90 of file ccn_name_util.c.
Referenced by incoming_content(), load_policy(), localStore(), main(), r_proto_continue_enumeration(), r_proto_expect_content(), r_proto_policy_update(), r_proto_start_write(), sequenced_name(), seqw_next_cob(), storeHandler(), storeStablePoint(), SyncCacheEntryStore(), and SyncInterestArrived().
int ccn_name_append_str | ( | struct ccn_charbuf * | c, | |
const char * | s | |||
) |
Add a Component that is a NUL-terminated string.
The component added consists of the bytes of the string without the NUL. This function is convenient for those applications that construct component names from simple strings.
Definition at line 77 of file ccn_name_util.c.
Referenced by ccn_get_header(), ccn_initiate_prefix_reg(), ccnd_start_notice(), constructCommandPrefix(), create_face(), encode_message(), existingRootOp(), fetchStablePoint(), main(), register_unregister_prefix(), sendSlice(), storeStablePoint(), and SyncNameForLocalNode().
int ccn_name_chop | ( | struct ccn_charbuf * | c, | |
struct ccn_indexbuf * | components, | |||
int | n | |||
) |
Chop the name down to n components.
c | contains a ccnb-encoded Name | |
components | may be NULL; if provided it must be consistent with some prefix of the name, and is updated accordingly. | |
n | is the number or components to leave, or, if negative, specifies how many components to remove, e.g. -1 will remove just the last component. |
Definition at line 226 of file ccn_name_util.c.
Referenced by ccn_name_chop(), ccn_name_next_sibling(), load_policy(), main(), and r_proto_policy_update().
int ccn_name_comp_get | ( | const unsigned char * | data, | |
const struct ccn_indexbuf * | indexbuf, | |||
unsigned int | i, | |||
const unsigned char ** | comp, | |||
size_t * | size | |||
) |
Extract a pointer to and size of component at given index i.
The first component is index 0.
Definition at line 152 of file ccn_name_util.c.
Referenced by ccn_name_comp_strcmp(), ccn_resolve_version(), ccn_sign_content(), ccnd_answer_req(), ccnd_uri_listen(), ccnr_answer_req(), ccnr_uri_listen(), load_policy(), name_comp_equal_prefix(), r_proto_bulk_import(), r_proto_check_exclude(), r_proto_policy_complete(), r_util_name_comp_compare(), SyncInterestArrived(), SyncNameForIndexbuf(), SyncNotifyContent(), and SyncRootAdviseResponse().
int ccn_name_comp_strcmp | ( | const unsigned char * | data, | |
const struct ccn_indexbuf * | indexbuf, | |||
unsigned int | i, | |||
const char * | val | |||
) |
int ccn_name_init | ( | struct ccn_charbuf * | c | ) |
Reset charbuf to represent an empty Name in binary format.
Definition at line 33 of file ccn_name_util.c.
Referenced by age_forwarding(), appendName(), ccn_initiate_prefix_reg(), ccn_name_from_uri(), ccn_uri_append_flatname(), ccnd_reg_prefix(), ccnd_reg_uri(), collect_forwarding_html(), collect_forwarding_xml(), constructCommandPrefix(), create_face(), encode_message(), exclusionsFromHashList(), existingRootOp(), incoming_content(), initialize_global_data(), main(), next_child_at_level(), r_match_match_interests(), r_proto_append_repo_info(), r_proto_begin_enumeration(), r_proto_bulk_import(), r_proto_continue_enumeration(), r_proto_expect_content(), r_proto_policy_complete(), r_proto_start_write(), r_proto_start_write_checked(), r_store_next_child_at_level(), r_sync_notify_content(), register_unregister_prefix(), sendSlice(), stuff_link_check(), SyncNameForIndexbuf(), SyncNameForLocalNode(), and test_flatname().
int ccn_name_next_sibling | ( | struct ccn_charbuf * | c | ) |
Advance the last Component of a Name to the next possible value.
c | contains a ccnb-encoded Name to be updated. |
Definition at line 262 of file ccn_name_util.c.
Referenced by main(), next_child_at_level(), and r_store_next_child_at_level().
int ccn_name_split | ( | const struct ccn_charbuf * | c, | |
struct ccn_indexbuf * | components | |||
) |
Find Component boundaries in a ccnb-encoded Name.
Thin veneer over ccn_parse_Name(). components arg may be NULL to just do a validity check
Definition at line 207 of file ccn_name_util.c.
Referenced by ccn_create_version(), ccn_name_chop(), ccn_name_next_sibling(), ccn_resolve_version(), ccn_sign_content(), ccnd_req_prefix_or_self_reg(), ccnd_req_unreg(), ccnd_uri_listen(), ccnr_uri_listen(), load_policy(), r_match_match_interests(), r_proto_check_exclude(), and SyncNotifyContent().
int ccn_output_is_pending | ( | struct ccn * | h | ) |
Definition at line 746 of file ccn_client.c.
Referenced by ccn_grab_buffered_output(), ccn_process_scheduled_operations(), ccn_run(), and r_io_prepare_poll_fds().
int ccn_parse_Collection_next | ( | struct ccn_buf_decoder * | d, | |
struct ccn_parsed_Link * | link, | |||
struct ccn_indexbuf * | components | |||
) |
int ccn_parse_Collection_start | ( | struct ccn_buf_decoder * | d | ) |
int ccn_parse_ContentObject | ( | const unsigned char * | msg, | |
size_t | size, | |||
struct ccn_parsed_ContentObject * | x, | |||
struct ccn_indexbuf * | components | |||
) |
Definition at line 804 of file ccn_buf_decoder.c.
Referenced by ccn_content_matches_interest(), ccn_dispatch_message(), ccnd_answer_req(), ccnd_req_destroyface(), ccnd_req_newface(), ccnd_req_prefix_or_self_reg(), ccnd_req_unreg(), ccnr_answer_req(), decode_message(), deliver_content(), interest_handler(), load_policy(), main(), process_incoming_content(), process_test(), r_proto_policy_update(), r_store_content_field_access(), r_store_set_flatname(), SyncHandleSlice(), SyncLocalRepoFetch(), SyncPointerToContent(), and test_insert_content().
int ccn_parse_interest | ( | const unsigned char * | msg, | |
size_t | size, | |||
struct ccn_parsed_interest * | interest, | |||
struct ccn_indexbuf * | components | |||
) |
Definition at line 560 of file ccn_buf_decoder.c.
Referenced by ccn_age_interest(), ccn_construct_interest(), ccn_content_matches_interest(), ccn_dispatch_message(), ccn_parse_interest(), ccnd_debug_ccnb(), ccnr_debug_ccnb(), main(), process_incoming_interest(), r_proto_begin_enumeration(), r_proto_start_write_checked(), r_sync_enumerate(), r_sync_lookup(), and testhelp_count_matches().
int ccn_parse_Link | ( | struct ccn_buf_decoder * | d, | |
struct ccn_parsed_Link * | link, | |||
struct ccn_indexbuf * | components | |||
) |
Definition at line 988 of file ccn_buf_decoder.c.
Referenced by ccn_parse_Collection_next(), ccn_parse_Link(), load_policy(), and main().
int ccn_parse_LinkAuthenticator | ( | struct ccn_buf_decoder * | d, | |
struct ccn_parsed_Link * | link | |||
) |
int ccn_parse_Name | ( | struct ccn_buf_decoder * | d, | |
struct ccn_indexbuf * | components | |||
) |
Parses a ccnb-encoded name.
d | is the decoder | |
components | may be NULL, otherwise is filled in with the Component boundary offsets |
Definition at line 288 of file ccn_buf_decoder.c.
Referenced by ccn_append_link_name(), ccn_forwarding_entry_parse(), ccn_name_split(), ccn_parse_ContentObject(), ccn_parse_interest(), ccn_parse_KeyName(), ccn_parse_Link(), ccnd_reg_uri(), and r_proto_initiate_key_fetch().
int ccn_parse_nonNegativeInteger | ( | struct ccn_buf_decoder * | d | ) |
Definition at line 389 of file ccn_buf_decoder.c.
Referenced by ccn_fetch_tagged_nonNegativeInteger(), and ccn_parse_optional_tagged_nonNegativeInteger().
uintmax_t ccn_parse_optional_tagged_binary_number | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag, | |||
int | minlen, | |||
int | maxlen, | |||
uintmax_t | default_value | |||
) |
Definition at line 204 of file ccn_buf_decoder.c.
Referenced by ccn_interest_lifetime(), ccn_parse_LinkAuthenticator(), and ccn_parse_SignedInfo().
int ccn_parse_optional_tagged_BLOB | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag, | |||
int | minlen, | |||
int | maxlen | |||
) |
Definition at line 167 of file ccn_buf_decoder.c.
Referenced by ccn_chk_signing_params(), ccn_parse_interest(), ccn_parse_LinkAuthenticator(), ccn_parse_optional_Any_or_Bloom(), ccn_parse_Signature(), and ccn_parse_SignedInfo().
int ccn_parse_optional_tagged_nonNegativeInteger | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag | |||
) |
Definition at line 525 of file ccn_buf_decoder.c.
Referenced by ccn_chk_signing_params(), ccn_face_instance_parse(), ccn_forwarding_entry_parse(), ccn_parse_interest(), ccn_parse_LinkAuthenticator(), and ccn_parse_SignedInfo().
uintmax_t ccn_parse_required_tagged_binary_number | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag, | |||
int | minlen, | |||
int | maxlen | |||
) |
Definition at line 176 of file ccn_buf_decoder.c.
Referenced by ccn_parse_optional_tagged_binary_number(), and process_incoming_link_message().
int ccn_parse_required_tagged_BLOB | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag, | |||
int | minlen, | |||
int | maxlen | |||
) |
Definition at line 142 of file ccn_buf_decoder.c.
Referenced by ccn_chk_signing_params(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_optional_tagged_BLOB(), ccn_parse_Signature(), ccn_parse_SignedInfo(), and SyncParseHash().
int ccn_parse_tagged_string | ( | struct ccn_buf_decoder * | d, | |
enum ccn_dtag | dtag, | |||
struct ccn_charbuf * | store | |||
) |
Parses a ccnb-encoded element expected to contain a UDATA string.
d | is the decoder | |
dtag | is the expected dtag value | |
store | - on success, the string value is appended to store, with null termination. |
Definition at line 253 of file ccn_buf_decoder.c.
Referenced by ccn_face_instance_parse(), ccn_forwarding_entry_parse(), and r_proto_parse_policy().
int ccn_parse_uintmax | ( | struct ccn_buf_decoder * | d, | |
uintmax_t * | result | |||
) |
Parse a potentially large non-negative integer.
Definition at line 429 of file ccn_buf_decoder.c.
Referenced by ccn_parse_tagged_required_uintmax(), and SyncParseUnsigned().
void ccn_perror | ( | struct ccn * | h, | |
const char * | s | |||
) |
Produce message on standard error output describing the last error encountered during a call using the given handle.
h | is the ccn handle - may not be NULL. | |
s | is a client-supplied message; if NULL a message will be supplied where available. |
Definition at line 141 of file ccn_client.c.
Referenced by ccn_create(), ccn_note_err(), ccn_resolve_version(), and main().
int ccn_put | ( | struct ccn * | h, | |
const void * | p, | |||
size_t | length | |||
) |
Definition at line 702 of file ccn_client.c.
Referenced by ccn_refresh_interest(), ccn_seqw_write(), ccnd_answer_req(), ccnr_answer_req(), incoming_interest(), interest_handler(), localStore(), main(), outgoing_content(), r_io_send(), r_proto_begin_enumeration(), r_proto_bulk_import(), r_proto_continue_enumeration(), r_proto_start_write(), r_proto_start_write_checked(), seqw_incoming_interest(), storeHandler(), and SyncInterestArrived().
int ccn_ref_tagged_BLOB | ( | enum ccn_dtag | tt, | |
const unsigned char * | buf, | |||
size_t | start, | |||
size_t | stop, | |||
const unsigned char ** | presult, | |||
size_t * | psize | |||
) |
Definition at line 839 of file ccn_buf_decoder.c.
Referenced by ccn_btree_insert_content(), ccn_btree_match_interest(), ccn_chk_signing_params(), ccn_content_get_value(), ccn_digest_Content(), ccn_initiate_key_fetch(), ccn_is_final_block(), ccn_locate_key(), ccn_name_next_sibling(), ccn_verify_signature(), ccnd_debug_ccnb(), ccnr_debug_ccnb(), get_ccndid(), GetNumberFromInfo(), handle_ccndid_response(), incoming_content(), incoming_interest(), is_final(), load_policy(), main(), r_proto_policy_update(), r_store_content_field_access(), r_util_is_final_pco(), r_util_segment_from_component(), and segFromInfo().
int ccn_resolve_version | ( | struct ccn * | h, | |
struct ccn_charbuf * | name, | |||
int | versioning_flags, | |||
int | timeout_ms | |||
) |
Resolve the version, based on existing ccn content.
h | is the the ccn handle; it may be NULL, but it is preferable to use the handle that the client probably already has. | |
name | is a ccnb-encoded Name prefix. It gets extended in-place with one additional Component such that it names highest extant version that can be found, subject to the supplied timeout. | |
versioning_flags | presently must be CCN_V_HIGH or CCN_V_HIGHEST, possibly combined with CCN_V_NESTOK. If CCN_V_NESTOK is not present and the ending component appears to be a version, the routine returns 0 immediately, on the assumption that an explicit version has already been provided. | |
timeout_ms | is a time value in milliseconds. This is applied per fetch attempt, so the total time may be longer by a factor that depends on the number of (ccn) hops to the source(s). |
Definition at line 124 of file ccn_versioning.c.
Referenced by ccn_fetch_open(), ccn_get_header(), getFile(), and main().
int ccn_run | ( | struct ccn * | h, | |
int | timeout | |||
) |
Run the ccn client event loop.
This may serve as the main event loop for simple apps by passing a timeout value of -1.
h | is the ccn handle. | |
timeout | is in milliseconds. |
Definition at line 1566 of file ccn_client.c.
Referenced by ccn_dump_names(), ccn_fetch_poll(), ccn_get(), getFile(), main(), putFile(), r_dispatch_process_input(), and r_link_do_deferred_write().
int ccn_set_interest_filter | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
struct ccn_closure * | action | |||
) |
Definition at line 672 of file ccn_client.c.
Referenced by ccn_seqw_close(), ccn_seqw_create(), ccnd_uri_listen(), ccnr_uri_listen(), main(), putFile(), r_proto_uri_listen(), and SyncRegisterInterest().
int ccn_set_interest_filter_with_flags | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
struct ccn_closure * | action, | |||
int | forw_flags | |||
) |
int ccn_set_run_timeout | ( | struct ccn * | h, | |
int | timeout | |||
) |
Modify ccn_run timeout.
This may be called from an upcall to change the timeout value. Most often this will be used to set the timeout to zero so that ccn_run will return control to the client.
h | is the ccn handle. | |
timeout | is in milliseconds. |
Definition at line 1550 of file ccn_client.c.
Referenced by CallMe(), handle_simple_incoming_content(), incoming_content(), and incoming_interest().
int ccn_seterror | ( | struct ccn * | h, | |
int | error_code | |||
) |
Set the error code in a ccn handle.
h | is the ccn handle - may be NULL. | |
error_code | is the code to set. |
Definition at line 170 of file ccn_client.c.
Referenced by ccn_resolve_version(), and ccn_seqw_write().
int ccn_sign_content | ( | struct ccn * | h, | |
struct ccn_charbuf * | resultbuf, | |||
const struct ccn_charbuf * | name_prefix, | |||
const struct ccn_signing_params * | params, | |||
const void * | data, | |||
size_t | size | |||
) |
Create a signed ContentObject.
h | is the ccn handle | |
resultbuf | - result buffer to which the ContentObject will be appended | |
name_prefix | contains the ccnb-encoded name | |
params | describe the ancillary information needed | |
data | points to the raw content | |
size | is the size of the raw content, in bytes |
Definition at line 2301 of file ccn_client.c.
Referenced by ccn_initiate_prefix_reg(), ccnd_answer_req(), ccnd_init_service_ccnb(), ccnr_answer_req(), ccnr_init_policy_cob(), ccnr_init_policy_link_cob(), ccnr_init_service_ccnb(), create_face(), localStore(), main(), r_proto_bulk_import(), r_proto_continue_enumeration(), r_proto_start_write(), r_proto_start_write_checked(), register_unregister_prefix(), seqw_next_cob(), storeHandler(), and SyncSignBuf().
int ccn_signed_info_create | ( | struct ccn_charbuf * | c, | |
const void * | publisher_key_id, | |||
size_t | publisher_key_id_size, | |||
const struct ccn_charbuf * | timestamp, | |||
enum ccn_content_type | type, | |||
int | freshness, | |||
const struct ccn_charbuf * | finalblockid, | |||
const struct ccn_charbuf * | key_locator | |||
) |
Create SignedInfo.
c | is used to hold the result. | |
publisher_key_id | points to the digest of the publisher key id. | |
publisher_key_id_size | is the size in bytes(32) of the pub key digest | |
timestamp | holds the timestamp, as a ccnb-encoded blob, or is NULL to use the current time. | |
type | indicates the Type of the ContentObject. | |
freshness | is the FreshnessSeconds value, or -1 to omit. | |
finalblockid | holds the FinalBlockID, as a ccnb-encoded blob, or is NULL to omit. | |
key_locator | is the ccnb-encoded KeyLocator element, or NULL to omit. |
Definition at line 48 of file ccn_buf_encoder.c.
Referenced by ccn_sign_content(), and main().
int ccn_verify_content | ( | struct ccn * | h, | |
const unsigned char * | msg, | |||
struct ccn_parsed_ContentObject * | pco | |||
) |
Verify a ContentObject using the public key from either the object itself or our cache of keys.
This routine does not attempt to fetch the public key if it is not at hand.
Definition at line 1958 of file ccn_client.c.
Referenced by ccnd_answer_req(), ccnr_answer_req(), handle_ccndid_response(), handle_prefix_reg_reply(), and SyncLocalRepoFetch().
int ccnb_append_Link | ( | struct ccn_charbuf * | buf, | |
const struct ccn_charbuf * | name, | |||
const char * | label, | |||
const struct ccn_charbuf * | linkAuthenticator | |||
) |
Append a representation of a Link to a charbuf.
buf | is the output buffer where encoded link is written. | |
name | is the ccnb-encoded name from ccn_name_init and friends. | |
label | is a UTF-8 string in a ccn_charbuf. | |
linkAuthenticator | is the ccnb-encoded LinkAuthenticator. |
Definition at line 473 of file ccn_buf_encoder.c.
Referenced by ccnr_init_policy_link_cob(), and main().
int ccnb_append_now_blob | ( | struct ccn_charbuf * | c, | |
enum ccn_marker | marker | |||
) |
Append a binary timestamp, using the current time.
Like ccnb_append_timestamp_blob() but uses current time
c | is the buffer to append to. | |
marker | - see ccnb_append_timestamp_blob() |
Definition at line 355 of file ccn_buf_encoder.c.
Referenced by ccn_create_version(), and ccn_signed_info_create().
int ccnb_append_number | ( | struct ccn_charbuf * | c, | |
int | nni | |||
) |
Append a non-negative integer as a UDATA.
c | is the buffer to append to. | |
nni | is a non-negative value. |
Definition at line 288 of file ccn_buf_encoder.c.
Referenced by main(), make_data_template(), and make_template().
int ccnb_append_tagged_blob | ( | struct ccn_charbuf * | c, | |
enum ccn_dtag | dtag, | |||
const void * | data, | |||
size_t | size | |||
) |
Append a tagged BLOB.
This is a ccnb-encoded element with containing the BLOB as content
c | is the buffer to append to. | |
dtag | is the element's dtab | |
data | points to the binary data | |
size | is the size of the data, in bytes |
Definition at line 395 of file ccn_buf_encoder.c.
Referenced by appendExclusions(), appendLifetime(), ccn_encode_ContentObject(), ccnb_append_face_instance(), ccnb_append_forwarding_entry(), ccnb_append_header(), ccnd_append_debug_nonce(), main(), storeStablePoint(), SyncAppendElementInner(), and SyncNodeAppendLongHash().
int ccnb_append_timestamp_blob | ( | struct ccn_charbuf * | c, | |
enum ccn_marker | marker, | |||
intmax_t | secs, | |||
int | nsecs | |||
) |
Append a binary timestamp as a BLOB using the ccn binary Timestamp representation (12-bit fraction).
c | is the buffer to append to. | |
marker | If marker >= 0, the low-order byte is used as a marker byte, useful for some content naming conventions (versioning, in particular). | |
secs | - seconds since epoch | |
nsecs | - nanoseconds |
Definition at line 316 of file ccn_buf_encoder.c.
Referenced by ccn_create_version(), and ccnb_append_now_blob().
int ccnb_element_begin | ( | struct ccn_charbuf * | c, | |
enum ccn_dtag | dtag | |||
) |
Append a start-of-element marker.
Definition at line 369 of file ccn_buf_encoder.c.
Referenced by ccnb_append_face_instance(), ccnb_append_forwarding_entry(), ccnb_append_header(), r_proto_append_repo_info(), r_proto_begin_enumeration(), r_proto_continue_enumeration(), r_proto_mktemplate(), r_proto_policy_append_basic(), r_proto_start_write_checked(), sendSlice(), SyncResetComposite(), SyncRootAppendSlice(), and testEncodeDecode().
int ccnb_element_end | ( | struct ccn_charbuf * | c | ) |
Append an end-of-element marker.
This is the same as ccn_charbuf_append_closer()
Definition at line 379 of file ccn_buf_encoder.c.
Referenced by ccn_append_link_stuff(), ccnb_append_face_instance(), ccnb_append_forwarding_entry(), ccnb_append_header(), r_proto_append_repo_info(), r_proto_begin_enumeration(), r_proto_continue_enumeration(), r_proto_mktemplate(), r_proto_policy_append_basic(), r_proto_policy_append_namespace(), r_proto_start_write_checked(), sendSlice(), SyncEndComposite(), SyncRootAppendSlice(), and testEncodeDecode().
int ccnb_tagged_putf | ( | struct ccn_charbuf * | c, | |
enum ccn_dtag | dtag, | |||
const char * | fmt, | |||
... | ||||
) |
Append a tagged UDATA string, with printf-style formatting.
This is a ccnb-encoded element with containing UDATA as content.
c | is the buffer to append to. | |
dtag | is the element's dtab. | |
fmt | is a printf-style format string, followed by its values |
Definition at line 421 of file ccn_buf_encoder.c.
Referenced by answer_highest(), answer_passive(), ccn_encode_StatusResponse(), ccn_initiate_key_fetch(), ccn_signed_info_create(), ccnb_append_face_instance(), ccnb_append_forwarding_entry(), ccnb_append_header(), handle_key(), incoming_content(), initialize_global_data(), local_scope_rm_template(), main(), make_template(), r_proto_append_repo_info(), r_proto_initiate_key_fetch(), r_proto_mktemplate(), r_proto_policy_append_basic(), r_proto_policy_append_namespace(), stuff_link_check(), SyncAppendTaggedNumber(), SyncGenInterest(), and SyncSignBuf().
enum ccn_upcall_res(* ccn_handler)(struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
ccn_handler This is the procedure type for the closure's implementation.