Koorde.h

Go to the documentation of this file.
00001 //
00002 // Copyright (C) 2007 Institut fuer Telematik, Universitaet Karlsruhe (TH)
00003 //
00004 // This program is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU General Public License
00006 // as published by the Free Software Foundation; either version 2
00007 // of the License, or (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 //
00018 
00024 #ifndef __KOORDE_H_
00025 #define __KOORDE_H_
00026 
00027 #include <omnetpp.h>
00028 
00029 #include <IPvXAddress.h>
00030 
00031 #include <OverlayKey.h>
00032 #include <NodeHandle.h>
00033 #include <BaseOverlay.h>
00034 
00035 #include "../chord/ChordSuccessorList.h"
00036 #include "../chord/Chord.h"
00037 
00038 namespace oversim {
00039 
00050 class Koorde : public Chord
00051 {
00052   public:
00053     // see BaseOverlay.h
00054     virtual void initializeOverlay(int stage);
00055 
00056     // see BaseOverlay.h
00057     virtual void handleTimerEvent(cMessage* msg);
00058 
00059     // see BaseOverlay.h
00060     virtual void handleUDPMessage(BaseOverlayMessage* msg);
00061 
00062     // see BaseOverlay.h
00063     virtual void recordOverlaySentStats(BaseOverlayMessage* msg);
00064 
00065     // see BaseOverlay.h
00066     virtual void finishOverlay();
00067 
00071     virtual void updateTooltip ();
00072 
00073   protected:
00074     //parameters
00075     int deBruijnDelay; 
00076     bool pingProtocol; 
00077     int deBruijnNumber; 
00078     int deBruijnListSize; 
00079     int shiftingBits; 
00080     bool fastLookup; 
00081     bool sucDeBruijnNodeSet; 
00082     bool preDeBruijnNodeSet; 
00083     bool useOtherLookup; 
00084     bool useSucList; 
00085     bool breakLookup; 
00086     bool firstTimer; 
00087     int deBruijnRetryTime; 
00088     int failedDBResponses; 
00089     bool preOrSuc; 
00091     //statistics
00092     int deBruijnCount; 
00093     int deBruijnBytesSent; 
00095     //Node handles
00096     NodeHandle* deBruijnNodes; 
00097     NodeHandle deBruijnNode; 
00100     //Timer Messages
00101     cMessage* deBruijn_timer; 
00108     virtual void changeState(int state);
00109 
00115     virtual void handleDeBruijnTimerExpired(cMessage* msg);
00116 
00122     virtual void handleFixFingersTimerExpired(cMessage* msg);
00123 
00124     // see BaseOverlay.h
00125     virtual bool handleRpc( BaseCallMessage* msg );
00126 
00127     // see BaseOverlay.h
00128     virtual void handleRpcResponse(BaseResponseMessage* msg,
00129                                    cPolymorphic* context, int rpcId,
00130                                    simtime_t rtt );
00131 
00132     // see BaseOverlay.h
00133     virtual void handleRpcTimeout(BaseCallMessage* msg,
00134                                   const TransportAddress& dest,
00135                                   cPolymorphic* context,
00136                                   int rpcId, const OverlayKey& destKey);
00137 
00143     virtual void handleRpcJoinResponse(JoinResponse* joinResponse);
00144 
00150     virtual void handleRpcDeBruijnRequest(DeBruijnCall* deBruinCall);
00151 
00157     virtual void handleRpcDeBruijnResponse(DeBruijnResponse* deBruijnResponse);
00158 
00159 
00165     virtual void handleDeBruijnTimeout(DeBruijnCall* deBruijnCall);
00166 
00167 
00176     virtual NodeHandle findDeBruijnHop(const OverlayKey& destKey,
00177                                        KoordeFindNodeExtMessage*
00178                                        findNodeExt);
00179 
00180     // see BaseOverlay.h
00181     NodeVector* findNode(const OverlayKey& key,
00182                          int numRedundantNodes,
00183                          int numSiblings,
00184                          BaseOverlayMessage* msg);
00194     virtual OverlayKey findStartKey(const OverlayKey& startKey,
00195                                     const OverlayKey& endKey,
00196                                     const OverlayKey& destKey);
00197 
00206     virtual int findLongestMatch(const OverlayKey& srcKey,
00207                                  const OverlayKey& destKey);
00208 
00218     virtual const NodeHandle& walkDeBruijnList(const OverlayKey& key);
00219 
00229     virtual const NodeHandle& walkSuccessorList(const OverlayKey& key);
00230 
00236     virtual void handleRpcStabilizeResponse(
00237             StabilizeResponse* stabilizeResponse);
00238 
00244     virtual void rpcJoin(JoinCall* call);
00245 
00251     virtual void rpcNotify(NotifyCall* call);
00252 
00258     virtual void handleRpcNotifyResponse(NotifyResponse* notifyResponse);
00259 
00260 
00264     virtual void findFriendModules();
00265 
00269     virtual void initializeFriendModules();
00270 
00271 
00277     virtual void predecessorIsDead();
00278 
00284     virtual void successorIsDead();
00285 
00286 };
00287 
00288 }; //namespace
00289 
00290 #endif
00291 

Generated on Wed Mar 25 16:32:49 2009 for OverSim by  doxygen 1.5.5