Part of CCNx Sync. More...
#include "SyncActions.h"
#include "SyncBase.h"
#include "SyncHashCache.h"
#include "SyncNode.h"
#include "SyncPrivate.h"
#include "SyncRoot.h"
#include "SyncUtil.h"
#include "SyncTreeWorker.h"
#include "IndexSorter.h"
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <ccn/ccn.h>
#include <ccn/charbuf.h>
#include <ccn/digest.h>
#include <ccn/fetch.h>
#include <ccn/seqwriter.h>
#include <ccn/uri.h>
#include <ccnr/ccnr_private.h>
#include <ccnr/ccnr_sync.h>
Classes | |
struct | SyncTestParms |
struct | storeFileStruct |
Defines | |
#define | MAX_READ_LEN 1000000 |
#define | DEFAULT_CMD_TIMEOUT 6000 |
Functions | |
PUBLIC void | ccnr_msg (struct ccnr_handle *h, const char *fmt,...) |
PUBLIC int | ccnr_msg_level_from_string (char *s) |
PUBLIC void | r_sync_notify_after (struct ccnr_handle *ccnr, ccnr_hwm item) |
PUBLIC int | r_sync_enumerate (struct ccnr_handle *ccnr, struct ccn_charbuf *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) |
Called when a content object has been constructed locally by sync and needs to be committed to stable storage by the repo. | |
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) |
static int | noteErr (const char *fmt,...) |
static int | parseAndAccumName (char *s, struct SyncNameAccum *na) |
static struct SyncNameAccum * | readAndAccumNames (FILE *input, int rem) |
static void | printTreeInner (struct SyncTreeWorkerHead *head, struct ccn_charbuf *tmpB, struct ccn_charbuf *tmpD, FILE *f) |
static void | printTree (struct SyncTreeWorkerHead *head, FILE *f) |
static void | putMark (FILE *f) |
static struct SyncNodeComposite * | testGenComposite (struct SyncBaseStruct *base, int nRefs) |
static int | testEncodeDecode (struct SyncTestParms *parms) |
static int | testReader (struct SyncTestParms *parms) |
static int | testReadBuilder (struct SyncTestParms *parms) |
static struct SyncRootStruct * | genTestRootRouting (struct SyncTestParms *parms) |
static struct SyncRootStruct * | genTestRootRepos (struct SyncTestParms *parms) |
static struct SyncRootStruct * | testRootCoding (struct SyncTestParms *parms, struct SyncRootStruct *root) |
static int | testRootLookup (struct SyncTestParms *parms, struct SyncRootStruct *root, char *goodName, char *badName) |
static int | testRootBasic (struct SyncTestParms *parms) |
static int | localStore (struct SyncTestParms *parms, struct ccn *ccn, struct ccn_charbuf *nm, struct ccn_charbuf *cb) |
static int | sendSlice (struct SyncTestParms *parms, char *topo, char *prefix, int count, char **clauses) |
static int64_t | segFromInfo (struct ccn_upcall_info *info) |
static enum ccn_upcall_res | storeHandler (struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info) |
static void | formatStats (struct SyncTestParms *parms) |
static int | getFile (struct SyncTestParms *parms, char *src, char *dst) |
static int | putFile (struct SyncTestParms *parms, char *src, char *dst) |
int | appendComponents (struct ccn_charbuf *dst, const struct ccn_charbuf *src, int start, int len) |
static int | putFileList (struct SyncTestParms *parms, char *listName) |
static int | existingRootOp (struct SyncTestParms *parms, char *topo, char *prefix, int delete) |
int | main (int argc, char **argv) |
Part of CCNx Sync.
PUBLIC 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.