Support for ccnx:/URI/. More...
Go to the source code of this file.
Functions | |
void | ccn_uri_append_percentescaped (struct ccn_charbuf *c, const unsigned char *data, size_t size) |
This appends to c a percent-escaped representation of the component passed in. | |
int | ccn_uri_append (struct ccn_charbuf *c, const unsigned char *ccnb, size_t size, int includescheme) |
This appends to c a URI representation of the ccnb-encoded Name element passed in. | |
static int | hexit (int c) |
static int | ccn_append_uri_component (struct ccn_charbuf *c, const char *s, size_t limit, size_t *cont) |
static int | ccn_name_last_component_offset (const unsigned char *ccnb, size_t size) |
int | ccn_name_from_uri (struct ccn_charbuf *c, const char *uri) |
Convert a ccnx-scheme URI to a ccnb-encoded Name. |
Support for ccnx:/URI/.
..
Part of the CCNx C Library.
Copyright (C) 2008, 2009, 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_uri.c.
static int ccn_append_uri_component | ( | struct ccn_charbuf * | c, | |
const char * | s, | |||
size_t | limit, | |||
size_t * | cont | |||
) | [static] |
Definition at line 161 of file ccn_uri.c.
Referenced by ccn_name_from_uri().
int ccn_name_from_uri | ( | struct ccn_charbuf * | c, | |
const char * | uri | |||
) |
Convert a ccnx-scheme URI to a ccnb-encoded Name.
The converted result is placed in c. On input, c may contain a base name, in which case relative URIs are allowed. Otherwise c should start out empty, and the URI must be absolute.
Definition at line 249 of file ccn_uri.c.
Referenced by ccn_initiate_ccndid_fetch(), ccn_initiate_prefix_reg(), ccnd_init_service_ccnb(), ccnd_parse_uri_list(), ccnd_reg_ccnx_ccndid(), ccnd_reg_uri(), ccnd_start_notice(), ccnd_uri_listen(), get_ccndid(), main(), NewElem(), process_command_tokens(), and stuff_link_check().
static int ccn_name_last_component_offset | ( | const unsigned char * | ccnb, | |
size_t | size | |||
) | [static] |
Definition at line 220 of file ccn_uri.c.
Referenced by ccn_name_from_uri().
int ccn_uri_append | ( | struct ccn_charbuf * | c, | |
const unsigned char * | ccnb, | |||
size_t | size, | |||
int | includescheme | |||
) |
This appends to c a URI representation of the ccnb-encoded Name element passed in.
For convenience, it will also look inside of a ContentObject or Interest object to find the Name. Components that consist solely of zero or more dots are converted by adding 3 more dots so there are no ambiguities with . or .. or whether a component is empty or absent. Will prepend "ccnx:" unless includescheme is 0
Definition at line 88 of file ccn_uri.c.
Referenced by ccnd_debug_ccnb(), ccnd_reg_ccnx_ccndid(), ccnd_uri_listen(), collect_forwarding_html(), collect_forwarding_xml(), incoming_content(), main(), and process_prefix_face_list_item().
void ccn_uri_append_percentescaped | ( | struct ccn_charbuf * | c, | |
const unsigned char * | data, | |||
size_t | size | |||
) |
This appends to c a percent-escaped representation of the component passed in.
Only generic URI unreserved characters are not escaped. Components that consist solely of zero or more dots are converted by adding 3 more dots so there are no ambiguities with . or .. or whether a component is empty or absent. (cf. ccn_uri_append)
Definition at line 51 of file ccn_uri.c.
Referenced by ccn_uri_append(), and incoming_interest().
static int hexit | ( | int | c | ) | [static] |
Definition at line 130 of file ccn_uri.c.
Referenced by ccn_append_uri_component().