Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

Flood.h

00001 /* -*- mode:c++ -*- ********************************************************
00002  * file:        Flood.h
00003  *
00004  * author:      Daniel Willkomm
00005  *
00006  * copyright:   (C) 2004 Telecommunication Networks Group (TKN) at
00007  *              Technische Universitaet Berlin, Germany.
00008  *
00009  *              This program is free software; you can redistribute it 
00010  *              and/or modify it under the terms of the GNU General Public 
00011  *              License as published by the Free Software Foundation; either
00012  *              version 2 of the License, or (at your option) any later 
00013  *              version.
00014  *              For further information see file COPYING 
00015  *              in the top level directory
00016  ***************************************************************************
00017  * part of:     framework implementation developed by tkn
00018  * description: a simple flooding protocol
00019  *              the user can decide whether to use plain flooding or not
00020  **************************************************************************/
00021 
00022 
00023 #ifndef _FLOOD_H_
00024 #define _FLOOD_H_
00025 
00026 #include <SimpleNetwLayer.h>
00027 #include <list>
00028 
00029 
00047 class Flood : public SimpleNetwLayer
00048 {
00049 protected:
00051     unsigned long seqNum;
00052 
00054     int defaultTtl;
00055 
00057     bool plainFlooding;
00058 
00059     class Bcast {
00060     public:
00061         unsigned long seqNum;
00062         int srcAddr;
00063         simtime_t delTime;
00064     public:
00065         Bcast(unsigned long n=0, int s=0,  simtime_t d=0) :
00066             seqNum(n), srcAddr(s), delTime(d) {
00067         }
00068     };
00069 
00070     typedef std::list<Bcast> cBroadcastList;
00071 
00073     cBroadcastList bcMsgs;
00074 
00079     unsigned int bcMaxEntries;
00080 
00085     double bcDelTime;
00086 
00087 public:
00088     Module_Class_Members( Flood, SimpleNetwLayer, 0 );
00089 
00091     virtual void initialize(int);
00092     virtual void finish();    
00093 
00094 protected:
00096     virtual void handleUpperMsg(cMessage *);
00097 
00099     virtual void handleLowerMsg(cMessage *);
00100 
00102     virtual void handleSelfMsg(cMessage* msg) {};
00103     
00105     bool notBroadcasted( NetwPkt* );
00106 };
00107 
00108 #endif

Generated on Fri Jan 12 08:29:32 2007 for Mobility Framework by  doxygen 1.4.4