Hi Ashish,
I made a patch for Click 1.5, it also works for 1.6 on my machine. I
attached it on this email.
Regards,
Marco.
Ashish Sharma schrieb:
P.S. : Sorry for the repost, the subject matter is more relvant in this
mail.
Hi Bart,
I tried compiling the AODV code at http://www.pats.ua.ac.be/software/
aodv<http://www.pats.ua.ac.be/software/aodv>by putting it in
elements/local/aodv directory and received some errors
like :
../elements/local/aodv/aodv_destinationclassifier.cc: In constructor
'AODVDestinationClassifier::AODVDestinationClassifier()':
../elements/local/aodv/aodv_destinationclassifier.cc:17: warning:
'__base_ctor ' is deprecated (declared at ../include/click/element.hh:201)
../elements/local/aodv/aodv_destinationclassifier.cc:20: error:
'MOD_INC_USE_COUNT' was not declared in this scope
../elements/local/aodv/aodv_destinationclassifier.cc: In destructor
'virtual AODVDestinationClassifier::~AODVDestinationClassifier()':
../elements/local/aodv/aodv_destinationclassifier.cc:26: error:
'MOD_DEC_USE_COUNT' was not declared in this scope
../elements/local/aodv/aodv_generatererr.cc: In constructor
'AODVGenerateRERR::AODVGenerateRERR()':
../elements/local/aodv/aodv_generatererr.cc:20: warning: '__base_ctor ' is
deprecated (declared at ../include/click/element.hh:201)
../elements/local/aodv/aodv_generatererr.cc: In member function 'void
AODVGenerateRERR::generateRERR(bool, Vector<IPAddress>, Vector<unsigned
int>)':
../elements/local/aodv/aodv_generatererr.cc:105: warning: 'id' is
deprecated (declared at ../include/click/element.hh:203)
../elements/local/aodv/aodv_generatererr.cc:105: error: 'class String' has
no member named 'cc'
.....
I looked at the changelog and saw Eddie's comments from way back in 2005
that MOD_DEC_USE_COUNT was deprecated and later removed because of changes
in 2.6
Is there a newer version available with you. If not, I would gladly try to
fix it, if you can direct me in the right direction. I am newbie in the
Click world :)
Ashish
On 10/11/07, Bart Braem <[EMAIL PROTECTED]> wrote:
On Wednesday 10 October 2007 19:31:33 Eddie Kohler wrote:
Is there a link to that on the wiki?
Not yet, you are right. Where should I add it? It's a bit like a
package, but
it's larger and it contains ns scripts...
--
Marco Wenzel
ICQ 135863371
www.der-wenz.de
'disce quasi semper victurus, vive quasi cras moriturus' (otep shamaya)
diff -Naur old/aodv_destinationclassifier.cc new/aodv_destinationclassifier.cc
--- old/aodv_destinationclassifier.cc 2005-03-02 16:03:12.000000000 +0100
+++ new/aodv_destinationclassifier.cc 2007-10-09 16:06:56.000000000 +0200
@@ -13,17 +13,19 @@
#include "aodv_destinationclassifier.hh"
CLICK_DECLS
-AODVDestinationClassifier::AODVDestinationClassifier():
- Element(1,3)
+AODVDestinationClassifier::AODVDestinationClassifier()
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVDestinationClassifier::~AODVDestinationClassifier()
{
// DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -32,7 +34,7 @@
Element* neighbour_table_element;
int res = cp_va_parse(conf, this, errh, cpElement, "AODVNeighbour
table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
diff -Naur old/aodv_destinationclassifier.hh new/aodv_destinationclassifier.hh
--- old/aodv_destinationclassifier.hh 2005-03-02 16:03:12.000000000 +0100
+++ new/aodv_destinationclassifier.hh 2007-10-09 16:06:56.000000000 +0200
@@ -22,6 +22,7 @@
~AODVDestinationClassifier();
const char *class_name() const { return
"AODVDestinationClassifier"; }
+ const char *port_count() const {return "1/3"; }
const char *processing() const { return PUSH; }
AODVDestinationClassifier *clone() const { return new
AODVDestinationClassifier; }
diff -Naur old/aodv_generatererr.cc new/aodv_generatererr.cc
--- old/aodv_generatererr.cc 2005-02-17 10:18:15.000000000 +0100
+++ new/aodv_generatererr.cc 2007-10-09 16:06:56.000000000 +0200
@@ -16,17 +16,18 @@
#include "click_aodv.hh"
CLICK_DECLS
-AODVGenerateRERR::AODVGenerateRERR():
- Element(2,1)
+AODVGenerateRERR::AODVGenerateRERR()
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVGenerateRERR::~AODVGenerateRERR()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -35,7 +36,7 @@
Element* neighbour_table_element;
int res = cp_va_parse(conf, this, errh, cpElement, "AODVNeighbour
table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -102,7 +103,7 @@
int packet_size = sizeof(aodv_rerr_header) + nrOfDestinations * 2 *
sizeof(uint32_t);
WritablePacket *packet = Packet::make(aodv_headeroffset,0,packet_size,
0); // reserve no tailroom
if ( packet == 0 ){
- click_chatter( "in %s: cannot make packet!", id().cc());
+ click_chatter( "in %s: cannot make packet!", name().c_str());
return;
}
memset(packet->data(), 0, packet->length());
diff -Naur old/aodv_generatererr.hh new/aodv_generatererr.hh
--- old/aodv_generatererr.hh 2004-12-01 11:37:55.000000000 +0100
+++ new/aodv_generatererr.hh 2007-10-09 16:06:56.000000000 +0200
@@ -22,6 +22,7 @@
~AODVGenerateRERR();
const char *class_name() const { return "AODVGenerateRERR"; }
+ const char *port_count() const {return "2/1"; }
const char *processing() const { return PUSH; }
AODVGenerateRERR *clone() const { return new AODVGenerateRERR; }
diff -Naur old/aodv_generaterrep.cc new/aodv_generaterrep.cc
--- old/aodv_generaterrep.cc 2005-04-02 11:59:30.000000000 +0200
+++ new/aodv_generaterrep.cc 2007-10-09 16:06:56.000000000 +0200
@@ -17,17 +17,18 @@
CLICK_DECLS
AODVGenerateRREP::AODVGenerateRREP():
- Element(1,1),
neighbour_table(0)
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVGenerateRREP::~AODVGenerateRREP()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -40,7 +41,7 @@
cpElement, "AODVSetRREPHeaders", &setrrepheaders_element,
0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -48,7 +49,7 @@
errh->error("Supplied element is not a valid AODVNeighbours
element (cast failed)");
return -1;
}
- if (setrrepheaders_element->class_name() != "AODVSetRREPHeaders"){
+ if (strcmp(setrrepheaders_element->class_name(), "AODVSetRREPHeaders")
!= 0){
errh->error("Supplied element is not an AODVSetRREPHeaders
element but a %s",setrrepheaders_element->class_name());
return -1;
}
@@ -75,7 +76,7 @@
WritablePacket *packet = Packet::make(aodv_headeroffset,0,packet_size,
tailroom);
if ( packet == 0 ){
- click_chatter( "in %s: cannot make packet!", id().cc());
+ click_chatter( "in %s: cannot make packet!", name().c_str());
return;
}
memset(packet->data(), 0, packet->length());
diff -Naur old/aodv_generaterrep.hh new/aodv_generaterrep.hh
--- old/aodv_generaterrep.hh 2005-02-14 18:06:52.000000000 +0100
+++ new/aodv_generaterrep.hh 2007-10-09 16:06:56.000000000 +0200
@@ -22,6 +22,7 @@
~AODVGenerateRREP();
const char *class_name() const { return "AODVGenerateRREP"; }
+ const char *port_count() const { return "1/1"; }
const char *processing() const { return AGNOSTIC; }
AODVGenerateRREP *clone() const { return new AODVGenerateRREP; }
diff -Naur old/aodv_generaterreq.cc new/aodv_generaterreq.cc
--- old/aodv_generaterreq.cc 2005-03-08 09:50:02.000000000 +0100
+++ new/aodv_generaterreq.cc 2007-10-09 16:06:56.000000000 +0200
@@ -18,18 +18,19 @@
CLICK_DECLS
AODVGenerateRREQ::AODVGenerateRREQ():
- Element(0,1),
neighbour_table(0),
rreqid(0)
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVGenerateRREQ::~AODVGenerateRREQ()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -41,7 +42,7 @@
cpElement, "AODVNeighbour table", &neighbour_table_element,
cpElement, "AODVKnownClassifier", &known_classifier_element,0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -49,7 +50,7 @@
errh->error("Supplied element is not a valid AODVNeighbours
element (cast failed)");
return -1;
}
- if (known_classifier_element->class_name() != "AODVKnownClassifier"){
+ if (strcmp(known_classifier_element->class_name(),
"AODVKnownClassifier") != 0){
errh->error("Supplied element is not an AODVKnownClassifier
element but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -71,7 +72,7 @@
WritablePacket *packet = Packet::make(aodv_headeroffset,0,packet_size,
tailroom);
if ( packet == 0 ){
- click_chatter( "in %s: cannot make packet!", id().cc());
+ click_chatter( "in %s: cannot make packet!", name().c_str());
return;
}
memset(packet->data(), 0, packet->length());
diff -Naur old/aodv_generaterreq.hh new/aodv_generaterreq.hh
--- old/aodv_generaterreq.hh 2005-03-08 09:50:02.000000000 +0100
+++ new/aodv_generaterreq.hh 2007-10-09 16:06:56.000000000 +0200
@@ -22,6 +22,7 @@
~AODVGenerateRREQ();
const char *class_name() const { return "AODVGenerateRREQ"; }
+ const char *port_count() const { return "0/1"; }
const char *processing() const { return PUSH; }
AODVGenerateRREQ *clone() const { return new AODVGenerateRREQ; }
diff -Naur old/aodv_hellogenerator.cc new/aodv_hellogenerator.cc
--- old/aodv_hellogenerator.cc 2005-03-16 08:48:49.000000000 +0100
+++ new/aodv_hellogenerator.cc 2007-10-09 16:06:56.000000000 +0200
@@ -11,6 +11,7 @@
#include <clicknet/ip.h>
#include <clicknet/ether.h>
#include <clicknet/udp.h>
+#include <stdio.h>
#include "aodv_hellogenerator.hh"
#include "aodv_broadcastheader.hh"
@@ -18,24 +19,25 @@
CLICK_DECLS
AODVHelloGenerator::AODVHelloGenerator():
- Element(1,2),
timer(this)
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVHelloGenerator::~AODVHelloGenerator()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
AODVHelloGenerator::initialize(ErrorHandler *)
{
timer.initialize(this);
- timer.schedule_after_ms(AODV_HELLO_INTERVAL);
+ timer.schedule_after_msec(AODV_HELLO_INTERVAL);
return 0;
}
@@ -45,7 +47,7 @@
Element * neighbour_table_element;
int res = cp_va_parse(conf, this, errh, cpElement, "AODVNeighbour
table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0) {
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -59,14 +61,14 @@
return 0;
}
-void AODVHelloGenerator::run_timer(){
+void AODVHelloGenerator::run_timer(Timer *){
// no tailroom needed, fixed size
int tailroom = 0;
int packet_size = sizeof(aodv_rrep_header);
WritablePacket *packet = Packet::make(aodv_headeroffset,0,packet_size,
tailroom);
if ( packet == 0 ){
- click_chatter( "in %s: cannot make packet!", id().cc());
+ click_chatter( "in %s: cannot make packet!", name().c_str());
return;
}
memset(packet->data(), 0, packet->length());
@@ -81,14 +83,14 @@
header->lifetime = htonl(AODV_ALLOWED_HELLO_LOSS * AODV_HELLO_INTERVAL);
output(0).push(AODVBroadcastHeader::setBroadcastHeader(packet,*myIP,1));
- timer.schedule_after_ms(AODV_HELLO_INTERVAL);
+ timer.schedule_after_msec(AODV_HELLO_INTERVAL);
}
// RFC 6.9: "Every ... ms, the node checks whether is has sent a broadcast
(...) within the last ..."
// RREQs are pushed trough here, so every time a packet arrives reset timer
void AODVHelloGenerator::push (int port, Packet * packet){
assert(port == 0);
- timer.schedule_after_ms(AODV_HELLO_INTERVAL);
+ timer.schedule_after_msec(AODV_HELLO_INTERVAL);
output(1).push(packet);
}
diff -Naur old/aodv_hellogenerator.hh new/aodv_hellogenerator.hh
--- old/aodv_hellogenerator.hh 2005-02-14 18:06:52.000000000 +0100
+++ new/aodv_hellogenerator.hh 2007-10-09 16:06:56.000000000 +0200
@@ -22,6 +22,7 @@
~AODVHelloGenerator();
const char *class_name() const { return "AODVHelloGenerator"; }
+ const char *port_count() const { return "1/2"; }
const char *processing() const { return PUSH; }
AODVHelloGenerator *clone() const { return new
AODVHelloGenerator; }
@@ -30,7 +31,7 @@
virtual void push (int, Packet *);
- void run_timer();
+ void run_timer(Timer *);
private:
Timer timer;
diff -Naur old/aodv_knownclassifier.cc new/aodv_knownclassifier.cc
--- old/aodv_knownclassifier.cc 2005-03-16 08:48:50.000000000 +0100
+++ new/aodv_knownclassifier.cc 2007-10-09 16:06:56.000000000 +0200
@@ -14,17 +14,18 @@
#include "aodv_knownclassifier.hh"
CLICK_DECLS
-AODVKnownClassifier::AODVKnownClassifier():
- Element(1,2)
+AODVKnownClassifier::AODVKnownClassifier()
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVKnownClassifier::~AODVKnownClassifier()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -34,7 +35,7 @@
int res = cp_va_parse(conf, this, errh,
cpElement, "AODVNeighbour table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -64,7 +65,7 @@
// check RREQ buffer according to RFC 6.3
if (RREQBuffer.find_pair(key)){
packet->kill();
- // click_chatter("discarded");
+ //click_chatter("discarded");
return;
}
addKnownRREQ(key); // buffer for next time
@@ -131,7 +132,7 @@
Timer * timer = new Timer(&AODVKnownClassifier::handleExpiry,timerdata);
timer->initialize(this);
- timer->schedule_after_ms(AODV_PATH_DISCOVERY_TIME);
+ timer->schedule_after_msec(AODV_PATH_DISCOVERY_TIME);
RREQBuffer.insert(key,timer);
}
diff -Naur old/aodv_knownclassifier.hh new/aodv_knownclassifier.hh
--- old/aodv_knownclassifier.hh 2005-02-14 18:06:52.000000000 +0100
+++ new/aodv_knownclassifier.hh 2007-10-09 16:06:56.000000000 +0200
@@ -26,6 +26,7 @@
~AODVKnownClassifier();
const char *class_name() const { return "AODVKnownClassifier";
}
+ const char *port_count() const { return "1/2"; }
const char *processing() const { return PUSH; }
AODVKnownClassifier *clone() const { return new
AODVKnownClassifier; }
diff -Naur old/aodv_linkneighboursdiscovery.cc
new/aodv_linkneighboursdiscovery.cc
--- old/aodv_linkneighboursdiscovery.cc 2005-03-16 08:48:50.000000000 +0100
+++ new/aodv_linkneighboursdiscovery.cc 2007-10-09 16:06:56.000000000 +0200
@@ -12,18 +12,19 @@
CLICK_DECLS
AODVLinkNeighboursDiscovery::AODVLinkNeighboursDiscovery():
- Element(0,0),
neighbours(0),
discovery(0)
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVLinkNeighboursDiscovery::~AODVLinkNeighboursDiscovery()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -34,7 +35,7 @@
int res = cp_va_parse(conf, this, errh, cpElement, "AODVNeighbour
table", &neighbour_element,
cpElement, "AODVWaitingForDiscovery", &discovery_element, 0);
if(res < 0) return res;
- if (neighbour_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_element->class_name(), "AODVNeighbours") != 0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_element->class_name());
return -1;
}
@@ -42,7 +43,7 @@
errh->error("Supplied element is not a valid AODVNeighbours
element (cast failed)");
return -1;
}
- if (discovery_element->class_name() != "AODVWaitingForDiscovery"){
+ if (strcmp(discovery_element->class_name(), "AODVWaitingForDiscovery")
!= 0){
errh->error("Supplied element is not an AODVWaitingForDiscovery
element but a %s",discovery_element->class_name());
return -1;
}
diff -Naur old/aodv_linkneighboursdiscovery.hh
new/aodv_linkneighboursdiscovery.hh
--- old/aodv_linkneighboursdiscovery.hh 2004-12-02 10:55:00.000000000 +0100
+++ new/aodv_linkneighboursdiscovery.hh 2007-10-09 16:06:56.000000000 +0200
@@ -22,6 +22,7 @@
~AODVLinkNeighboursDiscovery();
const char *class_name() const { return
"AODVLinkNeighboursDiscovery"; }
+ const char *port_count() const { return "0/0"; }
const char *processing() const { return AGNOSTIC; }
AODVLinkNeighboursDiscovery *clone() const { return new
AODVLinkNeighboursDiscovery; }
diff -Naur old/aodv_lookuproute.cc new/aodv_lookuproute.cc
--- old/aodv_lookuproute.cc 2005-03-31 14:17:23.000000000 +0200
+++ new/aodv_lookuproute.cc 2007-10-09 16:06:56.000000000 +0200
@@ -15,17 +15,18 @@
CLICK_DECLS
AODVLookUpRoute::AODVLookUpRoute():
- Element(1,3),
neighbour_table(0)
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVLookUpRoute::~AODVLookUpRoute()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -34,7 +35,8 @@
Element* neighbour_table_element;
int res = cp_va_parse(conf, this, errh, cpElement, "AODVNeighbour
table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ //schauen, ob parameter=AODVNeighbours
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") != 0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -49,11 +51,15 @@
}
void AODVLookUpRoute::push (int port, Packet * packet){
+ //click_chatter("port: %s", packet);
assert(port == 0);
assert(packet);
assert(PAINT_ANNO(packet) == 1 || PAINT_ANNO(packet) == 3);
IPAddress destination = packet->dst_ip_anno();
+ //click_chatter("Destination %s",destination.s().c_str());
+ //click_chatter("unknown destination %s in %s:
RERR",destination.s().c_str(),myIP->s().c_str());
IPAddress* nexthop = neighbour_table->nexthop(destination);
+ //click_chatter("destination: %s source:
%s",destination.s().c_str(),myIP->s().c_str());
if (nexthop){ /* destination known so fill in and push for network */
assert(*nexthop != *myIP);
packet->set_dst_ip_anno(*nexthop);
@@ -63,14 +69,17 @@
assert(packet->ip_header()->ip_src != destination);
neighbour_table->updateRouteLifetime(ipheader->ip_src,destination);
- delete nexthop;
+ //click_chatter("destination %s with anno %d known, push to
network",destination.s().c_str(), PAINT_ANNO(packet));
+ delete nexthop;
+
output(0).push(packet);
} else { /* destination unknown so push for route discovery if packet
comes from localhost*/
if (PAINT_ANNO(packet) == 1){
- //click_chatter("unknown destination %s in %s:
RERR",destination.s().c_str(),myIP->s().c_str());
+ //click_chatter("destination %s unknown, generate
RERR",destination.s().c_str());
output(2).push(packet);
} else { // local data to be forwarded (anno 3) -> route
discovery
+ //click_chatter("destination %s with anno %d unknown,
local data found, discover route",destination.s().c_str(), PAINT_ANNO(packet));
output(1).push(packet);
}
}
diff -Naur old/aodv_lookuproute.hh new/aodv_lookuproute.hh
--- old/aodv_lookuproute.hh 2005-02-14 18:06:52.000000000 +0100
+++ new/aodv_lookuproute.hh 2007-10-09 16:06:56.000000000 +0200
@@ -21,6 +21,7 @@
~AODVLookUpRoute();
const char *class_name() const { return "AODVLookUpRoute"; }
+ const char *port_count() const { return "1/3"; }
const char *processing() const { return PUSH; }
AODVLookUpRoute *clone() const { return new AODVLookUpRoute; }
diff -Naur old/aodv_neighbours.cc new/aodv_neighbours.cc
--- old/aodv_neighbours.cc 2005-04-02 11:59:51.000000000 +0200
+++ new/aodv_neighbours.cc 2007-10-09 16:06:56.000000000 +0200
@@ -14,17 +14,18 @@
CLICK_DECLS
AODVNeighbours::AODVNeighbours():
- Element(0,0),
mySequenceNumber(0)
{
- // CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVNeighbours::~AODVNeighbours()
{
- // DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -46,11 +47,12 @@
void AODVNeighbours::expire(const IPAddress & ip, TimerData * timerdata){
// pass timerdata too to clean up memory after timer expires completely
+
NeighbourMap::Pair* pair = neighbours.find_pair(ip);
assert(pair);
if(pair->value.valid){
pair->value.valid = false;
- pair->value.expiry->schedule_after_ms(AODV_DELETE_PERIOD);
+ pair->value.expiry->schedule_after_msec(AODV_DELETE_PERIOD);
} else {
delete(pair->value.expiry);
neighbours.remove(ip);
@@ -73,12 +75,13 @@
pair->value.valid = true;
pair->value.hopcount = hopcount;
pair->value.nexthop = nexthop;
- pair->value.expiry->schedule_after_ms(calculateLifetime(lifetime));
+ pair->value.expiry->schedule_after_msec(calculateLifetime(lifetime));
assert(watcher);
watcher->newKnownDestination(pair->key,nexthop);
}
void AODVNeighbours::insertRoutetableEntry(bool
validDestinationSequenceNumber, uint32_t destinationSequenceNumber, uint32_t
hopcount, const IPAddress & nexthop, int lifetime, const IPAddress & ip){
+
assert(lifetime >= -1);
assert(nexthop != myIP);
struct routing_table_entry data;
@@ -93,12 +96,12 @@
timerdata->neighbours = this;
data.expiry = new Timer(&AODVNeighbours::handleExpiry,timerdata);
data.expiry->initialize(this);
- data.expiry->schedule_after_ms(calculateLifetime(lifetime));
+ data.expiry->schedule_after_msec(calculateLifetime(lifetime));
data.nexthop = nexthop;
assert(!neighbours.find_pair(ip));
neighbours.insert(ip,data);
assert(watcher);
- watcher->newKnownDestination(ip,nexthop);
+ watcher->newKnownDestination(ip,nexthop);
}
// use overloading to smoothly process entries without known sequencenumber
and lifetime
@@ -108,7 +111,7 @@
if (NeighbourMap::Pair* pair = neighbours.find_pair(ip)){
editRoutetableEntry(pair,false,0,hopcount,nexthop,-1);
} else {
- insertRoutetableEntry(false,0,hopcount,nexthop,-1,ip);
+ insertRoutetableEntry(false,0,hopcount,nexthop,-1,ip);
}
}
@@ -122,9 +125,14 @@
if (NeighbourMap::Pair* pair = neighbours.find_pair(ip)){
if (!pair->value.valid ||
largerSequenceNumber(pair->value.destinationSequenceNumber,sequenceNumber) ||
(pair->value.destinationSequenceNumber == sequenceNumber && hopcount <
pair->value.hopcount)) {
editRoutetableEntry(pair,true,sequenceNumber,hopcount,nexthop,lifetime);
+ //click_chatter("edit %d %d",sequenceNumber,lifetime);
+ Timestamp now = Timestamp::now();
+ //click_chatter("%d EDIT SeqNr:%d, Hopcnt:%d,
NextHop:%s,
Lifetime:%d",now.sec(),sequenceNumber,hopcount,nexthop.s().c_str(),lifetime);
}
} else {
insertRoutetableEntry(true,sequenceNumber,hopcount,nexthop,lifetime,ip);
+ Timestamp now = Timestamp::now();
+ //click_chatter("%d INSERT SeqNr:%d, HopCnt:%d, NexHop:%s,
IPAdr:%s,
Lifetime:%d",now.sec(),sequenceNumber,hopcount,nexthop.s().c_str(),ip.s().c_str(),lifetime);
}
}
@@ -143,14 +151,16 @@
assert(ms > 0);
NeighbourMap::Pair* pair = neighbours.find_pair(destination);
if (!pair) return; // route didn't exist / already expunged
- const struct timeval & newer = calculateTimeval(ms);
- const struct timeval & old = pair->value.expiry->expiry();
+ const Timestamp & newer = calculateTimeval(ms);
+ const Timestamp & old = pair->value.expiry->expiry();
if (old < newer) pair->value.expiry->schedule_at(newer);
+ //click_chatter("addLifeTime");
}
void AODVNeighbours::updateLifetime(NeighbourMap::Pair* pair){
- const struct timeval & newer = calculateTimeval(calculateLifetime(-1));
// use existing code
- const struct timeval & old = pair->value.expiry->expiry();
+ //click_chatter("updateLifeTime");
+ const Timestamp & newer = calculateTimeval(calculateLifetime(-1)); //
use existing code
+ const Timestamp & old = pair->value.expiry->expiry();
pair->value.valid = true;
if (old < newer) pair->value.expiry->schedule_at(newer);
}
@@ -168,13 +178,17 @@
// it is possible that we don't have information about the previous hop
(highly likely)
// it is also possible that we don't have information about the next
hop (eg. node sends data before transmitting HELLO or RREQ so we don't have its
sequence number, filling in a new entry is not feasible)
-
+ //click_chatter("updateRouteLifeTime");
assert(to != myIP);
if (from != myIP){
// update lifetime when using local paths but don't update
previous hop then
+ //click_chatter("from %s, to %s", from.s().c_str(),
to.s().c_str());
NeighbourMap::Pair* frompair = neighbours.find_pair(from);
- assert(frompair); // we must have received a rreq to have
packets pass this way so we have a route table entry for it
- updateLifetime(frompair); // "of the source"
+ //assert(frompair); // we must have received a rreq to have
packets pass this way so we have a route table entry for it
+ //updateLifetime(frompair); // "of the source"
+ if (frompair) {
+ updateLifetime(frompair);
+ }
NeighbourMap::Pair* frompairNexthop =
neighbours.find_pair(from);
if(frompairNexthop) updateLifetime(frompairNexthop); // the
Active Route Lifetime for the previous hop
@@ -229,10 +243,9 @@
uint32_t AODVNeighbours::getLifetime(const IPAddress & ip) const{
NeighbourMap::Pair* pair = neighbours.find_pair(ip);
assert(pair);
- struct timeval expiry = pair->value.expiry->expiry();
- struct timeval now;
- click_gettimeofday(&now);
- uint32_t result = (expiry.tv_sec - now.tv_sec) * 1000 + (expiry.tv_usec
- now.tv_usec) / 1000;
+ Timestamp expiry = pair->value.expiry->expiry();
+ Timestamp now = Timestamp::now();
+ uint32_t result = (expiry.sec() - now.sec()) * 1000 + (expiry.usec() -
now.usec()) / 1000;
return (result == 0)?1:result; // avoid returning 0 to avoid confusion:
this entry is still valid!
}
@@ -245,7 +258,7 @@
// 2.
pair->value.valid = false;
// 3.
- pair->value.expiry->schedule_after_ms(AODV_DELETE_PERIOD);
+ pair->value.expiry->schedule_after_msec(AODV_DELETE_PERIOD);
}
Vector<IPAddress>* AODVNeighbours::getPrecursors(const IPAddress & ip) const{
diff -Naur old/aodv_neighbours.hh new/aodv_neighbours.hh
--- old/aodv_neighbours.hh 2005-03-09 12:04:58.000000000 +0100
+++ new/aodv_neighbours.hh 2007-10-09 16:06:56.000000000 +0200
@@ -38,9 +38,9 @@
~AODVNeighbours();
const char *class_name() const { return "AODVNeighbours"; }
+ const char *port_count() const { return "0/0"; }
const char *processing() const { return AGNOSTIC; }
- AODVNeighbours *clone() const { return new AODVNeighbours; }
-
+
int configure(Vector<String> &, ErrorHandler *);
void updateRoutetableEntry(const IPAddress &,uint32_t,
uint32_t, const IPAddress &, uint32_t);
diff -Naur old/aodv_setrrepheaders.cc new/aodv_setrrepheaders.cc
--- old/aodv_setrrepheaders.cc 2005-02-14 18:06:52.000000000 +0100
+++ new/aodv_setrrepheaders.cc 2007-10-09 16:06:56.000000000 +0200
@@ -13,18 +13,21 @@
#include "aodv_setrrepheaders.hh"
CLICK_DECLS
-AODVSetRREPHeaders::AODVSetRREPHeaders():
- Element(1,1)
+AODVSetRREPHeaders::AODVSetRREPHeaders()
{
// CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
destinations = new DestinationMap();
}
AODVSetRREPHeaders::~AODVSetRREPHeaders()
{
// DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
void AODVSetRREPHeaders::push (int port, Packet * p){
@@ -65,4 +68,3 @@
CLICK_ENDDECLS
EXPORT_ELEMENT(AODVSetRREPHeaders)
-
diff -Naur old/aodv_setrrepheaders.hh new/aodv_setrrepheaders.hh
--- old/aodv_setrrepheaders.hh 2005-02-14 18:06:52.000000000 +0100
+++ new/aodv_setrrepheaders.hh 2007-10-09 16:06:56.000000000 +0200
@@ -23,6 +23,7 @@
~AODVSetRREPHeaders();
const char *class_name() const { return "AODVSetRREPHeaders"; }
+ const char *port_count() const { return "1/1"; }
const char *processing() const { return PUSH; }
AODVSetRREPHeaders *clone() const { return new
AODVSetRREPHeaders; }
diff -Naur old/aodv_trackneighbours.cc new/aodv_trackneighbours.cc
--- old/aodv_trackneighbours.cc 2005-04-18 09:21:18.000000000 +0200
+++ new/aodv_trackneighbours.cc 2007-10-09 16:06:56.000000000 +0200
@@ -14,17 +14,20 @@
#include "aodv_trackneighbours.hh"
CLICK_DECLS
-AODVTrackNeighbours::AODVTrackNeighbours():
- Element(1,1)
+AODVTrackNeighbours::AODVTrackNeighbours()
{
// CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVTrackNeighbours::~AODVTrackNeighbours()
{
// DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -36,7 +39,7 @@
cpElement, "AODVGenerateRERR", &generateRerrElement,
cpElement, "AODVNeighbours", &neighbour_table_element, 0);
if(res < 0) return res;
- if (generateRerrElement->class_name() != "AODVGenerateRERR"){
+ if (strcmp(generateRerrElement->class_name(), "AODVGenerateRERR") != 0){
errh->error("Supplied element is not an AODVGenerateRERR
element but a %s",generateRerrElement->class_name());
return -1;
}
@@ -44,7 +47,7 @@
errh->error("Supplied element is not a valid AODVGenerateRERR
element (cast failed)");
return -1;
}
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -118,12 +121,12 @@
timerdata->me = this;
Timer * timer = new
Timer(&AODVTrackNeighbours::handleExpiry,timerdata);
timer->initialize(this);
-
timer->schedule_after_ms(AODV_ALLOWED_HELLO_LOSS * AODV_HELLO_INTERVAL);
+
timer->schedule_after_msec(AODV_ALLOWED_HELLO_LOSS * AODV_HELLO_INTERVAL);
neighbour_timers.insert(rrep->originator,timer);
}
}
TimerMap::Pair* pair =
neighbour_timers.find_pair(ipheader->ip_src);
- if (pair)
pair->value->schedule_after_ms(AODV_ALLOWED_HELLO_LOSS * AODV_HELLO_INTERVAL);
+ if (pair)
pair->value->schedule_after_msec(AODV_ALLOWED_HELLO_LOSS * AODV_HELLO_INTERVAL);
}
output(0).push(packet);
}
diff -Naur old/aodv_trackneighbours.hh new/aodv_trackneighbours.hh
--- old/aodv_trackneighbours.hh 2005-04-18 09:21:18.000000000 +0200
+++ new/aodv_trackneighbours.hh 2007-10-09 16:06:56.000000000 +0200
@@ -25,6 +25,7 @@
~AODVTrackNeighbours();
const char *class_name() const { return "AODVTrackNeighbours";
}
+ const char *port_count() const { return "1/1"; }
const char *processing() const { return PUSH; }
AODVTrackNeighbours *clone() const { return new
AODVTrackNeighbours; }
diff -Naur old/aodv_updateneighbours.cc new/aodv_updateneighbours.cc
--- old/aodv_updateneighbours.cc 2005-04-02 12:00:09.000000000 +0200
+++ new/aodv_updateneighbours.cc 2007-10-09 16:06:56.000000000 +0200
@@ -16,17 +16,20 @@
CLICK_DECLS
AODVUpdateNeighbours::AODVUpdateNeighbours():
- Element(1,1),
neighbour_table(0)
{
// CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVUpdateNeighbours::~AODVUpdateNeighbours()
{
// DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -35,7 +38,7 @@
Element* neighbour_table_element;
int res = cp_va_parse(conf, this, errh, cpElement, "AODVNeighbour
table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -71,7 +74,7 @@
neighbour_table->updateRoutetableEntry(IPAddress(rrep->destination),ntohl(rrep->destinationseqnr),rrep->hopcount,
IPAddress(ipheader->ip_src),AODV_ALLOWED_HELLO_LOSS * AODV_HELLO_INTERVAL);
} else { // RREP
// the information is only useful if I am not
the destination (I might hear this packets due to routing changes)
- if (rrep->destination !=
neighbour_table->getMyIP()){
+ if (rrep->destination != neighbour_table->getMyIP()){
neighbour_table->updateRoutetableEntry(IPAddress(rrep->destination),
ntohl(rrep->destinationseqnr), rrep->hopcount, IPAddress(ipheader->ip_src),
ntohl(rrep->lifetime));
}
}
@@ -79,6 +82,7 @@
break;
}
case AODV_RREQ_MESSAGE: //RREQ
+ {
//aodv_rreq_header * header = (aodv_rreq_header*)
(packet->data() + aodv_headeroffset);
//click_chatter("AODV rreq packet received from %s with
rreqid %u", IPAddress(header->originator).s().c_str(), ntohl(header->rreqid));
@@ -87,13 +91,14 @@
output(0).push(packet);
break;
+ }
case AODV_RREP_ACK_MESSAGE:
//click_chatter("AODV rrep-ack packet received");
//no processing possible
output(0).push(packet);
break;
- default:
- assert(false); // not a rrep, hello or rreq: problems
+// default:
+// assert(false); // not a rrep, hello or rreq: problems
}
}
diff -Naur old/aodv_updateneighbours.hh new/aodv_updateneighbours.hh
--- old/aodv_updateneighbours.hh 2004-12-02 10:11:48.000000000 +0100
+++ new/aodv_updateneighbours.hh 2007-10-09 16:06:56.000000000 +0200
@@ -21,6 +21,7 @@
~AODVUpdateNeighbours();
const char *class_name() const { return
"AODVUpdateNeighbours"; }
+ const char *port_count() const { return "1/1"; }
const char *processing() const { return PUSH; }
AODVUpdateNeighbours *clone() const { return new
AODVUpdateNeighbours; }
diff -Naur old/aodv_waitingfordiscovery.cc new/aodv_waitingfordiscovery.cc
--- old/aodv_waitingfordiscovery.cc 2005-05-06 14:29:31.000000000 +0200
+++ new/aodv_waitingfordiscovery.cc 2007-10-09 16:06:56.000000000 +0200
@@ -16,17 +16,20 @@
CLICK_DECLS
-AODVWaitingForDiscovery::AODVWaitingForDiscovery():
- Element(2,2)
+AODVWaitingForDiscovery::AODVWaitingForDiscovery()
{
// CONSTRUCTOR MUST MOD_INC_USE_COUNT
+ #ifdef MOD_INC_USE_COUNT
MOD_INC_USE_COUNT;
+ #endif
}
AODVWaitingForDiscovery::~AODVWaitingForDiscovery()
{
// DESTRUCTOR MUST MOD_DEC_USE_COUNT
+ #ifdef MOD_DEC_USE_COUNT
MOD_DEC_USE_COUNT;
+ #endif
}
int
@@ -37,7 +40,7 @@
int res = cp_va_parse(conf, this, errh, cpElement, "AODVGenerateRREQ",
&generate_rreq_element,
cpElement, "AODVNeighbour table", &neighbour_table_element, 0);
if(res < 0) return res;
- if (generate_rreq_element->class_name() != "AODVGenerateRREQ"){
+ if (strcmp(generate_rreq_element->class_name(), "AODVGenerateRREQ") !=
0){
errh->error("Supplied element is not an AODVGenerateRREQ
element but a %s",generate_rreq_element->class_name());
return -1;
}
@@ -45,7 +48,7 @@
errh->error("Supplied element is not a valid AODVGenerateRREQ
element (cast failed)");
return -1;
}
- if (neighbour_table_element->class_name() != "AODVNeighbours"){
+ if (strcmp(neighbour_table_element->class_name(), "AODVNeighbours") !=
0){
errh->error("Supplied element is not an AODVNeighbours element
but a %s",neighbour_table_element->class_name());
return -1;
}
@@ -68,7 +71,8 @@
// it's over, clean up everything
Vector<Packet*>::iterator iter = pair->value->packets.begin();
// at least one packet is still waiting, use it to generate
ICMP error
- output(1).push(*iter);
+ //click_chatter("nothing found, generating icmp error");
+ output(1).push(*iter);
iter = pair->value->packets.erase(iter);
// drop all other packets from buffer
@@ -88,14 +92,14 @@
if (pair->value->ttl < AODV_TTL_TRESHOLD) {
pair->value->ttl = pair->value->ttl +
AODV_TTL_INCREMENT;
rreq->generateRREQ(destination,false,pair->value->ttl);
-
pair->value->timer->schedule_after_ms(AODV_RING_TRAVERSAL_TIME_FACTOR *
(pair->value->ttl + AODV_TIMEOUT_BUFFER));
+
pair->value->timer->schedule_after_msec(AODV_RING_TRAVERSAL_TIME_FACTOR *
(pair->value->ttl + AODV_TIMEOUT_BUFFER));
} else {
pair->value->ttl = AODV_NET_DIAMETER;
pair->value->maxTTL = true;
++pair->value->nrOfRetries;
rreq->generateRREQ(destination,false,pair->value->ttl);
-
pair->value->timer->schedule_after_ms(AODV_RING_TRAVERSAL_TIME_FACTOR *
(pair->value->ttl + AODV_TIMEOUT_BUFFER));
+
pair->value->timer->schedule_after_msec(AODV_RING_TRAVERSAL_TIME_FACTOR *
(pair->value->ttl + AODV_TIMEOUT_BUFFER));
}
}
}
@@ -135,8 +139,9 @@
if(PAINT_ANNO(*iter) == 1 || PAINT_ANNO(*iter) == 3){
// forwarded packet
const click_ip * ipheader =
(*iter)->ip_header();
assert(ipheader);
-
neighbour_table->updateRouteLifetime(ipheader->ip_src,ipheader->ip_dst);
- output(0).push(*iter);
+
neighbour_table->updateRouteLifetime(ipheader->ip_src,ipheader->ip_dst);
+ //click_chatter("forwarding packet");
+ output(0).push(*iter);
} else if (PAINT_ANNO(*iter) == 2){ // RREP needs
changed destination
WritablePacket* writable = (*iter)->uniqueify();
writable->ip_header()->ip_dst =
nexthop.in_addr();
@@ -184,7 +189,7 @@
waiting->timer = new
Timer(&AODVWaitingForDiscovery::handleTask,data); // run handletask when timer
goes off
waiting->timer->initialize(this);
-
waiting->timer->schedule_after_ms(AODV_RING_TRAVERSAL_TIME_FACTOR *
(AODV_TTL_START + AODV_TIMEOUT_BUFFER));
+
waiting->timer->schedule_after_msec(AODV_RING_TRAVERSAL_TIME_FACTOR *
(AODV_TTL_START + AODV_TIMEOUT_BUFFER));
buffer.insert(packet->dst_ip_anno(),waiting);
@@ -201,7 +206,6 @@
assert(ipheader);
newKnownDestination(rrep->destination, ipheader->ip_src);
-
packet->kill();
}
}
diff -Naur old/aodv_waitingfordiscovery.hh new/aodv_waitingfordiscovery.hh
--- old/aodv_waitingfordiscovery.hh 2005-02-25 09:29:49.000000000 +0100
+++ new/aodv_waitingfordiscovery.hh 2007-10-09 16:06:56.000000000 +0200
@@ -34,6 +34,7 @@
~AODVWaitingForDiscovery();
const char *class_name() const { return
"AODVWaitingForDiscovery"; }
+ const char *port_count() const { return "2/2"; }
const char *processing() const { return PUSH; }
AODVWaitingForDiscovery *clone() const { return new
AODVWaitingForDiscovery; }
diff -Naur old/click_aodv.hh new/click_aodv.hh
--- old/click_aodv.hh 2005-03-08 09:37:40.000000000 +0100
+++ new/click_aodv.hh 2007-10-09 16:06:56.000000000 +0200
@@ -17,7 +17,7 @@
//Intervals in ms
#define AODV_HELLO_INTERVAL 1000
#define AODV_ALLOWED_HELLO_LOSS 2
-#define AODV_ACTIVE_ROUTE_TIMEOUT 1000
+#define AODV_ACTIVE_ROUTE_TIMEOUT 3000
#define AODV_NET_DIAMETER 35
#define AODV_NODE_TRAVERSAL_TIME 40
#define AODV_NET_TRAVERSAL_TIME 2 * AODV_NODE_TRAVERSAL_TIME *
AODV_NET_DIAMETER
_______________________________________________
click mailing list
[email protected]
https://amsterdam.lcs.mit.edu/mailman/listinfo/click