00001
00002
00003 #ifndef flood_agent_h_
00004 #define flood_agent_h_
00005
00006 #include <agent.h>
00007 #include <ip.h>
00008 #include <delay.h>
00009 #include <scheduler.h>
00010 #include <queue.h>
00011 #include <trace.h>
00012 #include <arp.h>
00013 #include <ll.h>
00014 #include <mac.h>
00015 #include <priqueue.h>
00016 #include <mobilenode.h>
00017 #include "tags.h"
00018 #include "landmark.h"
00019
00020 typedef double Time;
00021
00022
00023 class QueryList {
00024 public:
00025 QueryList() {
00026 next_ = NULL;
00027 }
00028 nsaddr_t src_;
00029 int obj_name_;
00030 int origin_time_;
00031 int num_hops_;
00032 nsaddr_t last_hop_id_;
00033 QueryList *next_;
00034 };
00035
00036
00037
00038
00039 class FloodAgent : public Agent {
00040 public:
00041 FloodAgent();
00042 virtual int command(int argc, const char * const * argv);
00043
00044 protected:
00045
00046
00047 void startUp();
00048 int seqno_;
00049 int myaddr_;
00050
00051
00052
00053 void periodic_callback(Event *e, int level);
00054
00055 PriQueue *ll_queue;
00056
00057 void recv(Packet *p, Handler *);
00058
00059
00060 void trace(char* fmt,...);
00061 Trace *tracetarget_;
00062
00063
00064 tags_database *tag_dbase_;
00065
00066 compr_taglist *tag_list_;
00067
00068
00069
00070 QueryList *query_list_;
00071 int search_queries_list(nsaddr_t src, int obj_name, int origin_time, int num_hops, nsaddr_t last_hop_id);
00072
00073 nsaddr_t get_next_hop(nsaddr_t src, int obj_name, int origin_time);
00074
00075
00076 MobileNode *node_;
00077
00078
00079 int debug_;
00080
00081
00082 int cache_;
00083 TagCache *tag_cache_;
00084 int num_cached_items_;
00085 };
00086
00087
00088
00089 #endif