/* * Copyright (c) 2004, Stony Brook University * Contributors: Ashish Raniwala * All rights reserved. * * See copyright notice included in the distribution for details * */ // raniwala: added for manual routing in wireless scenario // #ifndef manual_h_ #define manual_h_ #include "config.h" #include "agent.h" #include "ip.h" #include "delay.h" #include "scheduler.h" #include "queue.h" #include "trace.h" #include "arp.h" #include "ll.h" #include "mac.h" #include "priqueue.h" #include "fixedrtable.h" #include "tagtable.h" // Uncomment the following line to perform packet-by-packet load-balancing at each router //#define SPLIT_FLOWS 1 #if defined(WIN32) && !defined(snprintf) #define snprintf _snprintf #endif /* WIN32 && !snprintf */ typedef double Time; #define MAX_QUEUE_LENGTH 5 #define ROUTER_PORT 0xff class Manual_Agent : public Agent { public: Manual_Agent(); virtual int command(int argc, const char * const * argv); void lost_link(Packet *p); protected: Packet* rtable(int); virtual void recv(Packet *, Handler *); void trace(char* fmt, ...); void tracepkt(Packet *, double, int, const char *); void forwardPacket (Packet * p); void startUp(); int diff_subnet(int dst); void sendOutBCastPkt(Packet *p); // update old_rte in routing table to to new_rte Trace *tracetarget; // Trace Target FixedRoutingTable *table_; // Routing Table TagTable *tagtable_; // Routing Table PriQueue *ll_queue; // link level output queue int myaddr_; // My address... // Extensions for mixed type simulations using wired and wireless // nodes char *subnet_; // My subnet MobileNode *node_; // My node // for debugging char *address; NsObject *port_dmux_; // my port dmux // raniwala: down-links (ll-1, ll-2) NsObject *downtarget1_; // my port dmux NsObject *downtarget2_; // my port dmux NsObject *downtarget3_; // my port dmux NsObject *downtarget4_; // my port dmux NsObject *downtarget5_; // my port dmux // Randomness/MAC/logging parameters int use_mac_; int verbose_; void output_rte(const char *prefix, fixed_rtable_ent *prte, Manual_Agent *a); }; #endif