#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <ccn/btree.h>
#include <ccn/btree_content.h>
#include <ccn/ccn.h>
#include <ccn/charbuf.h>
#include <ccn/indexbuf.h>
#include <ccn/schedule.h>
#include <sync/SyncBase.h>
#include "ccnr_private.h"
#include "ccnr_dispatch.h"
#include "ccnr_io.h"
#include "ccnr_link.h"
#include "ccnr_msg.h"
#include "ccnr_proto.h"
#include "ccnr_store.h"
#include "ccnr_sync.h"
#include "ccnr_util.h"
Classes | |
struct | sync_enumeration_state |
State for an ongoing sync enumeration. More... | |
Functions | |
PUBLIC uintmax_t | ccnr_accession_encode (struct ccnr_handle *ccnr, ccnr_accession a) |
PUBLIC ccnr_accession | ccnr_accession_decode (struct ccnr_handle *ccnr, uintmax_t encoded) |
PUBLIC int | ccnr_accession_compare (struct ccnr_handle *ccnr, ccnr_accession x, ccnr_accession y) |
PUBLIC uintmax_t | ccnr_hwm_encode (struct ccnr_handle *ccnr, ccnr_hwm hwm) |
PUBLIC ccnr_hwm | ccnr_hwm_decode (struct ccnr_handle *ccnr, uintmax_t encoded) |
PUBLIC int | ccnr_acc_in_hwm (struct ccnr_handle *ccnr, ccnr_accession a, ccnr_hwm hwm) |
PUBLIC ccnr_hwm | ccnr_hwm_update (struct ccnr_handle *ccnr, ccnr_hwm hwm, ccnr_accession a) |
PUBLIC ccnr_hwm | ccnr_hwm_merge (struct ccnr_handle *ccnr, ccnr_hwm x, ccnr_hwm y) |
PUBLIC int | ccnr_hwm_compare (struct ccnr_handle *ccnr, ccnr_hwm x, ccnr_hwm y) |
PUBLIC void | r_sync_notify_after (struct ccnr_handle *ccnr, ccnr_hwm item) |
PUBLIC int | r_sync_notify_content (struct ccnr_handle *ccnr, int e, struct content_entry *content) |
A wrapper for SyncNotifyContent that takes a content entry. | |
static struct sync_enumeration_state * | cleanup_se (struct ccnr_handle *ccnr, struct sync_enumeration_state *md) |
static int | r_sync_enumerate_action (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags) |
PUBLIC int | r_sync_enumerate (struct ccnr_handle *ccnr, struct ccn_charbuf *interest) |
Request that a SyncNotifyContent call be made for each content object in the repository that matches the interest. | |
PUBLIC int | r_sync_lookup (struct ccnr_handle *ccnr, struct ccn_charbuf *interest, struct ccn_charbuf *content_ccnb) |
PUBLIC 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. | |
PUBLIC 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. | |
Variables | |
static const int | se_cookie = __LINE__ |
PUBLIC int r_sync_enumerate | ( | struct ccnr_handle * | ccnr, | |
struct ccn_charbuf * | interest | |||
) |
Request that a SyncNotifyContent call be made for each content object in the repository that matches 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.
PUBLIC 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.
returns 0 for success, -1 for error.