ccnr_sync.h File Reference

Part of ccnr - CCNx Repository Daemon. More...

Go to the source code of this file.

Functions

void r_sync_notify_after (struct ccnr_handle *ccnr, ccnr_hwm item)
 Notify repo of starting point for new names to be passed to sync.
int r_sync_enumerate (struct ccnr_handle *ccnr, struct ccn_charbuf *interest)
 Request that a SyncNotifyContent call is made for each content object matching the interest.
int r_sync_lookup (struct ccnr_handle *ccnr, struct ccn_charbuf *interest, struct ccn_charbuf *content_ccnb)
 Look up a content object that is stored locally in the repository based on the supplied interest.
enum ccn_upcall_res r_sync_upcall_store (struct ccnr_handle *ccnr, enum ccn_upcall_kind kind, struct ccn_upcall_info *info)
 Called when a content object is received by sync and needs to be committed to stable storage by the repo.
int r_sync_local_store (struct ccnr_handle *ccnr, struct ccn_charbuf *content_cb)
 Called when a content object has been constructed locally by sync and needs to be committed to stable storage by the repo.
int r_sync_notify_content (struct ccnr_handle *ccnr, int e, struct content_entry *content)
 A wrapper for SyncNotifyContent that takes a content entry.


Detailed Description

Part of ccnr - CCNx Repository Daemon.

Copyright (C) 2011 Palo Alto Research Center, Inc.

This work is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This work 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Definition in file ccnr_sync.h.


Function Documentation

int r_sync_enumerate ( struct ccnr_handle ccnr,
struct ccn_charbuf interest 
)

Request that a SyncNotifyContent call is made for each content object matching the interest.

returns -1 for error, or an enumeration number which will also be passed in the SyncNotifyContent

Request that a SyncNotifyContent call is made for each content object matching the interest.

If SyncNotifyContent returns -1 the active enumeration will be cancelled.

When there are no more matching objects, SyncNotifyContent will be called passing NULL for name.

Content objects that arrive during an enumeration may or may not be included in that enumeration.

Returns:
-1 for error, or an enumeration number which will also be passed in the SyncNotifyContent

Definition at line 298 of file ccnr_sync.c.

Referenced by r_sync_enumerate(), SyncStartHeartbeat(), and SyncStartSliceEnum().

int r_sync_local_store ( struct ccnr_handle ccnr,
struct ccn_charbuf content 
)

Called when a content object has been constructed locally by sync and needs to be committed to stable storage by the repo.

returns 0 for success, -1 for error.

Definition at line 458 of file ccnr_sync.c.

Referenced by load_policy(), r_sync_local_store(), storeStablePoint(), and SyncLocalRepoStore().

int r_sync_lookup ( struct ccnr_handle ccnr,
struct ccn_charbuf interest,
struct ccn_charbuf content_ccnb 
)

Look up a content object that is stored locally in the repository based on the supplied interest.

appends the content object to the content_ccnb. returns 0 for success, -1 for error.

Definition at line 385 of file ccnr_sync.c.

Referenced by fetchStablePoint(), r_proto_initiate_key_fetch(), SyncHandleSlice(), SyncLocalRepoFetch(), and SyncStartContentFetch().

void r_sync_notify_after ( struct ccnr_handle ccnr,
ccnr_hwm  item 
)

Notify repo of starting point for new names to be passed to sync.

Use item = 0 as the initial value. Following a call to r_sync_notify_after, the repository will call SyncNotifyContent(struct SyncBaseStruct *, int enumeration, ccnr_accession item, struct ccn_charbuf *name); periodically while there are no un-notified objects. enumeration is 0 for "time-based" notifications, or the value passed in when the enumeration was started. This may not end up an int. if the call is for an explicit enumeration, and there are no more objects, name and content_comps will be NULL. If SyncNotifyContent returns -1 then the active enumeration, or the r_sync_notify_after() will be cancelled.

Definition at line 117 of file ccnr_sync.c.

Referenced by r_sync_notify_content(), and SyncStartHeartbeat().

int r_sync_notify_content ( struct ccnr_handle ccnr,
int  e,
struct content_entry content 
)

A wrapper for SyncNotifyContent that takes a content entry.

Definition at line 129 of file ccnr_sync.c.

Referenced by r_store_set_accession_from_offset(), r_sync_enumerate_action(), and r_sync_notify_content().

enum ccn_upcall_res r_sync_upcall_store ( struct ccnr_handle ccnr,
enum ccn_upcall_kind  kind,
struct ccn_upcall_info info 
)

Called when a content object is received by sync and needs to be committed to stable storage by the repo.

Definition at line 416 of file ccnr_sync.c.

Referenced by r_sync_upcall_store(), and SyncRemoteFetchResponse().


Generated on Thu Feb 16 00:44:08 2012 for Content-Centric Networking in C by  doxygen 1.5.6