SyncRoot.h File Reference

Part of CCNx Sync. More...

Go to the source code of this file.

Data Structures

struct  SyncRootStruct
 A SyncRootStruct object holds the necessary data for a root sync tree. More...

Enumerations

enum  SyncRootLookupCode { SyncRootLookupCode_none, SyncRootLookupCode_covered, SyncRootLookupCode_error }

Functions

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.
int SyncRootAppendSlice (struct ccn_charbuf *cd, 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.h.


Enumeration Type Documentation

Enumerator:
SyncRootLookupCode_none 

not covered by this root

SyncRootLookupCode_covered 

covered by this root

SyncRootLookupCode_error 

error in the name or the state

Definition at line 110 of file SyncRoot.h.


Function Documentation

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