?? ns-2.29.3-aodv-uu-0.9.2.patch
字號:
diff -uprN ns-2.29.orig/common/packet.h ns-2.29/common/packet.h--- ns-2.29.orig/common/packet.h 2005-10-20 06:45:22.000000000 +0200+++ ns-2.29/common/packet.h 2006-07-15 15:47:42.000000000 +0200@@ -167,6 +167,11 @@ enum packet_t { // HDLC packet PT_HDLC, +#ifdef AODV_UU+ // AODV packets in AODV-UU+ PT_AODVUU,+#endif /* AODV_UU */+ // insert new packet types here PT_NTYPE // This MUST be the LAST one };@@ -262,7 +267,11 @@ public: // XCP name_[PT_XCP]="xcp";- +#ifdef AODV_UU+ // AODV packets in AODV-UU+ name_[PT_AODVUU] = "AODVUU";+#endif /* AODV_UU */+ name_[PT_NTYPE]= "undefined"; } const char* name(packet_t p) const { diff -uprN ns-2.29.orig/Makefile.in ns-2.29/Makefile.in--- ns-2.29.orig/Makefile.in 2005-10-20 06:45:22.000000000 +0200+++ ns-2.29/Makefile.in 2006-07-15 15:45:34.000000000 +0200@@ -52,13 +52,19 @@ PERL = @PERL@ # for diffusion #DIFF_INCLUDES = "./diffusion3/main ./diffusion3/lib ./diffusion3/nr ./diffusion3/ns" +# AODV-UU: Name of subdirectory with AODV-UU files,+# usually a symlink to the AODV-UU sources. If you change this,+# ~ns/trace/cmu-trace.cc must be updated as well.+AODV_UU_DIR = aodv-uu+AODV_UU_LIB = libaodv-uu.a+ CCOPT = @V_CCOPT@ STATIC = @V_STATIC@ #LDFLAGS = $(STATIC) LDFLAGS = @LDFLAGS@ LDOUT = -o $(BLANK) -DEFINE = -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@ @DEFS@ -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=@CPP_NAMESPACE@ -DUSE_SINGLE_ADDRESS_SPACE -Drng_test+DEFINE = -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@ @DEFS@ -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=@CPP_NAMESPACE@ -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DAODV_UU -DNS_PORT INCLUDES = \ -I. \@@ -70,12 +76,15 @@ INCLUDES = \ -I./diffusion3/lib/nr -I./diffusion3/ns \ -I./diffusion3/filter_core -I./asim/ -I./qs \ -I./diffserv -I./satellite \- -I./wpan+ -I./wpan \+ -I./$(AODV_UU_DIR) LIB = \ @V_LIBS@ \ @V_LIB@ \+ -L$(AODV_UU_DIR) \+ -laodv-uu \ -lm @LIBS@ # -L@libdir@ \ @@ -301,6 +310,7 @@ OBJ_CC = \ wpan/p802_15_4nam.o wpan/p802_15_4phy.o \ wpan/p802_15_4sscs.o wpan/p802_15_4timer.o \ wpan/p802_15_4trace.o wpan/p802_15_4transac.o \+ $(AODV_UU_DIR)/$(AODV_UU_LIB) \ @V_STLOBJ@ @@ -356,6 +366,9 @@ SUBDIRS=\ BUILD_NSE = @build_nse@ +# AODV-UU: Added phony targets for AODV-UU+.PHONY: aodv-uu-clean+ all: $(NS) $(BUILD_NSE) all-recursive @@ -366,6 +379,12 @@ $(NS): $(OBJ) common/tclAppInit.o Makefi $(LINK) $(LDFLAGS) $(LDOUT)$@ \ common/tclAppInit.o $(OBJ) $(LIB) +$(AODV_UU_DIR)/$(AODV_UU_LIB):+ cd $(AODV_UU_DIR) && $(MAKE) $(AODV_UU_LIB) NS_DEFS='$(DEFINE)' OPTS='$(CCOPT)' NS_INC='$(subst -I.,-I$(shell pwd),$(INCLUDES))'++aodv-uu-clean:+ cd $(AODV_UU_DIR) && $(MAKE) clean+ Makefile: Makefile.in @echo "Makefile.in is newer than Makefile." @echo "You need to re-run configure."@@ -492,7 +511,7 @@ install-man: force install-recursive: force for i in $(SUBDIRS); do ( cd $$i; $(MAKE) install; ) done -clean:+clean: aodv-uu-clean $(RM) $(CLEANFILES) AUTOCONF_GEN = tcl/lib/ns-autoconf.tcldiff -uprN ns-2.29.orig/queue/priqueue.cc ns-2.29/queue/priqueue.cc--- ns-2.29.orig/queue/priqueue.cc 2005-10-20 06:45:23.000000000 +0200+++ ns-2.29/queue/priqueue.cc 2006-07-15 15:48:22.000000000 +0200@@ -92,7 +92,11 @@ PriQueue::recv(Packet *p, Handler *h) case PT_AODV: recvHighPriority(p, h); break;-+#ifdef AODV_UU+ case PT_AODVUU:+ recvHighPriority(p, h);+ break;+#endif /* AODV_UU */ default: Queue::recv(p, h); }diff -uprN ns-2.29.orig/tcl/lib/ns-agent.tcl ns-2.29/tcl/lib/ns-agent.tcl--- ns-2.29.orig/tcl/lib/ns-agent.tcl 2005-10-20 06:45:23.000000000 +0200+++ ns-2.29/tcl/lib/ns-agent.tcl 2006-07-15 15:52:09.000000000 +0200@@ -192,3 +192,10 @@ Agent/AODV instproc init args { Agent/AODV set sport_ 0 Agent/AODV set dport_ 0 +# AODV-UU routing agent+Agent/AODVUU instproc init args {+ $self next $args+}++Agent/AODVUU set sport_ 0+Agent/AODVUU set dport_ 0diff -uprN ns-2.29.orig/tcl/lib/ns-default.tcl ns-2.29/tcl/lib/ns-default.tcl--- ns-2.29.orig/tcl/lib/ns-default.tcl 2005-10-20 06:45:23.000000000 +0200+++ ns-2.29/tcl/lib/ns-default.tcl 2006-07-15 15:50:51.000000000 +0200@@ -1369,3 +1369,19 @@ Queue set util_records_ 5 ; # Changed # Quick Start definitions end here Delayer set debug_ false++# AODV-UU routing agent+Agent/AODVUU set unidir_hack_ 0+Agent/AODVUU set rreq_gratuitous_ 0+Agent/AODVUU set expanding_ring_search_ 1+Agent/AODVUU set local_repair_ 0+Agent/AODVUU set receive_n_hellos_ 0+Agent/AODVUU set hello_jittering_ 0+Agent/AODVUU set wait_on_reboot_ 0+Agent/AODVUU set debug_ 0+Agent/AODVUU set rt_log_interval_ 0+Agent/AODVUU set log_to_file_ 0+Agent/AODVUU set optimized_hellos_ 0+Agent/AODVUU set ratelimit_ 1+Agent/AODVUU set llfeedback_ 1+Agent/AODVUU set internet_gw_mode_ 0diff -uprN ns-2.29.orig/tcl/lib/ns-lib.tcl ns-2.29/tcl/lib/ns-lib.tcl--- ns-2.29.orig/tcl/lib/ns-lib.tcl 2005-10-20 06:45:23.000000000 +0200+++ ns-2.29/tcl/lib/ns-lib.tcl 2006-07-15 15:55:06.000000000 +0200@@ -612,6 +612,10 @@ Simulator instproc create-wireless-node AODV { set ragent [$self create-aodv-agent $node] }+ # AODV-UU routing agent+ AODVUU {+ $self at 0.0 "$node start-aodv"+ } TORA { Simulator set IMEPFlag_ ON set ragent [$self create-tora-agent $node]@@ -668,7 +672,7 @@ Simulator instproc create-wireless-node $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ \ $inerrProc_ $outerrProc_ $FECProc_ # Attach agent- if {$routingAgent_ != "DSR"} {+ if {$routingAgent_ != "DSR" && $routingAgent_ != "AODVUU" } { $node attach $ragent [Node set rtagent_port_] } if {$routingAgent_ == "DIFFUSION/RATE" ||@@ -688,7 +692,7 @@ Simulator instproc create-wireless-node # Bind routing agent and mip agent if existing basestation # address setting if { [info exist wiredRouting_] && $wiredRouting_ == "ON" } {- if { $routingAgent_ != "DSR" } {+ if { $routingAgent_ != "DSR" && $routingAgent_ != "AODVUU" } { $node mip-call $ragent } }@@ -749,8 +753,12 @@ Simulator instproc create-node-instance # DSR is a special case if {$routingAgent_ == "DSR"} { set nodeclass [$self set-dsr-nodetype]- } else {- set nodeclass Node/MobileNode+ } else { + if { $routingAgent_ == "AODVUU"} {+ set nodeclass Node/MobileNode/AODVNode+ } else {+ set nodeclass Node/MobileNode+ } } return [eval new $nodeclass $args] }diff -uprN ns-2.29.orig/tcl/lib/ns-mobilenode.tcl ns-2.29/tcl/lib/ns-mobilenode.tcl--- ns-2.29.orig/tcl/lib/ns-mobilenode.tcl 2005-10-20 06:45:23.000000000 +0200+++ ns-2.29/tcl/lib/ns-mobilenode.tcl 2006-07-15 15:51:29.000000000 +0200@@ -882,3 +882,104 @@ SRNodeNew instproc reset args { eval $self next $args $dsr_agent_ reset }+##############################################################################+# A MobileNode Class for AODV which is modeled after the SRNode Class+# but with modifications.+##############################################################################+Class Node/MobileNode/AODVNode -superclass Node/MobileNode++Node/MobileNode/AODVNode instproc init args {+ $self instvar ragent_ dmux_ classifier_ entry_point_ address_++ set ns [Simulator instance]++ eval $self next $args ;# parent class constructor++ if {$dmux_ == "" } {+ # Use the default mash and shift+ set dmux_ [new Classifier/Port]+ }+ set ragent_ [new Agent/AODVUU [$self id ]]++ # setup address (supports hier-address) for AODV agent+ $self addr $address_+ $ragent_ addr $address_+ $ragent_ node $self++ # Add the node's own address to the port demuxer+ $self add-route $address_ $dmux_++ if { [Simulator set RouterTrace_] == "ON" } {+ # Recv Target+ set rcvT [$self mobility-trace Recv "RTR"]+ set namfp [$ns get-nam-traceall]+ if { $namfp != "" } {+ $rcvT namattach $namfp+ }+ $rcvT target $ragent_+ set entry_point_ $rcvT + } else {+ # Recv Target+ set entry_point_ $ragent_+ }++ $self set ragent_ $ragent_++ # The target of the routing agent is the address classifier+ $ragent_ target $classifier_++ set nullAgent_ [$ns set nullAgent_]+ + # The default target in the classifier is set to the+ # nullAgent, since the routing agent already handled whatever+ # needs to be handled+ $classifier_ defaulttarget $nullAgent_+ + # Packets to the routing agent and default port should be
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -