uri.h File Reference

ccn-scheme uri conversions. 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.
int ccn_name_from_uri (struct ccn_charbuf *c, const char *uri)
 Convert a ccnx-scheme URI to a ccnb-encoded Name.

Detailed Description

ccn-scheme uri conversions.

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 uri.h.


Function Documentation

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.

Returns:
-1 if an error is found, otherwise returns the number of characters that were processed.

Bug:
XXX - need to error out on other uri schemes

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().

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().

Generated on Fri May 13 16:27:19 2011 for Content-Centric Networking in C by  doxygen 1.6.3