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 "SyncBase.h"
00022 #include "SyncNode.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 SyncCompareData *comp;
00051 struct ccnr_handle *ccnr;
00052 struct ccn_charbuf *prefix;
00053 struct ccn_charbuf *hash;
00054 sync_time startTime;
00055 enum SyncRegisterActionKind kind;
00056 enum SyncActionState state;
00057 int skipToHash;
00058 };
00059
00060
00061
00062
00063
00064 int
00065 SyncStartSliceEnum(struct SyncRootStruct *root);
00066
00067
00068
00069
00070
00071 int
00072 SyncStartHeartbeat(struct SyncBaseStruct *base);
00073
00074
00075
00076
00077
00078
00079 int
00080 SyncStartNodeFetch(struct SyncRootStruct *root,
00081 struct SyncHashCacheEntry *ce,
00082 struct SyncCompareData *comp);
00083
00084
00085
00086
00087
00088
00089 int
00090 SyncStartContentFetch(struct SyncRootStruct *root,
00091 struct ccn_charbuf *name,
00092 struct SyncCompareData *comp);
00093
00094
00095
00096
00097
00098
00099 int
00100 SyncAddName(struct SyncBaseStruct *base, struct ccn_charbuf *name, ccnr_accession item);
00101
00102
00103
00104
00105
00106
00107 int
00108 SyncHandleSlice(struct SyncBaseStruct *base, struct ccn_charbuf *name);
00109
00110
00111
00112
00113
00114
00115
00116 int
00117 SyncRegisterInterests(struct SyncRootStruct *root);
00118
00119
00120
00121
00122
00123
00124 int
00125 SyncSendRootAdviseInterest(struct SyncRootStruct *root);
00126
00127
00128
00129
00130
00131 int
00132 SyncUpdateRoot(struct SyncRootStruct *root);
00133
00134
00135
00136
00137
00138 int
00139 SyncStartCompareAction(struct SyncRootStruct *root, struct ccn_charbuf *hashR);
00140
00141 #endif