SyncHashCache.c File Reference

Part of CCNx Sync. More...

Go to the source code of this file.

Functions

static struct SyncHashCacheEntrylocalFreeEntry (struct SyncHashCacheEntry *ce)
struct SyncHashCacheEntrySyncHashLookup (struct SyncHashCacheHead *head, const unsigned char *xp, ssize_t xs)
 lookup a full hash in a hash table (raw contents, no tag)
struct SyncHashCacheEntrySyncHashEnter (struct SyncHashCacheHead *head, const unsigned char *xp, ssize_t xs, enum SyncHashState set)
 based on the raw hash, ensure that a remote cache entry exists ent->state |= set
void SyncHashRemoveEntry (struct SyncHashCacheHead *head, struct SyncHashCacheEntry *ce)
 remove the entry (if present)
void SyncHashClearMarks (struct SyncHashCacheHead *head)
 clear all marks
struct SyncHashCacheHeadSyncHashCacheCreate (struct SyncRootStruct *root, uint32_t mod)
 create a new hash table with the given modulus (mod == 0 uses a default)
struct SyncHashCacheHeadSyncHashCacheFree (struct SyncHashCacheHead *head)
 frees the cache resources caller must ensure no further use of the cache
int SyncCacheEntryStore (struct SyncHashCacheEntry *ce)
 stores the cahe entry to the repo to be eligible, ce != NULL && ce->ncL == NULL && (ce->state & SyncHashState_stored) == 0
int SyncCacheEntryFetch (struct SyncHashCacheEntry *ce)
 fetches the cache entry to be eligible, ce != NULL && ce->ncL != NULL && (ce->state & SyncHashState_stored) == 1

Detailed Description

Part of CCNx Sync.

Definition in file SyncHashCache.c.


Function Documentation

static struct SyncHashCacheEntry* localFreeEntry ( struct SyncHashCacheEntry ce  )  [static, read]

Definition at line 33 of file SyncHashCache.c.

Referenced by SyncHashCacheFree(), and SyncHashRemoveEntry().

int SyncCacheEntryFetch ( struct SyncHashCacheEntry ce  ) 

fetches the cache entry to be eligible, ce != NULL && ce->ncL != NULL && (ce->state & SyncHashState_stored) == 1

Returns:
< 0 for failure, 0 if not eligible, and > 0 for success

Definition at line 209 of file SyncHashCache.c.

Referenced by cacheEntryForElem(), doComparison(), formatStats(), newNodeCommon(), SyncInterestArrived(), SyncTreeMergeNames(), and UpdateAction().

int SyncCacheEntryStore ( struct SyncHashCacheEntry ce  ) 

stores the cahe entry to the repo to be eligible, ce != NULL && ce->ncL == NULL && (ce->state & SyncHashState_stored) == 0

Returns:
< 0 for failure, 0 if not eligible, and > 0 for success

Definition at line 176 of file SyncHashCache.c.

Referenced by HeartbeatAction().

struct SyncHashCacheHead* SyncHashCacheCreate ( struct SyncRootStruct root,
uint32_t  mod 
) [read]

create a new hash table with the given modulus (mod == 0 uses a default)

Definition at line 144 of file SyncHashCache.c.

Referenced by SyncAddRoot().

struct SyncHashCacheHead* SyncHashCacheFree ( struct SyncHashCacheHead head  )  [read]

frees the cache resources caller must ensure no further use of the cache

Returns:
NULL

Definition at line 154 of file SyncHashCache.c.

Referenced by SyncRemRoot().

void SyncHashClearMarks ( struct SyncHashCacheHead head  ) 

clear all marks

Definition at line 130 of file SyncHashCache.c.

Referenced by purgeOldEntries().

struct SyncHashCacheEntry* SyncHashEnter ( struct SyncHashCacheHead head,
const unsigned char *  xp,
ssize_t  xs,
enum SyncHashState  set 
) [read]

based on the raw hash, ensure that a remote cache entry exists ent->state |= set

Definition at line 63 of file SyncHashCache.c.

Referenced by ccns_open(), ccns_root_advise_response(), ensureRemoteEntry(), newNodeCommon(), SyncInterestArrived(), SyncRemoteFetchResponse(), SyncRootAdviseResponse(), SyncStartCompareAction(), and UpdateAction().

struct SyncHashCacheEntry* SyncHashLookup ( struct SyncHashCacheHead head,
const unsigned char *  xp,
ssize_t  xs 
) [read]

lookup a full hash in a hash table (raw contents, no tag)

Returns:
entry if it exists

Definition at line 43 of file SyncHashCache.c.

Referenced by cacheEntryForElem(), ccns_send_root_advise_interest(), CompareAction(), doPreload(), MakeNodeFromNames(), newNodeCommon(), nodeFromNodes(), SyncRemoteFetchResponse(), SyncRootTopEntry(), SyncStartCompareAction(), and SyncTreeWorkerPush().

void SyncHashRemoveEntry ( struct SyncHashCacheHead head,
struct SyncHashCacheEntry ce 
)

remove the entry (if present)

Definition at line 106 of file SyncHashCache.c.

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