SyncRoot.c File Reference

Part of CCNx Sync. More...

Go to the source code of this file.

Functions

static struct SyncNameAccumcopyFilter (struct SyncNameAccum *filter)
 copies the filter, including copies of the names
static struct SyncNameAccumcanonFilter (struct SyncBaseStruct *base, struct SyncNameAccum *filter)
 canonicalizes the filter returns an existing equivalent filter if one is found otherwise copies the input filter, links it in, and returns the copy
struct SyncRootStructSyncAddRoot (struct SyncBaseStruct *base, int syncScope, const struct ccn_charbuf *topoPrefix, const struct ccn_charbuf *namingPrefix, struct SyncNameAccum *filter)
 namesToAdd has the names where content is known to be present.
struct SyncRootStructSyncRemRoot (struct SyncRootStruct *root)
 Removes the root from the base, and frees up associated storage.
struct SyncRootStructSyncRootDecodeAndAdd (struct SyncBaseStruct *base, struct ccn_buf_decoder *d)
 Parse a content object representing a config slice, and if successful add it to the base.
static int appendName (struct ccn_charbuf *cb, struct ccn_charbuf *name)
int SyncRootAppendSlice (struct ccn_charbuf *cb, struct SyncRootStruct *root)
 Appends the ccnb encoding for a config slice to the provided cb.
struct SyncHashCacheEntrySyncRootTopEntry (struct SyncRootStruct *root)
enum SyncRootLookupCode SyncRootLookupName (struct SyncRootStruct *root, const struct ccn_charbuf *name)
 Tests to see if the name is covered by this root.

Detailed Description

Part of CCNx Sync.

Definition in file SyncRoot.c.


Function Documentation

static int appendName ( struct ccn_charbuf cb,
struct ccn_charbuf name 
) [static]

Definition at line 292 of file SyncRoot.c.

Referenced by SyncRootAppendSlice().

static struct SyncNameAccum* canonFilter ( struct SyncBaseStruct base,
struct SyncNameAccum filter 
) [static, read]

canonicalizes the filter returns an existing equivalent filter if one is found otherwise copies the input filter, links it in, and returns the copy

Definition at line 71 of file SyncRoot.c.

Referenced by SyncAddRoot().

static struct SyncNameAccum* copyFilter ( struct SyncNameAccum filter  )  [static, read]

copies the filter, including copies of the names

Definition at line 49 of file SyncRoot.c.

Referenced by canonFilter().

struct SyncRootStruct* SyncAddRoot ( struct SyncBaseStruct base,
int  syncScope,
const struct ccn_charbuf topoPrefix,
const struct ccn_charbuf namingPrefix,
struct SyncNameAccum filter 
) [read]

namesToAdd has the names where content is known to be present.

These names should come from SyncNotifyContent. The name storage belongs to the root.

namesToFetch has the names where content should be fetched. Once content is fetched and stored to the repo the names should be appended to namesToAdd. The name storage belongs to the root. Creates a new root structure and adds it to the base. The syncScope will be used for sync control interests (-1 for unscoped). The topoPrefix and namingPrefix will be copied and canonicalized. The filter (and the names in it) will also be copied and canonicalized. Canonicalized data is owned by the base.

Returns:
the new root object

Definition at line 106 of file SyncRoot.c.

Referenced by ccns_open(), genTestRootRepos(), genTestRootRouting(), SyncRootDecodeAndAdd(), and testReadBuilder().

struct SyncRootStruct* SyncRemRoot ( struct SyncRootStruct root  )  [read]

Removes the root from the base, and frees up associated storage.

Requires that there are no active comparisons. Deactivates all pending interests.

Returns:
NULL if the root was removed, the root itself if not removed.

Definition at line 176 of file SyncRoot.c.

Referenced by findAndDeleteRoot(), main(), SyncFreeBase(), SyncHandleSlice(), testRootBasic(), and testRootCoding().

int SyncRootAppendSlice ( struct ccn_charbuf cd,
struct SyncRootStruct root 
)

Appends the ccnb encoding for a config slice to the provided cb.

Returns:
-1 for failure, 0 for success.

Definition at line 307 of file SyncRoot.c.

Referenced by SyncAddRoot(), and testRootCoding().

struct SyncRootStruct* SyncRootDecodeAndAdd ( struct SyncBaseStruct base,
struct ccn_buf_decoder d 
) [read]

Parse a content object representing a config slice, and if successful add it to the base.

Returns:
the new root if successful, NULL otherwise.

Definition at line 251 of file SyncRoot.c.

Referenced by SyncHandleSlice(), and testRootCoding().

enum SyncRootLookupCode SyncRootLookupName ( struct SyncRootStruct root,
const struct ccn_charbuf name 
)

Tests to see if the name is covered by this root.

Useful for testing full names given by the Repo. The topoPrefix does not participate, but the filter does.

Returns:
a code indicating the result

Definition at line 343 of file SyncRoot.c.

Referenced by SyncAddName(), and testRootLookup().

struct SyncHashCacheEntry* SyncRootTopEntry ( struct SyncRootStruct root  )  [read]
Returns:
the top entry, if the root hash has been established for this root, otherwise returns NULL.

Definition at line 331 of file SyncRoot.c.

Referenced by testReadBuilder(), and UpdateAction().

Generated on Tue Aug 21 14:54:56 2012 for Content-Centric Networking in C by  doxygen 1.6.3