Support for ccn clients. More...
Go to the source code of this file.
Defines | |
#define | CCN_FORW_WAITING_CCNDID (1<<30) |
#define | NOTE_ERR(h, e) (h->err = (e), h->errline = __LINE__, ccn_note_err(h)) |
#define | NOTE_ERRNO(h) NOTE_ERR(h, errno) |
#define | THIS_CANNOT_HAPPEN(h) do { NOTE_ERR(h, -73); ccn_perror(h, "Can't happen");} while (0) |
#define | XXX do { NOTE_ERR(h, -76); ccn_perror(h, "Please write some more code here"); } while (0) |
Functions | |
static void | ccn_refresh_interest (struct ccn *, struct expressed_interest *) |
static void | ccn_initiate_prefix_reg (struct ccn *, const void *, size_t, struct interest_filter *) |
static void | finalize_pkey (struct hashtb_enumerator *e) |
static void | finalize_keystore (struct hashtb_enumerator *e) |
static int | ccn_pushout (struct ccn *h) |
static int | tv_earlier (const struct timeval *a, const struct timeval *b) |
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. | |
static int | ccn_note_err (struct ccn *h) |
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. | |
static struct ccn_indexbuf * | ccn_indexbuf_obtain (struct ccn *h) |
static void | ccn_indexbuf_release (struct ccn *h, struct ccn_indexbuf *c) |
static void | ccn_replace_handler (struct ccn *h, struct ccn_closure **dstp, struct ccn_closure *src) |
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) |
static void | ccn_gripe (struct expressed_interest *i) |
static void | replace_interest_msg (struct expressed_interest *interest, struct ccn_charbuf *cb) |
static struct expressed_interest * | ccn_destroy_interest (struct ccn *h, struct expressed_interest *i) |
void | ccn_check_interests (struct expressed_interest *list) |
void | ccn_clean_interests_by_prefix (struct ccn *h, struct interests_by_prefix *entry) |
void | ccn_destroy (struct ccn **hp) |
static int | ccn_check_namebuf (struct ccn *h, struct ccn_charbuf *namebuf, int prefix_comps, int omit_possible_digest) |
static void | ccn_construct_interest (struct ccn *h, struct ccn_charbuf *name_prefix, struct ccn_charbuf *interest_template, struct expressed_interest *dest) |
int | ccn_express_interest (struct ccn *h, struct ccn_charbuf *namebuf, struct ccn_closure *action, struct ccn_charbuf *interest_template) |
static void | finalize_interest_filter (struct hashtb_enumerator *e) |
int | ccn_set_interest_filter_with_flags (struct ccn *h, struct ccn_charbuf *namebuf, struct ccn_closure *action, int forw_flags) |
int | ccn_set_interest_filter (struct ccn *h, struct ccn_charbuf *namebuf, struct ccn_closure *action) |
int | ccn_put (struct ccn *h, const void *p, size_t length) |
int | ccn_output_is_pending (struct ccn *h) |
struct ccn_charbuf * | ccn_grab_buffered_output (struct ccn *h) |
static int | ccn_get_content_type (const unsigned char *ccnb, const struct ccn_parsed_ContentObject *pco) |
static void | ccn_digest_Content (const unsigned char *content_object, struct ccn_parsed_ContentObject *pc, unsigned char *digest, size_t digest_bytes) |
Compute the digest of just the Content portion of content_object. | |
static int | ccn_cache_key (struct ccn *h, const unsigned char *ccnb, size_t size, struct ccn_parsed_ContentObject *pco) |
static int | ccn_locate_key (struct ccn *h, const unsigned char *msg, struct ccn_parsed_ContentObject *pco, struct ccn_pkey **pubkey) |
Examine a ContentObject and try to find the public key needed to verify it. | |
static int | ccn_append_link_name (struct ccn_charbuf *name, const unsigned char *data, size_t data_size) |
Get the name out of a Link. | |
static enum ccn_upcall_res | handle_key (struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
Called when we get an answer to a KeyLocator fetch issued by ccn_initiate_key_fetch. | |
static int | ccn_initiate_key_fetch (struct ccn *h, unsigned char *msg, struct ccn_parsed_ContentObject *pco, struct expressed_interest *trigger_interest) |
static void | ccn_check_pub_arrival (struct ccn *h, struct expressed_interest *interest) |
If we were waiting for a key and it has arrived, refresh the interest. | |
void | ccn_dispatch_message (struct ccn *h, unsigned char *msg, size_t size) |
Dispatch a message through the registered upcalls. | |
static int | ccn_process_input (struct ccn *h) |
static void | ccn_update_refresh_us (struct ccn *h, struct timeval *tv) |
static void | ccn_age_interest (struct ccn *h, struct expressed_interest *interest, const unsigned char *key, size_t keysize) |
static void | ccn_clean_all_interests (struct ccn *h) |
static void | ccn_notify_ccndid_changed (struct ccn *h) |
int | ccn_process_scheduled_operations (struct ccn *h) |
Process any scheduled operations that are due. | |
int | ccn_set_run_timeout (struct ccn *h, int timeout) |
Modify ccn_run timeout. | |
int | ccn_run (struct ccn *h, int timeout) |
Run the ccn client event loop. | |
static enum ccn_upcall_res | handle_simple_incoming_content (struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
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. | |
static enum ccn_upcall_res | handle_ccndid_response (struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
static void | ccn_initiate_ccndid_fetch (struct ccn *h) |
static enum ccn_upcall_res | handle_prefix_reg_reply (struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
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. | |
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_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. |
Support for ccn 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_client.c.
#define CCN_FORW_WAITING_CCNDID (1<<30) |
Definition at line 98 of file ccn_client.c.
Referenced by ccn_initiate_prefix_reg(), and ccn_notify_ccndid_changed().
#define NOTE_ERR | ( | h, | |||
e | ) | (h->err = (e), h->errline = __LINE__, ccn_note_err(h)) |
Definition at line 105 of file ccn_client.c.
Referenced by ccn_chk_signing_params(), ccn_connect(), ccn_construct_interest(), ccn_get_public_key(), ccn_load_default_key(), ccn_locate_key(), ccn_put(), ccn_run(), ccn_sign_content(), handle_ccndid_response(), and handle_prefix_reg_reply().
#define NOTE_ERRNO | ( | h | ) | NOTE_ERR(h, errno) |
Definition at line 106 of file ccn_client.c.
Referenced by ccn_cache_key(), ccn_chk_signing_params(), ccn_connect(), ccn_create(), ccn_disconnect(), ccn_express_interest(), ccn_initiate_key_fetch(), ccn_initiate_prefix_reg(), ccn_load_private_key(), ccn_locate_key(), ccn_process_input(), ccn_pushout(), ccn_put(), ccn_run(), ccn_set_interest_filter_with_flags(), and handle_ccndid_response().
#define THIS_CANNOT_HAPPEN | ( | h | ) | do { NOTE_ERR(h, -73); ccn_perror(h, "Can't happen");} while (0) |
Definition at line 108 of file ccn_client.c.
Referenced by ccn_locate_key().
#define XXX do { NOTE_ERR(h, -76); ccn_perror(h, "Please write some more code here"); } while (0) |
Definition at line 111 of file ccn_client.c.
Referenced by ccn_locate_key(), and handle_prefix_reg_reply().
static void ccn_age_interest | ( | struct ccn * | h, | |
struct expressed_interest * | interest, | |||
const unsigned char * | key, | |||
size_t | keysize | |||
) | [static] |
Definition at line 1303 of file ccn_client.c.
Referenced by ccn_process_scheduled_operations().
static int ccn_append_link_name | ( | struct ccn_charbuf * | name, | |
const unsigned char * | data, | |||
size_t | data_size | |||
) | [static] |
Get the name out of a Link.
XXX - this needs a better home.
Definition at line 954 of file ccn_client.c.
Referenced by handle_key().
static int ccn_cache_key | ( | struct ccn * | h, | |
const unsigned char * | ccnb, | |||
size_t | size, | |||
struct ccn_parsed_ContentObject * | pco | |||
) | [static] |
Definition at line 796 of file ccn_client.c.
Referenced by ccn_dispatch_message().
void ccn_check_interests | ( | struct expressed_interest * | list | ) |
Definition at line 385 of file ccn_client.c.
Referenced by ccn_clean_interests_by_prefix(), and ccn_process_scheduled_operations().
static int ccn_check_namebuf | ( | struct ccn * | h, | |
struct ccn_charbuf * | namebuf, | |||
int | prefix_comps, | |||
int | omit_possible_digest | |||
) | [static] |
Definition at line 462 of file ccn_client.c.
Referenced by ccn_express_interest(), and ccn_set_interest_filter_with_flags().
static void ccn_check_pub_arrival | ( | struct ccn * | h, | |
struct expressed_interest * | interest | |||
) | [static] |
If we were waiting for a key and it has arrived, refresh the interest.
Definition at line 1109 of file ccn_client.c.
Referenced by ccn_process_scheduled_operations().
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().
static void ccn_clean_all_interests | ( | struct ccn * | h | ) | [static] |
Definition at line 1373 of file ccn_client.c.
Referenced by ccn_process_scheduled_operations().
void ccn_clean_interests_by_prefix | ( | struct ccn * | h, | |
struct interests_by_prefix * | entry | |||
) |
Definition at line 397 of file ccn_client.c.
Referenced by ccn_clean_all_interests().
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().
static void ccn_construct_interest | ( | struct ccn * | h, | |
struct ccn_charbuf * | name_prefix, | |||
struct ccn_charbuf * | interest_template, | |||
struct expressed_interest * | dest | |||
) | [static] |
Definition at line 498 of file ccn_client.c.
Referenced by ccn_express_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().
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().
static struct expressed_interest* ccn_destroy_interest | ( | struct ccn * | h, | |
struct expressed_interest * | i | |||
) | [static, read] |
Definition at line 369 of file ccn_client.c.
Referenced by ccn_clean_interests_by_prefix(), and ccn_destroy().
static void ccn_digest_Content | ( | const unsigned char * | content_object, | |
struct ccn_parsed_ContentObject * | pc, | |||
unsigned char * | digest, | |||
size_t | digest_bytes | |||
) | [static] |
Compute the digest of just the Content portion of content_object.
Definition at line 768 of file ccn_client.c.
Referenced by ccn_cache_key().
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().
void ccn_dispatch_message | ( | struct ccn * | h, | |
unsigned char * | msg, | |||
size_t | size | |||
) |
Dispatch a message through the registered upcalls.
This is not used by normal ccn clients, but is made available for use when ccnd needs to communicate with its internal client.
h | is the ccn handle. | |
msg | is the ccnb-encoded Interest or ContentObject. | |
size | is its size in bytes. |
Definition at line 1130 of file ccn_client.c.
Referenced by ccn_process_input(), and ccnd_send().
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_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().
static int ccn_get_content_type | ( | const unsigned char * | ccnb, | |
const struct ccn_parsed_ContentObject * | pco | |||
) | [static] |
Definition at line 746 of file ccn_client.c.
Referenced by ccn_cache_key(), ccn_dispatch_message(), and handle_key().
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.
struct ccn_charbuf* ccn_grab_buffered_output | ( | struct ccn * | h | ) | [read] |
Definition at line 716 of file ccn_client.c.
Referenced by process_internal_client_buffer().
static void ccn_gripe | ( | struct expressed_interest * | i | ) | [static] |
Definition at line 342 of file ccn_client.c.
Referenced by ccn_age_interest(), ccn_check_interests(), ccn_destroy_interest(), ccn_dispatch_message(), ccn_refresh_interest(), and replace_interest_msg().
static struct ccn_indexbuf* ccn_indexbuf_obtain | ( | struct ccn * | h | ) | [static, read] |
Definition at line 194 of file ccn_client.c.
Referenced by ccn_age_interest(), and ccn_dispatch_message().
static void ccn_indexbuf_release | ( | struct ccn * | h, | |
struct ccn_indexbuf * | c | |||
) | [static] |
Definition at line 205 of file ccn_client.c.
Referenced by ccn_age_interest(), and ccn_dispatch_message().
static void ccn_initiate_ccndid_fetch | ( | struct ccn * | h | ) | [static] |
Definition at line 1720 of file ccn_client.c.
Referenced by ccn_initiate_prefix_reg().
static int ccn_initiate_key_fetch | ( | struct ccn * | h, | |
unsigned char * | msg, | |||
struct ccn_parsed_ContentObject * | pco, | |||
struct expressed_interest * | trigger_interest | |||
) | [static] |
Definition at line 1037 of file ccn_client.c.
Referenced by ccn_dispatch_message().
static void ccn_initiate_prefix_reg | ( | struct ccn * | h, | |
const void * | prefix, | |||
size_t | prefix_size, | |||
struct interest_filter * | i | |||
) | [static] |
Definition at line 1790 of file ccn_client.c.
Referenced by ccn_process_scheduled_operations().
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().
static int ccn_locate_key | ( | struct ccn * | h, | |
const unsigned char * | msg, | |||
struct ccn_parsed_ContentObject * | pco, | |||
struct ccn_pkey ** | pubkey | |||
) | [static] |
Examine a ContentObject and try to find the public key needed to verify it.
It might be present in our cache of keys, or in the object itself; in either of these cases, we can satisfy the request right away. Or there may be an indirection (a KeyName), in which case return without the key. The final possibility is that there is no key locator we can make sense of.
Definition at line 863 of file ccn_client.c.
Referenced by ccn_dispatch_message(), and ccn_verify_content().
static int ccn_note_err | ( | struct ccn * | h | ) | [static] |
Definition at line 155 of file ccn_client.c.
Referenced by ccn_seterror().
static void ccn_notify_ccndid_changed | ( | struct ccn * | h | ) | [static] |
Definition at line 1390 of file ccn_client.c.
Referenced by handle_ccndid_response().
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().
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().
static int ccn_process_input | ( | struct ccn * | h | ) | [static] |
Definition at line 1239 of file ccn_client.c.
Referenced by ccn_run().
int ccn_process_scheduled_operations | ( | struct ccn * | h | ) |
Process any scheduled operations that are due.
This is not used by normal ccn clients, but is made available for use by ccnd to run its internal client.
h | is the ccn handle. |
Definition at line 1414 of file ccn_client.c.
Referenced by ccn_run(), and ccnd_internal_client_refresh().
static int ccn_pushout | ( | struct ccn * | h | ) | [static] |
Definition at line 646 of file ccn_client.c.
Referenced by ccn_disconnect(), ccn_put(), and ccn_run().
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().
static void ccn_refresh_interest | ( | struct ccn * | h, | |
struct expressed_interest * | interest | |||
) | [static] |
Definition at line 727 of file ccn_client.c.
Referenced by ccn_age_interest(), ccn_check_pub_arrival(), ccn_dispatch_message(), and ccn_express_interest().
static void ccn_replace_handler | ( | struct ccn * | h, | |
struct ccn_closure ** | dstp, | |||
struct ccn_closure * | src | |||
) | [static] |
Definition at line 215 of file ccn_client.c.
Referenced by ccn_destroy(), ccn_destroy_interest(), ccn_dispatch_message(), ccn_express_interest(), ccn_process_scheduled_operations(), and ccn_set_interest_filter_with_flags().
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().
static void ccn_update_refresh_us | ( | struct ccn * | h, | |
struct timeval * | tv | |||
) | [static] |
Definition at line 1287 of file ccn_client.c.
Referenced by ccn_process_scheduled_operations().
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().
static void finalize_interest_filter | ( | struct hashtb_enumerator * | e | ) | [static] |
Definition at line 597 of file ccn_client.c.
Referenced by ccn_set_interest_filter_with_flags().
static void finalize_keystore | ( | struct hashtb_enumerator * | e | ) | [static] |
Definition at line 1983 of file ccn_client.c.
Referenced by ccn_create().
static void finalize_pkey | ( | struct hashtb_enumerator * | e | ) | [static] |
Definition at line 845 of file ccn_client.c.
Referenced by ccn_create().
static enum ccn_upcall_res handle_ccndid_response | ( | struct ccn_closure * | selfp, | |
enum ccn_upcall_kind | kind, | |||
struct ccn_upcall_info * | info | |||
) | [static] |
Definition at line 1679 of file ccn_client.c.
Referenced by ccn_initiate_ccndid_fetch().
static enum ccn_upcall_res handle_key | ( | struct ccn_closure * | selfp, | |
enum ccn_upcall_kind | kind, | |||
struct ccn_upcall_info * | info | |||
) | [static] |
Called when we get an answer to a KeyLocator fetch issued by ccn_initiate_key_fetch.
This does not really have to do much, since the main content handling logic picks up the keys as they go by.
Definition at line 983 of file ccn_client.c.
Referenced by ccn_initiate_key_fetch().
static enum ccn_upcall_res handle_prefix_reg_reply | ( | struct ccn_closure * | selfp, | |
enum ccn_upcall_kind | kind, | |||
struct ccn_upcall_info * | info | |||
) | [static] |
Definition at line 1734 of file ccn_client.c.
Referenced by ccn_initiate_prefix_reg().
static enum ccn_upcall_res handle_simple_incoming_content | ( | struct ccn_closure * | selfp, | |
enum ccn_upcall_kind | kind, | |||
struct ccn_upcall_info * | info | |||
) | [static] |
Definition at line 1559 of file ccn_client.c.
Referenced by ccn_get().
static void replace_interest_msg | ( | struct expressed_interest * | interest, | |
struct ccn_charbuf * | cb | |||
) | [static] |
Definition at line 348 of file ccn_client.c.
Referenced by ccn_construct_interest(), ccn_destroy_interest(), ccn_dispatch_message(), and ccn_process_scheduled_operations().
static int tv_earlier | ( | const struct timeval * | a, | |
const struct timeval * | b | |||
) | [static] |
Definition at line 123 of file ccn_client.c.
Referenced by ccn_process_scheduled_operations().