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.

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 SyncHashCache.c.


Function Documentation

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

Definition at line 32 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 205 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 172 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 140 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 150 of file SyncHashCache.c.

Referenced by SyncRemRoot().

void SyncHashClearMarks ( struct SyncHashCacheHead head  ) 

clear all marks

Definition at line 126 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 62 of file SyncHashCache.c.

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

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

void SyncHashRemoveEntry ( struct SyncHashCacheHead head,
struct SyncHashCacheEntry ce 
)

remove the entry (if present)

Definition at line 102 of file SyncHashCache.c.


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