#include <requesttable.h>
Collaboration diagram for RequestTable:

Public Member Functions | |
| RequestTable (int size=30) | |
| ~RequestTable () | |
| void | insert (const ID &net_id, int req_num) |
| void | insert (const ID &net_id, const ID &MAC_id, int req_num) |
| int | get (const ID &id) const |
| Entry * | getEntry (const ID &id) |
Private Member Functions | |
| int | find (const ID &net_id, const ID &MAC_id) const |
Private Attributes | |
| Entry * | table |
| int | size |
| int | ptr |
|
|
Definition at line 38 of file requesttable.cc. References ptr, size, and table.
|
|
|
Definition at line 45 of file requesttable.cc. References table.
00046 {
00047 delete[] table;
00048 }
|
|
||||||||||||
|
Definition at line 51 of file requesttable.cc. References Entry::MAC_id, Entry::net_id, size, and table. Referenced by get(), getEntry(), and insert().
|
|
|
Definition at line 60 of file requesttable.cc. References find(), Entry::req_num, size, and table. Referenced by DSRAgent::ignoreRouteRequestp().
|
Here is the call graph for this function:

|
|
Definition at line 73 of file requesttable.cc. References find(), ptr, rt_rq_period, size, and table. Referenced by DSRAgent::acceptRouteReply(), and DSRAgent::getRouteForPacket().
00074 {
00075 int existing_entry = find(id, id);
00076
00077 if (existing_entry >= size)
00078 {
00079 table[ptr].MAC_id = ::invalid_addr;
00080 table[ptr].net_id = id;
00081 table[ptr].req_num = 0;
00082 table[ptr].last_arp = 0.0;
00083 table[ptr].rt_reqs_outstanding = 0;
00084 table[ptr].last_rt_req = -(rt_rq_period + 1.0);
00085 existing_entry = ptr;
00086 ptr = (ptr+1)%size;
00087 }
00088 return &(table[existing_entry]);
00089 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 99 of file requesttable.cc. References find(), Entry::MAC_id, ptr, Entry::req_num, rt_rq_period, size, and table.
00100 {
00101 int existing_entry = find(net_id, MAC_id);
00102
00103 if (existing_entry < size)
00104 {
00105 if (table[existing_entry].MAC_id == ::invalid_addr)
00106 table[existing_entry].MAC_id = MAC_id; // handle creations by getEntry
00107 table[existing_entry].req_num = req_num;
00108 return;
00109 }
00110
00111 // otherwise add it in
00112 table[ptr].MAC_id = MAC_id;
00113 table[ptr].net_id = net_id;
00114 table[ptr].req_num = req_num;
00115 table[ptr].last_arp = 0.0;
00116 table[ptr].rt_reqs_outstanding = 0;
00117 table[ptr].last_rt_req = -(rt_rq_period + 1.0);
00118 ptr = (ptr+1)%size;
00119 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 92 of file requesttable.cc. References invalid_addr. Referenced by DSRAgent::handlePacketReceipt(), and DSRAgent::handleRouteRequest().
00093 {
00094 insert(net_id,::invalid_addr,req_num);
00095 }
|
|
|
Definition at line 58 of file requesttable.h. Referenced by getEntry(), insert(), and RequestTable(). |
|
|
Definition at line 57 of file requesttable.h. Referenced by find(), get(), getEntry(), insert(), and RequestTable(). |
|
|
Definition at line 56 of file requesttable.h. Referenced by find(), get(), getEntry(), insert(), RequestTable(), and ~RequestTable(). |
1.3.3