Go to the source code of this file.
Functions | |
PUBLIC void | ccnr_msg (struct ccnr_handle *h, const char *fmt,...) |
Produce ccnr debug output. | |
PUBLIC int | ccnr_msg_level_from_string (char *s) |
PUBLIC 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. | |
PUBLIC 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. | |
PUBLIC 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. | |
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) |
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.
Definition in file SyncTest.c.
PUBLIC int ccnr_acc_in_hwm | ( | struct ccnr_handle * | ccnr, | |
ccnr_accession | a, | |||
ccnr_hwm | hwm | |||
) |
Definition at line 209 of file SyncTest.c.
PUBLIC int ccnr_accession_compare | ( | struct ccnr_handle * | ccnr, | |
ccnr_accession | x, | |||
ccnr_accession | y | |||
) |
Definition at line 188 of file SyncTest.c.
PUBLIC ccnr_accession ccnr_accession_decode | ( | struct ccnr_handle * | ccnr, | |
uintmax_t | encoded | |||
) |
Definition at line 182 of file SyncTest.c.
Referenced by r_store_content_btree_insert(), and r_store_look().
PUBLIC uintmax_t ccnr_accession_encode | ( | struct ccnr_handle * | ccnr, | |
ccnr_accession | a | |||
) |
Definition at line 176 of file SyncTest.c.
Referenced by r_store_content_base(), r_store_content_btree_insert(), r_store_content_from_accession(), r_store_set_accession_from_offset(), r_sync_enumerate(), r_sync_notify_content(), and SyncAddName().
PUBLIC int ccnr_hwm_compare | ( | struct ccnr_handle * | ccnr, | |
ccnr_hwm | x, | |||
ccnr_hwm | y | |||
) |
PUBLIC ccnr_hwm ccnr_hwm_decode | ( | struct ccnr_handle * | ccnr, | |
uintmax_t | encoded | |||
) |
PUBLIC uintmax_t ccnr_hwm_encode | ( | struct ccnr_handle * | ccnr, | |
ccnr_hwm | hwm | |||
) |
Definition at line 197 of file SyncTest.c.
Referenced by HeartbeatAction(), storeStablePoint(), and UpdateAction().
PUBLIC ccnr_hwm ccnr_hwm_merge | ( | struct ccnr_handle * | ccnr, | |
ccnr_hwm | x, | |||
ccnr_hwm | y | |||
) |
Definition at line 221 of file SyncTest.c.
PUBLIC ccnr_hwm ccnr_hwm_update | ( | struct ccnr_handle * | ccnr, | |
ccnr_hwm | hwm, | |||
ccnr_accession | a | |||
) |
PUBLIC void ccnr_msg | ( | struct ccnr_handle * | h, | |
const char * | fmt, | |||
... | ||||
) |
Produce ccnr debug output.
Output is produced via h->logger under the control of h->debug; prepends decimal timestamp and process identification. Caller should not supply newlines.
h | the ccnr handle | |
fmt | printf-like format string |
Definition at line 83 of file SyncTest.c.
PUBLIC int ccnr_msg_level_from_string | ( | char * | s | ) |
Definition at line 100 of file SyncTest.c.
static int existingRootOp | ( | struct SyncTestParms * | parms, | |
char * | topo, | |||
char * | prefix, | |||
int | delete | |||
) | [static] |
static void formatStats | ( | struct SyncTestParms * | parms | ) | [static] |
Definition at line 1053 of file SyncTest.c.
static int getFile | ( | struct SyncTestParms * | parms, | |
char * | src, | |||
char * | dst | |||
) | [static] |
static int localStore | ( | struct ccn * | ccn, | |
struct ccn_charbuf * | nm, | |||
struct ccn_charbuf * | cb | |||
) | [static] |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 1432 of file SyncTest.c.
static struct SyncRootStruct* newDefaultRoot | ( | struct SyncTestParms * | parms, | |
struct SyncNameAccum * | filter | |||
) | [static, read] |
static int noteErr | ( | const char * | fmt, | |
... | ||||
) | [static] |
Definition at line 241 of file SyncTest.c.
Referenced by existingRootOp(), main(), newDefaultRoot(), putFile(), sendSlice(), storeHandler(), testReadBuilder(), testReader(), testRootBasic(), testRootCoding(), and testRootLookup().
static int parseAndAccumName | ( | char * | s, | |
struct SyncNameAccum * | na | |||
) | [static] |
static void printTree | ( | struct SyncTreeWorkerHead * | head, | |
FILE * | f | |||
) | [static] |
static void printTreeInner | ( | struct SyncTreeWorkerHead * | head, | |
struct ccn_charbuf * | tmpB, | |||
struct ccn_charbuf * | tmpD, | |||
FILE * | f | |||
) | [static] |
static int putFile | ( | struct SyncTestParms * | parms, | |
char * | src, | |||
char * | dst | |||
) | [static] |
static void putMark | ( | FILE * | f | ) | [static] |
Definition at line 407 of file SyncTest.c.
Referenced by existingRootOp(), formatStats(), putFile(), sendSlice(), and storeHandler().
PUBLIC 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.
Definition at line 131 of file SyncTest.c.
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.
Definition at line 168 of file SyncTest.c.
PUBLIC 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 140 of file SyncTest.c.
PUBLIC 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 124 of file SyncTest.c.
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.
Definition at line 153 of file SyncTest.c.
static struct SyncNameAccum* readAndAccumNames | ( | FILE * | input, | |
int | rem | |||
) | [static, read] |
static int64_t segFromInfo | ( | struct ccn_upcall_info * | info | ) | [static] |
static int sendSlice | ( | struct SyncTestParms * | parms, | |
char * | topo, | |||
char * | prefix, | |||
int | count, | |||
char ** | clauses | |||
) | [static] |
static enum ccn_upcall_res storeHandler | ( | struct ccn_closure * | selfp, | |
enum ccn_upcall_kind | kind, | |||
struct ccn_upcall_info * | info | |||
) | [static] |
static int testEncodeDecode | ( | struct SyncTestParms * | parms | ) | [static] |
static struct SyncNodeComposite* testGenComposite | ( | struct SyncBaseStruct * | base, | |
int | nRefs | |||
) | [static, read] |
static int testReadBuilder | ( | struct SyncTestParms * | parms | ) | [static] |
static int testReader | ( | struct SyncTestParms * | parms | ) | [static] |
static int testRootBasic | ( | struct SyncTestParms * | parms | ) | [static] |
static struct SyncRootStruct* testRootCoding | ( | struct SyncTestParms * | parms, | |
struct SyncRootStruct * | root | |||
) | [static, read] |
static int testRootLookup | ( | struct SyncTestParms * | parms, | |
struct SyncRootStruct * | root, | |||
char * | goodName, | |||
char * | badName | |||
) | [static] |