ChordMessage_m.h
Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef _CHORDMESSAGE_M_H_
00006 #define _CHORDMESSAGE_M_H_
00007
00008 #include <omnetpp.h>
00009
00010
00011 #define MSGC_VERSION 0x0400
00012 #if (MSGC_VERSION!=OMNETPP_VERSION)
00013 # error Version mismatch! Probably this file was generated by an earlier version of opp_msgc: 'make clean' should help.
00014 #endif
00015
00016
00017
00018 #include <IPvXAddress.h>
00019 #include <NodeHandle.h>
00020 #include <TransportAddress.h>
00021 #include <CommonMessages_m.h>
00022
00023
00024 static const int CHORDCOMMAND_L = 8;
00025 static const int SUCNUM_L = 8;
00026 static const int FINGER_L = 8;
00027 static const int STEP_L = 8;
00028 static const int PRENODESET_L = 1;
00029
00030 #define NEWSUCCESSORHINT_L(msg) (BASEOVERLAY_L(msg) + CHORDCOMMAND_L + \
00031 2*NODEHANDLE_L)
00032 #define NOTIFYCALL_L(msg) (BASECALL_L(msg))
00033 #define NOTIFYRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCNUM_L + NODEHANDLE_L +\
00034 (msg->getSucNodeArraySize() * NODEHANDLE_L) +\
00035 PRENODESET_L)
00036 #define JOINCALL_L(msg) BASECALL_L(msg)
00037 #define JOINRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCNUM_L + NODEHANDLE_L +\
00038 (msg->getSucNodeArraySize() * NODEHANDLE_L))
00039 #define STABILIZECALL_L(msg) BASECALL_L(msg)
00040 #define STABILIZERESPONSE_L(msg) (BASERESPONSE_L(msg) + NODEHANDLE_L)
00041 #define FIXFINGERSCALL_L(msg) (BASECALL_L(msg) + FINGER_L)
00042 #define FIXFINGERSRESPONSE_L(msg) (BASERESPONSE_L(msg) + FINGER_L + \
00043 NODEHANDLE_L + SUCNUM_L + \
00044 (msg->getSucNodeArraySize() * NODEHANDLE_L))
00045 #define DEBRUIJNCALL_L(msg) (BASECALL_L(msg) + KEY_L)
00046 #define DEBRUIJNRESPONSE_L(msg) (BASERESPONSE_L(msg) + SUCNUM_L + NODEHANDLE_L + \
00047 (msg->getSucNodeArraySize() * NODEHANDLE_L))
00048
00049 #define KOORDEFINDNODEEXTMESSAGE_L (KEY_L + STEP_L)
00050
00051
00052
00053
00054
00065 enum ChordCommand {
00066 NEWSUCCESSORHINT = 0
00067 };
00068
00078 class ChordMessage : public BaseOverlayMessage
00079 {
00080 protected:
00081 int command_var;
00082
00083
00084 bool operator==(const ChordMessage&);
00085
00086 public:
00087 ChordMessage(const char *name=NULL, int kind=0);
00088 ChordMessage(const ChordMessage& other);
00089 virtual ~ChordMessage();
00090 ChordMessage& operator=(const ChordMessage& other);
00091 virtual ChordMessage *dup() const {return new ChordMessage(*this);}
00092 virtual void parsimPack(cCommBuffer *b);
00093 virtual void parsimUnpack(cCommBuffer *b);
00094
00095
00096 virtual int getCommand() const;
00097 virtual void setCommand(int command_var);
00098 };
00099
00100 inline void doPacking(cCommBuffer *b, ChordMessage& obj) {obj.parsimPack(b);}
00101 inline void doUnpacking(cCommBuffer *b, ChordMessage& obj) {obj.parsimUnpack(b);}
00102
00113 class NewSuccessorHintMessage : public ChordMessage
00114 {
00115 protected:
00116 NodeHandle srcNode_var;
00117 NodeHandle preNode_var;
00118
00119
00120 bool operator==(const NewSuccessorHintMessage&);
00121
00122 public:
00123 NewSuccessorHintMessage(const char *name=NULL, int kind=0);
00124 NewSuccessorHintMessage(const NewSuccessorHintMessage& other);
00125 virtual ~NewSuccessorHintMessage();
00126 NewSuccessorHintMessage& operator=(const NewSuccessorHintMessage& other);
00127 virtual NewSuccessorHintMessage *dup() const {return new NewSuccessorHintMessage(*this);}
00128 virtual void parsimPack(cCommBuffer *b);
00129 virtual void parsimUnpack(cCommBuffer *b);
00130
00131
00132 virtual NodeHandle& getSrcNode();
00133 virtual const NodeHandle& getSrcNode() const {return const_cast<NewSuccessorHintMessage*>(this)->getSrcNode();}
00134 virtual void setSrcNode(const NodeHandle& srcNode_var);
00135 virtual NodeHandle& getPreNode();
00136 virtual const NodeHandle& getPreNode() const {return const_cast<NewSuccessorHintMessage*>(this)->getPreNode();}
00137 virtual void setPreNode(const NodeHandle& preNode_var);
00138 };
00139
00140 inline void doPacking(cCommBuffer *b, NewSuccessorHintMessage& obj) {obj.parsimPack(b);}
00141 inline void doUnpacking(cCommBuffer *b, NewSuccessorHintMessage& obj) {obj.parsimUnpack(b);}
00142
00152 class NotifyCall : public BaseCallMessage
00153 {
00154 protected:
00155 TransportAddress failed_var;
00156
00157
00158 bool operator==(const NotifyCall&);
00159
00160 public:
00161 NotifyCall(const char *name=NULL, int kind=0);
00162 NotifyCall(const NotifyCall& other);
00163 virtual ~NotifyCall();
00164 NotifyCall& operator=(const NotifyCall& other);
00165 virtual NotifyCall *dup() const {return new NotifyCall(*this);}
00166 virtual void parsimPack(cCommBuffer *b);
00167 virtual void parsimUnpack(cCommBuffer *b);
00168
00169
00170 virtual TransportAddress& getFailed();
00171 virtual const TransportAddress& getFailed() const {return const_cast<NotifyCall*>(this)->getFailed();}
00172 virtual void setFailed(const TransportAddress& failed_var);
00173 };
00174
00175 inline void doPacking(cCommBuffer *b, NotifyCall& obj) {obj.parsimPack(b);}
00176 inline void doUnpacking(cCommBuffer *b, NotifyCall& obj) {obj.parsimUnpack(b);}
00177
00190 class NotifyResponse : public BaseResponseMessage
00191 {
00192 protected:
00193 int sucNum_var;
00194 NodeHandle *sucNode_var;
00195 unsigned int sucNode_arraysize;
00196 NodeHandle preNode_var;
00197 bool preNodeSet_var;
00198
00199
00200 bool operator==(const NotifyResponse&);
00201
00202 public:
00203 NotifyResponse(const char *name=NULL, int kind=0);
00204 NotifyResponse(const NotifyResponse& other);
00205 virtual ~NotifyResponse();
00206 NotifyResponse& operator=(const NotifyResponse& other);
00207 virtual NotifyResponse *dup() const {return new NotifyResponse(*this);}
00208 virtual void parsimPack(cCommBuffer *b);
00209 virtual void parsimUnpack(cCommBuffer *b);
00210
00211
00212 virtual int getSucNum() const;
00213 virtual void setSucNum(int sucNum_var);
00214 virtual void setSucNodeArraySize(unsigned int size);
00215 virtual unsigned int getSucNodeArraySize() const;
00216 virtual NodeHandle& getSucNode(unsigned int k);
00217 virtual const NodeHandle& getSucNode(unsigned int k) const {return const_cast<NotifyResponse*>(this)->getSucNode(k);}
00218 virtual void setSucNode(unsigned int k, const NodeHandle& sucNode_var);
00219 virtual NodeHandle& getPreNode();
00220 virtual const NodeHandle& getPreNode() const {return const_cast<NotifyResponse*>(this)->getPreNode();}
00221 virtual void setPreNode(const NodeHandle& preNode_var);
00222 virtual bool getPreNodeSet() const;
00223 virtual void setPreNodeSet(bool preNodeSet_var);
00224 };
00225
00226 inline void doPacking(cCommBuffer *b, NotifyResponse& obj) {obj.parsimPack(b);}
00227 inline void doUnpacking(cCommBuffer *b, NotifyResponse& obj) {obj.parsimUnpack(b);}
00228
00237 class JoinCall : public BaseCallMessage
00238 {
00239 protected:
00240
00241
00242 bool operator==(const JoinCall&);
00243
00244 public:
00245 JoinCall(const char *name=NULL, int kind=0);
00246 JoinCall(const JoinCall& other);
00247 virtual ~JoinCall();
00248 JoinCall& operator=(const JoinCall& other);
00249 virtual JoinCall *dup() const {return new JoinCall(*this);}
00250 virtual void parsimPack(cCommBuffer *b);
00251 virtual void parsimUnpack(cCommBuffer *b);
00252
00253
00254 };
00255
00256 inline void doPacking(cCommBuffer *b, JoinCall& obj) {obj.parsimPack(b);}
00257 inline void doUnpacking(cCommBuffer *b, JoinCall& obj) {obj.parsimUnpack(b);}
00258
00270 class JoinResponse : public BaseResponseMessage
00271 {
00272 protected:
00273 int sucNum_var;
00274 NodeHandle *sucNode_var;
00275 unsigned int sucNode_arraysize;
00276 NodeHandle preNode_var;
00277
00278
00279 bool operator==(const JoinResponse&);
00280
00281 public:
00282 JoinResponse(const char *name=NULL, int kind=0);
00283 JoinResponse(const JoinResponse& other);
00284 virtual ~JoinResponse();
00285 JoinResponse& operator=(const JoinResponse& other);
00286 virtual JoinResponse *dup() const {return new JoinResponse(*this);}
00287 virtual void parsimPack(cCommBuffer *b);
00288 virtual void parsimUnpack(cCommBuffer *b);
00289
00290
00291 virtual int getSucNum() const;
00292 virtual void setSucNum(int sucNum_var);
00293 virtual void setSucNodeArraySize(unsigned int size);
00294 virtual unsigned int getSucNodeArraySize() const;
00295 virtual NodeHandle& getSucNode(unsigned int k);
00296 virtual const NodeHandle& getSucNode(unsigned int k) const {return const_cast<JoinResponse*>(this)->getSucNode(k);}
00297 virtual void setSucNode(unsigned int k, const NodeHandle& sucNode_var);
00298 virtual NodeHandle& getPreNode();
00299 virtual const NodeHandle& getPreNode() const {return const_cast<JoinResponse*>(this)->getPreNode();}
00300 virtual void setPreNode(const NodeHandle& preNode_var);
00301 };
00302
00303 inline void doPacking(cCommBuffer *b, JoinResponse& obj) {obj.parsimPack(b);}
00304 inline void doUnpacking(cCommBuffer *b, JoinResponse& obj) {obj.parsimUnpack(b);}
00305
00314 class StabilizeCall : public BaseCallMessage
00315 {
00316 protected:
00317
00318
00319 bool operator==(const StabilizeCall&);
00320
00321 public:
00322 StabilizeCall(const char *name=NULL, int kind=0);
00323 StabilizeCall(const StabilizeCall& other);
00324 virtual ~StabilizeCall();
00325 StabilizeCall& operator=(const StabilizeCall& other);
00326 virtual StabilizeCall *dup() const {return new StabilizeCall(*this);}
00327 virtual void parsimPack(cCommBuffer *b);
00328 virtual void parsimUnpack(cCommBuffer *b);
00329
00330
00331 };
00332
00333 inline void doPacking(cCommBuffer *b, StabilizeCall& obj) {obj.parsimPack(b);}
00334 inline void doUnpacking(cCommBuffer *b, StabilizeCall& obj) {obj.parsimUnpack(b);}
00335
00345 class StabilizeResponse : public BaseResponseMessage
00346 {
00347 protected:
00348 NodeHandle preNode_var;
00349
00350
00351 bool operator==(const StabilizeResponse&);
00352
00353 public:
00354 StabilizeResponse(const char *name=NULL, int kind=0);
00355 StabilizeResponse(const StabilizeResponse& other);
00356 virtual ~StabilizeResponse();
00357 StabilizeResponse& operator=(const StabilizeResponse& other);
00358 virtual StabilizeResponse *dup() const {return new StabilizeResponse(*this);}
00359 virtual void parsimPack(cCommBuffer *b);
00360 virtual void parsimUnpack(cCommBuffer *b);
00361
00362
00363 virtual NodeHandle& getPreNode();
00364 virtual const NodeHandle& getPreNode() const {return const_cast<StabilizeResponse*>(this)->getPreNode();}
00365 virtual void setPreNode(const NodeHandle& preNode_var);
00366 };
00367
00368 inline void doPacking(cCommBuffer *b, StabilizeResponse& obj) {obj.parsimPack(b);}
00369 inline void doUnpacking(cCommBuffer *b, StabilizeResponse& obj) {obj.parsimUnpack(b);}
00370
00380 class FixfingersCall : public BaseCallMessage
00381 {
00382 protected:
00383 int finger_var;
00384
00385
00386 bool operator==(const FixfingersCall&);
00387
00388 public:
00389 FixfingersCall(const char *name=NULL, int kind=0);
00390 FixfingersCall(const FixfingersCall& other);
00391 virtual ~FixfingersCall();
00392 FixfingersCall& operator=(const FixfingersCall& other);
00393 virtual FixfingersCall *dup() const {return new FixfingersCall(*this);}
00394 virtual void parsimPack(cCommBuffer *b);
00395 virtual void parsimUnpack(cCommBuffer *b);
00396
00397
00398 virtual int getFinger() const;
00399 virtual void setFinger(int finger_var);
00400 };
00401
00402 inline void doPacking(cCommBuffer *b, FixfingersCall& obj) {obj.parsimPack(b);}
00403 inline void doUnpacking(cCommBuffer *b, FixfingersCall& obj) {obj.parsimUnpack(b);}
00404
00415 class FixfingersResponse : public BaseResponseMessage
00416 {
00417 protected:
00418 int finger_var;
00419 NodeHandle *sucNode_var;
00420 unsigned int sucNode_arraysize;
00421
00422
00423 bool operator==(const FixfingersResponse&);
00424
00425 public:
00426 FixfingersResponse(const char *name=NULL, int kind=0);
00427 FixfingersResponse(const FixfingersResponse& other);
00428 virtual ~FixfingersResponse();
00429 FixfingersResponse& operator=(const FixfingersResponse& other);
00430 virtual FixfingersResponse *dup() const {return new FixfingersResponse(*this);}
00431 virtual void parsimPack(cCommBuffer *b);
00432 virtual void parsimUnpack(cCommBuffer *b);
00433
00434
00435 virtual int getFinger() const;
00436 virtual void setFinger(int finger_var);
00437 virtual void setSucNodeArraySize(unsigned int size);
00438 virtual unsigned int getSucNodeArraySize() const;
00439 virtual NodeHandle& getSucNode(unsigned int k);
00440 virtual const NodeHandle& getSucNode(unsigned int k) const {return const_cast<FixfingersResponse*>(this)->getSucNode(k);}
00441 virtual void setSucNode(unsigned int k, const NodeHandle& sucNode_var);
00442 };
00443
00444 inline void doPacking(cCommBuffer *b, FixfingersResponse& obj) {obj.parsimPack(b);}
00445 inline void doUnpacking(cCommBuffer *b, FixfingersResponse& obj) {obj.parsimUnpack(b);}
00446
00457 class KoordeFindNodeExtMessage : public cPacket
00458 {
00459 protected:
00460 OverlayKey routeKey_var;
00461 int step_var;
00462
00463
00464 bool operator==(const KoordeFindNodeExtMessage&);
00465
00466 public:
00467 KoordeFindNodeExtMessage(const char *name=NULL, int kind=0);
00468 KoordeFindNodeExtMessage(const KoordeFindNodeExtMessage& other);
00469 virtual ~KoordeFindNodeExtMessage();
00470 KoordeFindNodeExtMessage& operator=(const KoordeFindNodeExtMessage& other);
00471 virtual KoordeFindNodeExtMessage *dup() const {return new KoordeFindNodeExtMessage(*this);}
00472 virtual void parsimPack(cCommBuffer *b);
00473 virtual void parsimUnpack(cCommBuffer *b);
00474
00475
00476 virtual OverlayKey& getRouteKey();
00477 virtual const OverlayKey& getRouteKey() const {return const_cast<KoordeFindNodeExtMessage*>(this)->getRouteKey();}
00478 virtual void setRouteKey(const OverlayKey& routeKey_var);
00479 virtual int getStep() const;
00480 virtual void setStep(int step_var);
00481 };
00482
00483 inline void doPacking(cCommBuffer *b, KoordeFindNodeExtMessage& obj) {obj.parsimPack(b);}
00484 inline void doUnpacking(cCommBuffer *b, KoordeFindNodeExtMessage& obj) {obj.parsimUnpack(b);}
00485
00495 class DeBruijnCall : public BaseCallMessage
00496 {
00497 protected:
00498 OverlayKey destKey_var;
00499
00500
00501 bool operator==(const DeBruijnCall&);
00502
00503 public:
00504 DeBruijnCall(const char *name=NULL, int kind=0);
00505 DeBruijnCall(const DeBruijnCall& other);
00506 virtual ~DeBruijnCall();
00507 DeBruijnCall& operator=(const DeBruijnCall& other);
00508 virtual DeBruijnCall *dup() const {return new DeBruijnCall(*this);}
00509 virtual void parsimPack(cCommBuffer *b);
00510 virtual void parsimUnpack(cCommBuffer *b);
00511
00512
00513 virtual OverlayKey& getDestKey();
00514 virtual const OverlayKey& getDestKey() const {return const_cast<DeBruijnCall*>(this)->getDestKey();}
00515 virtual void setDestKey(const OverlayKey& destKey_var);
00516 };
00517
00518 inline void doPacking(cCommBuffer *b, DeBruijnCall& obj) {obj.parsimPack(b);}
00519 inline void doUnpacking(cCommBuffer *b, DeBruijnCall& obj) {obj.parsimUnpack(b);}
00520
00532 class DeBruijnResponse : public BaseResponseMessage
00533 {
00534 protected:
00535 NodeHandle dBNode_var;
00536 int sucNum_var;
00537 NodeHandle *sucNode_var;
00538 unsigned int sucNode_arraysize;
00539
00540
00541 bool operator==(const DeBruijnResponse&);
00542
00543 public:
00544 DeBruijnResponse(const char *name=NULL, int kind=0);
00545 DeBruijnResponse(const DeBruijnResponse& other);
00546 virtual ~DeBruijnResponse();
00547 DeBruijnResponse& operator=(const DeBruijnResponse& other);
00548 virtual DeBruijnResponse *dup() const {return new DeBruijnResponse(*this);}
00549 virtual void parsimPack(cCommBuffer *b);
00550 virtual void parsimUnpack(cCommBuffer *b);
00551
00552
00553 virtual NodeHandle& getDBNode();
00554 virtual const NodeHandle& getDBNode() const {return const_cast<DeBruijnResponse*>(this)->getDBNode();}
00555 virtual void setDBNode(const NodeHandle& dBNode_var);
00556 virtual int getSucNum() const;
00557 virtual void setSucNum(int sucNum_var);
00558 virtual void setSucNodeArraySize(unsigned int size);
00559 virtual unsigned int getSucNodeArraySize() const;
00560 virtual NodeHandle& getSucNode(unsigned int k);
00561 virtual const NodeHandle& getSucNode(unsigned int k) const {return const_cast<DeBruijnResponse*>(this)->getSucNode(k);}
00562 virtual void setSucNode(unsigned int k, const NodeHandle& sucNode_var);
00563 };
00564
00565 inline void doPacking(cCommBuffer *b, DeBruijnResponse& obj) {obj.parsimPack(b);}
00566 inline void doUnpacking(cCommBuffer *b, DeBruijnResponse& obj) {obj.parsimUnpack(b);}
00567
00568
00569 #endif // _CHORDMESSAGE_M_H_