00001 /** 00002 * @file sync/SyncPrivate.h 00003 * 00004 * Copyright (C) 2011 Palo Alto Research Center, Inc. 00005 * 00006 * Part of CCNx Sync. 00007 * 00008 * This library is free software; you can redistribute it and/or modify it 00009 * under the terms of the GNU Lesser General Public License version 2.1 00010 * as published by the Free Software Foundation. 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. You should have received 00015 * a copy of the GNU Lesser General Public License along with this library; 00016 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, 00017 * Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 00020 #ifndef CCN_SyncPrivate 00021 #define CCN_SyncPrivate 00022 00023 #include "SyncBase.h" 00024 #include "SyncRoot.h" 00025 #include "SyncUtil.h" 00026 00027 struct SyncHashCacheEntry; // from SyncHashCache.h 00028 00029 struct SyncNameAccumList { 00030 struct SyncNameAccumList *next; 00031 struct SyncNameAccum *accum; 00032 }; 00033 00034 struct SyncPrivate { 00035 struct SyncRootStruct *rootHead; 00036 int nRoots; 00037 int useRepoStore; 00038 int stableEnabled; 00039 struct SyncNameAccum *topoAccum; 00040 struct SyncNameAccum *prefixAccum; 00041 struct SyncNameAccumList *filters; 00042 struct ccn_charbuf *localHostPrefix; 00043 struct ccn_charbuf *sliceCmdPrefix; 00044 struct SyncHashCacheEntry *storingHead; 00045 struct SyncHashCacheEntry *storingTail; 00046 struct ccn_indexbuf *comps; /*< used by SyncNotifyContent */ 00047 int nStoring; 00048 ccnr_hwm stableTarget; 00049 ccnr_hwm stableStored; 00050 sync_time lastStable; 00051 sync_time lastCacheClean; 00052 int sliceEnum; 00053 int sliceBusy; 00054 int fauxErrorTrigger; 00055 int syncActionsPrivate; 00056 int heartbeatMicros; 00057 int rootAdviseFresh; /*< seconds for root advise response freshness */ 00058 int rootAdviseLifetime; /*< seconds for root advise interest lifetime */ 00059 int fetchLifetime; /*< seconds for node fetch interest lifetime */ 00060 int maxFetchBusy; /*< max # of fetches per root busy */ 00061 int comparesBusy; /*< # of roots doing compares */ 00062 int maxComparesBusy; /*< max # of roots doing compares */ 00063 }; 00064 00065 struct SyncHashInfoList { 00066 struct SyncHashInfoList *next; 00067 struct SyncHashCacheEntry *ce; 00068 sync_time lastSeen; 00069 }; 00070 00071 struct SyncRootStats { 00072 uint64_t updatesDone; /*< number of sync tree root updates done */ 00073 uint64_t lastUpdateMicros; /*< last elapsed update time (microsecs) */ 00074 uint64_t comparesDone; /*< number of sync tree compares completed */ 00075 uint64_t lastCompareMicros; /*< last elapsed compare time (microsecs) */ 00076 uint64_t nodesCreated; /*< number of new nodes created */ 00077 uint64_t nodesShared; /*< number of nodes shared */ 00078 00079 uint64_t rootAdviseSent; /*< number of RootAdvise interests sent */ 00080 uint64_t nodeFetchSent; /*< number of NodeFetch interests sent */ 00081 uint64_t contentFetchSent; /*< number of content fetch interests sent */ 00082 00083 uint64_t rootAdviseSeen; /*< number of RootAdvise interests received */ 00084 uint64_t nodeFetchSeen; /*< number of NodeFetch interests received */ 00085 00086 uint64_t rootAdviseReceived; /*< number of RootAdvise responses received */ 00087 uint64_t nodeFetchReceived; /*< number of NodeFetch responses received */ 00088 uint64_t contentFetchReceived; /*< number of content objects received */ 00089 00090 uint64_t rootAdviseBytes; /*< number of bytes for RootAdvise responses */ 00091 uint64_t nodeFetchBytes; /*< number of bytes for NodeFetch responses */ 00092 uint64_t contentFetchBytes; /*< number of bytes for content objects */ 00093 00094 uint64_t rootAdviseTimeout; /*< number of RootAdvise response timeouts */ 00095 uint64_t nodeFetchTimeout; /*< number of NodeFetch response timeouts */ 00096 uint64_t contentFetchTimeout; /*< number of content object response timeouts */ 00097 00098 uint64_t rootAdviseFailed; /*< number of RootAdvise response failures */ 00099 uint64_t nodeFetchFailed; /*< number of NodeFetch response failures */ 00100 uint64_t contentFetchFailed; /*< number of content object response failures */ 00101 00102 }; 00103 00104 struct SyncRootPrivate { 00105 struct SyncRootStats *stats; 00106 struct SyncHashInfoList *remoteSeen; 00107 int sliceBusy; 00108 ccnr_hwm highWater; // high water via SyncNotifyContent 00109 ccnr_hwm stablePoint; // stable point for this root 00110 sync_time lastAdvise; 00111 sync_time lastUpdate; 00112 sync_time lastStable; 00113 sync_time lastHashChange; 00114 int adviseNeed; 00115 struct SyncHashCacheEntry *lastLocalSent; 00116 size_t currentSize; 00117 size_t prevAddLen; 00118 }; 00119 00120 #endif