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     virtual ~Koorde();
00054 
00055     // see BaseOverlay.h
00056     virtual void initializeOverlay(int stage);
00057 
00058     // see BaseOverlay.h
00059     virtual void handleTimerEvent(cMessage* msg);
00060 
00061     // see BaseOverlay.h
00062     virtual void handleUDPMessage(BaseOverlayMessage* msg);
00063 
00064     // see BaseOverlay.h
00065     virtual void recordOverlaySentStats(BaseOverlayMessage* msg);
00066 
00067     // see BaseOverlay.h
00068     virtual void finishOverlay();
00069 
00073     virtual void updateTooltip ();
00074 
00075   protected:
00076     //parameters
00077     int deBruijnDelay; 
00078     int deBruijnNumber; 
00079     int deBruijnListSize; 
00080     int shiftingBits; 
00081     bool useOtherLookup; 
00082     bool useSucList; 
00083     bool breakLookup; 
00084     bool setupDeBruijnBeforeJoin; 
00085     bool setupDeBruijnAtJoin; 
00087     //statistics
00088     int deBruijnCount; 
00089     int deBruijnBytesSent; 
00091     //Node handles
00092     NodeHandle* deBruijnNodes; 
00093     NodeHandle deBruijnNode; 
00095     //Timer Messages
00096     cMessage* deBruijn_timer; 
00103     virtual void changeState(int state);
00104 
00109     virtual void handleDeBruijnTimerExpired();
00110 
00116     //virtual void handleFixFingersTimerExpired(cMessage* msg);
00117 
00118     // see BaseOverlay.h
00119     virtual bool handleRpcCall(BaseCallMessage* msg);
00120 
00121     // see BaseOverlay.h
00122     virtual void handleRpcResponse(BaseResponseMessage* msg,
00123                                    cPolymorphic* context, int rpcId,
00124                                    simtime_t rtt );
00125 
00126     // see BaseOverlay.h
00127     virtual void handleRpcTimeout(BaseCallMessage* msg,
00128                                   const TransportAddress& dest,
00129                                   cPolymorphic* context,
00130                                   int rpcId, const OverlayKey& destKey);
00131 
00137     virtual void handleRpcJoinResponse(JoinResponse* joinResponse);
00138 
00144     virtual void handleRpcDeBruijnRequest(DeBruijnCall* deBruinCall);
00145 
00151     virtual void handleRpcDeBruijnResponse(DeBruijnResponse* deBruijnResponse);
00152 
00158     virtual void handleDeBruijnTimeout(DeBruijnCall* deBruijnCall);
00159 
00168     virtual NodeHandle findDeBruijnHop(const OverlayKey& destKey,
00169                                        KoordeFindNodeExtMessage* findNodeExt);
00170 
00171     // see BaseOverlay.h
00172     NodeVector* findNode(const OverlayKey& key,
00173                          int numRedundantNodes,
00174                          int numSiblings,
00175                          BaseOverlayMessage* msg);
00186     virtual OverlayKey findStartKey(const OverlayKey& startKey,
00187                                     const OverlayKey& endKey,
00188                                     const OverlayKey& destKey,
00189                                     int& step);
00190 
00200     virtual const NodeHandle& walkDeBruijnList(const OverlayKey& key);
00201 
00211     virtual const NodeHandle& walkSuccessorList(const OverlayKey& key);
00212 
00213     // see BaseOverlay.h
00214     virtual bool handleFailedNode(const TransportAddress& failed);
00215 
00216     // see Chord.h
00217     virtual void rpcJoin(JoinCall* call);
00218 
00219     // see Chord.h
00220     virtual void findFriendModules();
00221 
00222     // see Chord.h
00223     virtual void initializeFriendModules();
00224 
00225 };
00226 
00227 }; //namespace
00228 
00229 #endif
00230 
Generated on Wed May 26 16:21:14 2010 for OverSim by  doxygen 1.6.3