SyncRoot.h File Reference

Copyright (C) 2011 Palo Alto Research Center, Inc. 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, 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

Copyright (C) 2011 Palo Alto Research Center, Inc.

Part of CCNx Sync.

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 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 107 of file SyncRoot.h.


Function Documentation

struct SyncRootStruct* SyncAddRoot ( struct SyncBaseStruct base,
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 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 103 of file SyncRoot.c.

Referenced by newDefaultRoot(), and SyncRootDecodeAndAdd().

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 168 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 279 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 224 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 314 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 302 of file SyncRoot.c.

Referenced by testReadBuilder(), and UpdateAction().


Generated on Thu Feb 16 00:44:28 2012 for Content-Centric Networking in C by  doxygen 1.5.6