ccn_match.c File Reference

Support for the match predicate between interest and content. More...

Go to the source code of this file.

Functions

void ccn_digest_ContentObject (const unsigned char *content_object, struct ccn_parsed_ContentObject *pc)
 Compute the digest of the entire ContentObject if necessary, caching the result in pc->digest, pc->digest_bytes.
static int ccn_pubid_matches (const unsigned char *content_object, struct ccn_parsed_ContentObject *pc, const unsigned char *interest_msg, const struct ccn_parsed_interest *pi)
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.

Detailed Description

Support for the match predicate between interest and content.

Part of the CCNx C Library.

Copyright (C) 2008, 2009 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_match.c.


Function Documentation

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.

Parameters:
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_
Returns:
1 if the ccnb-encoded content_object matches the ccnb-encoded interest_msg, otherwise 0.

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

void ccn_digest_ContentObject ( const unsigned char *  content_object,
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().

static int ccn_pubid_matches ( const unsigned char *  content_object,
struct ccn_parsed_ContentObject pc,
const unsigned char *  interest_msg,
const struct ccn_parsed_interest pi 
) [static]

Definition at line 55 of file ccn_match.c.

Referenced by ccn_content_matches_interest().

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