CCNx-Android-Services/jni/csrc/sync/SyncTest.c File Reference

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

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 struct SyncRootStruct * newDefaultRoot (struct SyncTestParms *parms, struct SyncNameAccum *filter)
static int testReadBuilder (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 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)
static int existingRootOp (struct SyncTestParms *parms, char *topo, char *prefix, int delete)
int main (int argc, char **argv)


Detailed Description

Part of CCNX Sync.

Copyright (C) 2011 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.


Function Documentation

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.


Generated on Thu Feb 16 00:45:13 2012 for CCNx for Android by  doxygen 1.5.6