Go to the source code of this file.
Functions | |
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_numeric (struct ccn_charbuf *c, enum ccn_marker marker, 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_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_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_comp_strcmp (const unsigned char *data, const struct ccn_indexbuf *indexbuf, unsigned int i, const char *val) |
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_name_next_sibling (struct ccn_charbuf *c) |
Advance the last Component of a Name to the next possible value. |
Part of the CCNx C Library.
Copyright (C) 2008-2010 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_name_util.c.
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().