SyncActions.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CCN_SyncActions
00019 #define CCN_SyncActions
00020
00021 #include <ccn/charbuf.h>
00022 #include "SyncBase.h"
00023 #include "SyncRoot.h"
00024 #include "SyncUtil.h"
00025
00026 struct SyncTreeWorkerHead;
00027 struct SyncCompareData;
00028
00029 enum SyncRegisterActionKind {
00030 SRI_Kind_None,
00031 SRI_Kind_AdviseInt,
00032 SRI_Kind_FetchInt,
00033 SRI_Kind_RootAdvise,
00034 SRI_Kind_NodeFetch,
00035 SRI_Kind_RootStats,
00036 SRI_Kind_Content
00037 };
00038
00039 enum SyncActionState {
00040 SyncActionState_init,
00041 SyncActionState_sent,
00042 SyncActionState_loose,
00043 SyncActionState_error,
00044 SyncActionState_done
00045 };
00046
00047 struct SyncActionData {
00048 struct SyncActionData *next;
00049 struct SyncRootStruct *root;
00050 struct SyncHashCacheEntry *ce;
00051 struct SyncCompareData *comp;
00052 void *client_handle;
00053 struct ccn_charbuf *prefix;
00054 struct ccn_charbuf *hash;
00055 int64_t startTime;
00056 enum SyncRegisterActionKind kind;
00057 enum SyncActionState state;
00058 int skipToHash;
00059 };
00060
00061
00062
00063
00064
00065 int
00066 SyncStartSliceEnum(struct SyncRootStruct *root);
00067
00068
00069
00070
00071
00072 int
00073 SyncStartHeartbeat(struct SyncBaseStruct *base);
00074
00075
00076
00077
00078
00079
00080 int
00081 SyncStartNodeFetch(struct SyncRootStruct *root,
00082 struct SyncHashCacheEntry *ce,
00083 struct SyncCompareData *comp);
00084
00085
00086
00087
00088
00089
00090 int
00091 SyncStartContentFetch(struct SyncRootStruct *root,
00092 struct ccn_charbuf *name,
00093 struct SyncCompareData *comp);
00094
00095
00096
00097
00098
00099
00100 int
00101 SyncAddName(struct SyncBaseStruct *base, struct ccn_charbuf *name, ccnr_accession item);
00102
00103
00104
00105
00106
00107
00108 int
00109 SyncHandleSlice(struct SyncBaseStruct *base, struct ccn_charbuf *name);
00110
00111
00112
00113
00114
00115
00116
00117 int
00118 SyncRegisterInterests(struct SyncRootStruct *root);
00119
00120
00121
00122
00123
00124
00125 int
00126 SyncSendRootAdviseInterest(struct SyncRootStruct *root);
00127
00128
00129
00130
00131
00132 int
00133 SyncUpdateRoot(struct SyncRootStruct *root);
00134
00135
00136
00137
00138
00139 int
00140 SyncStartCompareAction(struct SyncRootStruct *root, struct ccn_charbuf *hashR);
00141
00142 #endif