This is the low-level interface for CCNx clients. More...
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_ContentObject |
struct | ccn_signing_params |
Parameters for creating signed content objects. More... | |
Defines | |
#define | CCN_API_VERSION 4000 |
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 | |
Typedefs | |
typedef 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. | |
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 } |
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 } |
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_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_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_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_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. |
This is the low-level interface for CCNx clients.
Part of the CCNx C Library.
Copyright (C) 2008-2011 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 512 of file ccn.h.
Referenced by answer_passive(), ccn_parse_interest(), and process_incoming_interest().
#define CCN_AOK_DEFAULT (CCN_AOK_CS | CCN_AOK_NEW) |
Definition at line 514 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 516 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 513 of file ccn.h.
Referenced by ccn_parse_interest(), ccnd_answer_req(), and incoming_interest().
#define CCN_AOK_STALE 0x4 |
Definition at line 515 of file ccn.h.
Referenced by answer_passive(), main(), make_template(), and process_incoming_interest().
#define CCN_API_VERSION 4000 |
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 373 of file ccn.h.
Referenced by ccn_get(), ccn_resolve_version(), and handle_simple_incoming_content().
#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(), 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(), and ccn_update_refresh_us().
#define CCN_SIGNING_PARAMS_INIT { CCN_API_VERSION, 0, NULL, {0}, CCN_CONTENT_DATA, -1 } |
Definition at line 711 of file ccn.h.
Referenced by ccn_get_public_key(), ccn_sign_content(), ccnd_answer_req(), ccnd_init_internal_keystore(), ccnd_init_service_ccnb(), main(), and seqw_next_cob().
#define CCN_SP_FINAL_BLOCK 0x0010 |
Definition at line 718 of file ccn.h.
Referenced by ccn_chk_signing_params(), ccn_sign_content(), ccnd_init_service_ccnb(), main(), and seqw_next_cob().
#define CCN_SP_OMIT_KEY_LOCATOR 0x0020 |
Definition at line 719 of file ccn.h.
Referenced by ccn_chk_signing_params(), and ccn_sign_content().
#define CCN_SP_TEMPL_FINAL_BLOCK_ID 0x0002 |
Definition at line 715 of file ccn.h.
Referenced by ccn_chk_signing_params().
#define CCN_SP_TEMPL_FRESHNESS 0x0004 |
Definition at line 716 of file ccn.h.
Referenced by ccn_chk_signing_params(), and main().
#define CCN_SP_TEMPL_KEY_LOCATOR 0x0008 |
Definition at line 717 of file ccn.h.
Referenced by ccn_chk_signing_params(), ccnd_init_service_ccnb(), and main().
#define CCN_SP_TEMPL_TIMESTAMP 0x0001 |
Definition at line 714 of file ccn.h.
Referenced by ccn_chk_signing_params(), and main().
#define CCN_V_EST 8 |
#define CCN_V_HIGH 4 |
look for newer version
Definition at line 881 of file ccn.h.
Referenced by ccn_create_version(), ccn_resolve_version(), and main().
#define CCN_V_HIGHEST (4|8) |
Definition at line 884 of file ccn.h.
Referenced by ccn_get_header(), and main().
#define CCN_V_NESTOK 32 |
version within version is ok
Definition at line 888 of file ccn.h.
Referenced by ccn_create_version(), and ccn_resolve_version().
#define CCN_V_NOW 16 |
use current time
Definition at line 887 of file ccn.h.
Referenced by ccn_create_version(), ccn_seqw_create(), and main().
#define CCN_V_REPLACE 1 |
Versioning.
if last component is version, replace it
Definition at line 879 of file ccn.h.
Referenced by ccn_create_version(), and main().
typedef enum ccn_upcall_res(* ccn_handler)(struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
enum ccn_content_type |
enum ccn_marker |
enum ccn_upcall_kind |
This tells what kind of event the upcall is handling.
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 ccn_append_link_name(), 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_forwarding_entry_parse(), ccn_header_parse(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_interest(), ccn_parse_KeyName(), 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(), find_first_match_candidate(), and make_template().
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_uri_append(), and 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_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_forwarding_entry_parse(), ccn_header_parse(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_interest(), ccn_parse_KeyName(), 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(), and make_template().
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_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_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(), find_first_match_candidate(), main(), make_template(), and process_incoming_link_message().
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 ccn_check_namebuf(), ccn_compare_names(), ccn_content_matches_interest(), ccn_face_instance_parse(), 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(), and make_template().
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 ccn_append_link_name(), 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_forwarding_entry_parse(), ccn_header_parse(), ccn_locate_key(), ccn_name_comp_get(), ccn_name_last_component_offset(), ccn_parse_ContentObject(), ccn_parse_Exclude(), ccn_parse_interest(), ccn_parse_KeyName(), 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(), find_first_match_candidate(), main(), and make_template().
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_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(), 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_tagged_blob(), ccnb_element_end(), ccnb_tagged_putf(), ccnd_answer_req(), ccnd_append_plain_nonce(), ccnd_init_service_ccnb(), create_passive_templ(), express_bulkdata_interest(), express_my_interest(), find_first_match_candidate(), incoming_content(), initialize_global_data(), local_scope(), local_scope_rm_template(), main(), make_data_template(), make_template(), process_incoming_content(), resolve_templ(), stuff_and_send(), and stuff_link_check().
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(), 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_number(), ccnb_append_tagged_blob(), ccnb_append_timestamp_blob(), ccnb_element_begin(), ccnb_tagged_putf(), ccnd_append_plain_nonce(), ccnd_init_service_ccnb(), create_passive_templ(), express_bulkdata_interest(), express_my_interest(), incoming_content(), initialize_global_data(), local_scope(), local_scope_rm_template(), main(), make_data_template(), make_template(), process_incoming_content(), resolve_templ(), stuff_and_send(), and stuff_link_check().
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 2051 of file ccn_client.c.
Referenced by ccn_get_public_key(), ccn_sign_content(), and ccnd_init_internal_keystore().
int ccn_compare_names | ( | const unsigned char * | a, | |
size_t | asize, | |||
const unsigned char * | b, | |||
size_t | bsize | |||
) |
Definition at line 890 of file ccn_buf_decoder.c.
Referenced by content_skiplist_findbefore(), and namecompare().
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 288 of file ccn_client.c.
Referenced by ccn_fetch_new(), ccn_get(), and main().
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 877 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(), handle_key(), handle_prefix_reg_reply(), incoming_content(), main(), process_test(), and register_unregister_prefix().
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(), consume_matching_interests(), incoming_interest(), interest_handler(), process_incoming_interest(), and seqw_incoming_interest().
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 239 of file ccn_client.c.
Referenced by ccn_fetch_new(), ccn_get(), ccnd_internal_client_start(), and main().
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(), and main().
void ccn_destroy | ( | struct ccn ** | hp | ) |
Definition at line 418 of file ccn_client.c.
Referenced by ccn_fetch_destroy(), ccn_fetch_new(), ccn_get(), ccnd_internal_client_start(), ccnd_internal_client_stop(), and main().
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(), and process_incoming_content().
int ccn_disconnect | ( | struct ccn * | h | ) |
Definition at line 323 of file ccn_client.c.
Referenced by ccn_destroy(), ccn_fetch_destroy(), ccn_process_input(), ccn_run(), and main().
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 | |||
) |
Definition at line 231 of file ccn_buf_encoder.c.
Referenced by ccnd_nack().
int ccn_express_interest | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
struct ccn_closure * | action, | |||
struct ccn_charbuf * | interest_template | |||
) |
Definition at line 540 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(), and NeedSegment().
int ccn_fetch_tagged_nonNegativeInteger | ( | enum ccn_dtag | tt, | |
const unsigned char * | buf, | |||
size_t | start, | |||
size_t | stop | |||
) |
Definition at line 540 of file ccn_buf_decoder.c.
Referenced by 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 1618 of file ccn_client.c.
Referenced by ccn_get_header(), ccn_resolve_version(), create_face(), get_ccndid(), main(), and register_unregister_prefix().
int ccn_get_connection_fd | ( | struct ccn * | h | ) |
Definition at line 317 of file ccn_client.c.
Referenced by main().
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 1999 of file ccn_client.c.
Referenced by ccnd_init_service_ccnb().
int ccn_geterror | ( | struct ccn * | h | ) |
Recover last error code.
h | is the ccn handle - may be NULL. |
Definition at line 186 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(), and process_incoming_interest().
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 1961 of file ccn_client.c.
Referenced by ccnd_init_internal_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 1896 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_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(), create_face(), express_bulkdata_interest(), incoming_content(), main(), register_unregister_prefix(), and sequenced_name().
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(), and next_child_at_level().
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.
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(), main(), sequenced_name(), and seqw_next_cob().
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(), create_face(), encode_message(), main(), and register_unregister_prefix().
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(), and main().
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(), and ccnd_uri_listen().
int ccn_name_comp_strcmp | ( | const unsigned char * | data, | |
const struct ccn_indexbuf * | indexbuf, | |||
unsigned int | i, | |||
const char * | val | |||
) |
Definition at line 182 of file ccn_name_util.c.
Referenced by decode_message().
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(), ccn_initiate_prefix_reg(), ccn_name_from_uri(), ccnd_reg_prefix(), ccnd_reg_uri(), collect_forwarding_html(), collect_forwarding_xml(), create_face(), encode_message(), incoming_content(), initialize_global_data(), main(), next_child_at_level(), register_unregister_prefix(), and stuff_link_check().
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(), and 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(), and ccnd_uri_listen().
int ccn_output_is_pending | ( | struct ccn * | h | ) |
Definition at line 710 of file ccn_client.c.
Referenced by ccn_grab_buffered_output(), ccn_process_scheduled_operations(), and ccn_run().
int ccn_parse_ContentObject | ( | const unsigned char * | msg, | |
size_t | size, | |||
struct ccn_parsed_ContentObject * | x, | |||
struct ccn_indexbuf * | components | |||
) |
Definition at line 805 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(), decode_message(), deliver_content(), interest_handler(), main(), process_incoming_content(), and process_test().
int ccn_parse_interest | ( | const unsigned char * | msg, | |
size_t | size, | |||
struct ccn_parsed_interest * | interest, | |||
struct ccn_indexbuf * | components | |||
) |
Definition at line 561 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(), main(), and process_incoming_interest().
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 289 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(), and ccnd_reg_uri().
int ccn_parse_nonNegativeInteger | ( | struct ccn_buf_decoder * | d | ) |
Definition at line 390 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(), 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_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 526 of file ccn_buf_decoder.c.
Referenced by ccn_chk_signing_params(), ccn_face_instance_parse(), ccn_forwarding_entry_parse(), ccn_parse_interest(), 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(), and ccn_parse_SignedInfo().
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(), and ccn_forwarding_entry_parse().
int ccn_parse_uintmax | ( | struct ccn_buf_decoder * | d, | |
uintmax_t * | result | |||
) |
Parse a potentially large non-negative integer.
Definition at line 430 of file ccn_buf_decoder.c.
Referenced by ccn_parse_tagged_required_uintmax().
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 140 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 668 of file ccn_client.c.
Referenced by ccn_refresh_interest(), ccn_seqw_write(), ccnd_answer_req(), incoming_interest(), interest_handler(), main(), outgoing_content(), and seqw_incoming_interest().
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 840 of file ccn_buf_decoder.c.
Referenced by ccn_chk_signing_params(), ccn_content_get_value(), ccn_digest_Content(), ccn_initiate_key_fetch(), ccn_locate_key(), ccn_name_next_sibling(), ccn_verify_signature(), ccnd_debug_ccnb(), get_ccndid(), GetNumberFromInfo(), handle_ccndid_response(), incoming_content(), incoming_interest(), is_final(), and main().
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(), 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 1491 of file ccn_client.c.
Referenced by ccn_dump_names(), ccn_fetch_poll(), ccn_get(), and main().
int ccn_set_interest_filter | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
struct ccn_closure * | action | |||
) |
Definition at line 638 of file ccn_client.c.
Referenced by ccn_seqw_close(), ccn_seqw_create(), ccnd_uri_listen(), and main().
int ccn_set_interest_filter_with_flags | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
struct ccn_closure * | action, | |||
int | forw_flags | |||
) |
Definition at line 607 of file ccn_client.c.
Referenced by ccn_set_interest_filter(), and main().
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 1475 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 169 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 2210 of file ccn_client.c.
Referenced by ccn_initiate_prefix_reg(), ccnd_answer_req(), ccnd_init_service_ccnb(), create_face(), main(), register_unregister_prefix(), and seqw_next_cob().
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 1867 of file ccn_client.c.
Referenced by ccnd_answer_req().
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 ccn_encode_ContentObject(), ccnb_append_face_instance(), ccnb_append_forwarding_entry(), ccnb_append_header(), ccnd_append_debug_nonce(), and main().
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(), and ccnb_append_header().
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(), and ccnb_append_header().
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_signed_info_create(), ccnb_append_face_instance(), ccnb_append_forwarding_entry(), ccnb_append_header(), initialize_global_data(), local_scope_rm_template(), main(), make_template(), and stuff_link_check().