SyncActions.h File Reference

Part of CCNx Sync. More...

Go to the source code of this file.

Data Structures

struct  SyncActionData

Enumerations

enum  SyncRegisterActionKind {
  SRI_Kind_None, SRI_Kind_AdviseInt, SRI_Kind_FetchInt, SRI_Kind_RootAdvise,
  SRI_Kind_NodeFetch, SRI_Kind_RootStats, SRI_Kind_Content
}
enum  SyncActionState {
  SyncActionState_init, SyncActionState_sent, SyncActionState_loose, SyncActionState_error,
  SyncActionState_done
}

Functions

int SyncStartSliceEnum (struct SyncRootStruct *root)
 starts a slice enumeration for the root
int SyncStartHeartbeat (struct SyncBaseStruct *base)
 starts a periodic wakeup that maintains state across all roots
int SyncStartNodeFetch (struct SyncRootStruct *root, struct SyncHashCacheEntry *ce, struct SyncCompareData *comp)
 starts a remote fetch of the given node, based on the hash comp may be NULL if this is not for a compare
int SyncStartContentFetch (struct SyncRootStruct *root, struct ccn_charbuf *name, struct SyncCompareData *comp)
 starts a remote fetch of the given name comp may be NULL if this is not for a compare
int SyncAddName (struct SyncBaseStruct *base, struct ccn_charbuf *name, ccnr_accession item)
 Adds the given name to any applicable roots.
int SyncHandleSlice (struct SyncBaseStruct *base, struct ccn_charbuf *name)
 Creates a new slice from a full name.
int SyncRegisterInterests (struct SyncRootStruct *root)
 registers interests associated with the given root these include C1.S.RA (Root Advise) and C1.S.NF (Node Fetch) interests additional interests may be registered as the protocol evolves
int SyncSendRootAdviseInterest (struct SyncRootStruct *root)
 send a root advise request for the given root only one at a time may be outstanding
int SyncUpdateRoot (struct SyncRootStruct *root)
 updates the root with the current root->namesToAdd
int SyncStartCompareAction (struct SyncRootStruct *root, struct ccn_charbuf *hashR)
 initiates a compare action with the given remote hash

Detailed Description

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 SyncActions.h.


Enumeration Type Documentation

Enumerator:
SyncActionState_init 
SyncActionState_sent 
SyncActionState_loose 
SyncActionState_error 
SyncActionState_done 

Definition at line 39 of file SyncActions.h.

Enumerator:
SRI_Kind_None 
SRI_Kind_AdviseInt 

root advise handler

SRI_Kind_FetchInt 

node fetch handler

SRI_Kind_RootAdvise 

root advise request

SRI_Kind_NodeFetch 

node fetch request

SRI_Kind_RootStats 

root stats request

SRI_Kind_Content 

general content

Definition at line 29 of file SyncActions.h.


Function Documentation

int SyncAddName ( struct SyncBaseStruct base,
struct ccn_charbuf name,
ccnr_accession  item 
)

Adds the given name to any applicable roots.

Use item == 0 to ignore accession number.

Returns:
< 0 for failure, number of additions to roots for success.

Definition at line 855 of file ccn_sync.c.

Referenced by SyncNotifyContent(), and SyncStartContentFetch().

int SyncHandleSlice ( struct SyncBaseStruct base,
struct ccn_charbuf name 
)

Creates a new slice from a full name.

The name must start with base->priv->sliceCmdPrefix.

Returns:
< 0 if an error occurred, otherwise the new root number.

Definition at line 2481 of file ccn_sync.c.

Referenced by SyncNotifyContent().

int SyncRegisterInterests ( struct SyncRootStruct root  ) 

registers interests associated with the given root these include C1.S.RA (Root Advise) and C1.S.NF (Node Fetch) interests additional interests may be registered as the protocol evolves

Returns:
< 0 for error, >= 0 for success

Definition at line 2445 of file ccn_sync.c.

Referenced by SyncAddRoot().

int SyncSendRootAdviseInterest ( struct SyncRootStruct root  ) 

send a root advise request for the given root only one at a time may be outstanding

Returns:
< 0 for error, >= 0 for OK

Definition at line 3218 of file SyncActions.c.

Referenced by HeartbeatAction(), and UpdateAction().

int SyncStartCompareAction ( struct SyncRootStruct root,
struct ccn_charbuf hashR 
)

initiates a compare action with the given remote hash

Returns:
< 0 for error, >= 0 for OK

Definition at line 2206 of file ccn_sync.c.

Referenced by HeartbeatAction(), and SyncRootAdviseResponse().

int SyncStartContentFetch ( struct SyncRootStruct root,
struct ccn_charbuf name,
struct SyncCompareData *  comp 
)

starts a remote fetch of the given name comp may be NULL if this is not for a compare

Returns:
< 0 for error, >= 0 for success

Definition at line 2225 of file SyncActions.c.

Referenced by CompareAction().

int SyncStartHeartbeat ( struct SyncBaseStruct base  ) 

starts a periodic wakeup that maintains state across all roots

Returns:
< 0 for error, >= 0 for success

Definition at line 2491 of file ccn_sync.c.

Referenced by SyncInit().

int SyncStartNodeFetch ( struct SyncRootStruct root,
struct SyncHashCacheEntry ce,
struct SyncCompareData *  comp 
)

starts a remote fetch of the given node, based on the hash comp may be NULL if this is not for a compare

Returns:
< 0 for error, >= 0 for success

Definition at line 1646 of file ccn_sync.c.

Referenced by doComparison(), and doPreload().

int SyncStartSliceEnum ( struct SyncRootStruct root  ) 

starts a slice enumeration for the root

Returns:
< 0 for error, 0 if some enumeration is busy, 1 for success

Definition at line 2486 of file ccn_sync.c.

Referenced by HeartbeatAction(), and SyncNotifyContent().

int SyncUpdateRoot ( struct SyncRootStruct root  ) 

updates the root with the current root->namesToAdd

Returns:
< 0 for error, >= 0 for OK

Definition at line 3873 of file SyncActions.c.

Referenced by HeartbeatAction(), and testReadBuilder().

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