#ifndef __noah_h_
#define __noah_h_
#include "config.h"
#include "agent.h"
#include "ip.h"
#include "delay.h"
#include "trace.h"
#include "arp.h"
#include "ll.h"
#include "mac.h"
#include <priqueue.h>
#define ROUTER_PORT 0xff
#define MAX_IF 11
struct NOAH_Table {
int dst;
int hop;
};
class NOAH_Agent;
class ChangeIFSTimer : public Handler {
public:
ChangeIFSTimer(NOAH_Agent *a);
void start();
void handle(Event*);
int frist;
private:
NOAH_Agent *agent;
Event intr;
};
class NOAH_Agent : public Agent {
friend class ChangeIFSTimer;
public:
NOAH_Agent();
virtual int command(int argc, const char * const * argv);
void lost_link(Packet *p);
inline int getInt() {return ifs_;}
int nIfaces;
int ifs_;
FILE* fp;
protected:
Packet* rtable(int);
virtual void recv(Packet *, Handler *);
void trace(char* fmt, ...);
void forwardPacket (Packet * p);
void sendOutBCastPkt(Packet *p);
int diff_subnet(int dst);
int getEntry(int dst);
Trace *tracetarget; // Trace Target
int myaddr_; // My address...
char *subnet_; // My subnet
MobileNode *node_; // My node
NsObject *port_dmux_; // my port dmux
// for static routes
struct NOAH_Table *table_; // Routing Table
// MCMI: Store the LL modules for all the interfaces a node has
NsObject *targetlist[MAX_IF];
// MCMI: Keep the corresponding queues of all the interfaces
PriQueue *ifqueuelist[MAX_IF];
ChangeIFSTimer ctimer;
// Randomness/MAC/logging parameters
int be_random_;
int use_mac_;
int table_size;
};
#endif