⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umts.patch

📁 对ns2软件进行UMTS扩展
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
+ * must display the following acknowledgement:+ * This product includes software developed at Strathclyde University of+ * Glasgow, Scotland.+ *+ * 3. The name of the University may not be used to endorse or promote+ * products derived from this software without specific prior written+ * permission.+ * STRATHCLYDE UNIVERSITY OF GLASGOW, MAKES NO REPRESENTATIONS+ * CONCERNING EITHER THE MERCHANTABILITY OF THIS SOFTWARE OR THE+ * SUITABILITY OF THIS SOFTWARE FOR ANY PARTICULAR PURPOSE.  The software+ * is provided "as is" without express or implied warranty of any kind.+*/++/*  * Copyright (C) 2000 by USC/ISI  * All rights reserved.                                              *                                                                @@ -56,6 +87,15 @@ 	} } class_hier_routing_module; +// P.M. & P.B. modifications+static class UmtsRoutingModuleClass : public TclClass {+public:+	UmtsRoutingModuleClass() : TclClass("RtModule/Umts") {}+	TclObject* create(int, const char*const*) {+		return (new UmtsRoutingModule);+	}+} class_umts_routing_module;+  static class ManualRoutingModuleClass : public TclClass { public:@@ -101,7 +141,7 @@         } } class_lms_routing_module; -RoutingModule::RoutingModule() : +RoutingModule::RoutingModule() : 	next_rtm_(NULL), n_(NULL), classifier_(NULL) { 	bind("classifier_", (TclObject**)&classifier_); }@@ -117,11 +157,11 @@ 		} else if (strcmp(argv[1], "module-name") == 0) { 			if (module_name() != NULL) 				tcl.resultf("%s", module_name());-			else +			else 				tcl.result(""); 			return TCL_OK; 		}-		+ 	} else if (argc == 3) { 		if (strcmp(argv[1], "attach-node") == 0) { 			n_ = (Node*)TclObject::lookup(argv[2]);@@ -176,6 +216,7 @@ 	return (RoutingModule::command(argc, argv)); } + int SourceRoutingModule::command(int argc, const char*const* argv) { 	Tcl& tcl = Tcl::instance(); 	if (argc == 3) {@@ -283,6 +324,40 @@ 	return (RoutingModule::command(argc, argv)); } +// P.M. & P.B. modifications+int UmtsRoutingModule::command(int argc, const char*const* argv) {+	Tcl& tcl = Tcl::instance();+	if (argc == 3) {+		if (strcmp(argv[1] , "route-notify") == 0) {+			Node *node = (Node *)(TclObject::lookup(argv[2]));+			if (node == NULL) {+				tcl.add_errorf("Invalid node object %s", argv[2]);+				return TCL_ERROR;+			}+			if (node != n_) {+				tcl.add_errorf("Node object %s different from n_", argv[2]);+				return TCL_ERROR;+			}+			n_->route_notify(this);+			return TCL_OK;+		}+		if (strcmp(argv[1] , "unreg-route-notify") == 0) {+			Node *node = (Node *)(TclObject::lookup(argv[2]));+			if (node == NULL) {+				tcl.add_errorf("Invalid node object %s", argv[2]);+				return TCL_ERROR;+			}+			if (node != n_) {+				tcl.add_errorf("Node object %s different from n_", argv[2]);+				return TCL_ERROR;+			}+			n_->unreg_route_notify(this);+			return TCL_OK;+		}+	}+	return (RoutingModule::command(argc, argv));+}+  int ManualRoutingModule::command(int argc, const char*const* argv) { 	Tcl& tcl = Tcl::instance();@@ -371,7 +446,7 @@ 			next_rtm_->unreg_route_notify(rtm); 		} 	}-}+}   void RoutingModule::add_route(char *dst, NsObject *target)  {@@ -384,9 +459,9 @@ void RoutingModule::delete_route(char *dst, NsObject *nullagent) { 	if (classifier_) -		classifier_->do_install(dst, nullagent); +		classifier_->do_install(dst, nullagent); 	if (next_rtm_)-		next_rtm_->add_route(dst, nullagent); +		next_rtm_->add_route(dst, nullagent); }  void RoutingModule::set_table_size(int nn)diff -ur routing/rtmodule.h ns-umts-extensions/code/rtmodule.h--- routing/rtmodule.h	2002-09-18 05:41:52.000000000 +0000+++ ns-umts-extensions/code/rtmodule.h	2003-06-01 20:10:45.000000000 +0000@@ -1,8 +1,39 @@-/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- +/* -*-	Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */++/* Modified and extended by Pablo Martin and Paula Ballester,+ * Strathclyde University, Glasgow.+ * June, 2003.+*/++/* Copyright (c) 2003 Strathclyde University of Glasgow, Scotland.+ * All rights reserved.+ *+ * Redistribution and use in source and binary forms, with or without+ * modification, are permitted provided that the following conditions+ * are met:+ *+ * 1. Redistributions of source code and binary code must contain+ * the above copyright notice, this list of conditions and the following+ * disclaimer.+ *+ * 2. All advertising materials mentioning features or use of this software+ * must display the following acknowledgement:+ * This product includes software developed at Strathclyde University of+ * Glasgow, Scotland.  *+ * 3. The name of the University may not be used to endorse or promote+ * products derived from this software without specific prior written+ * permission.+ * STRATHCLYDE UNIVERSITY OF GLASGOW, MAKES NO REPRESENTATIONS+ * CONCERNING EITHER THE MERCHANTABILITY OF THIS SOFTWARE OR THE+ * SUITABILITY OF THIS SOFTWARE FOR ANY PARTICULAR PURPOSE.  The software+ * is provided "as is" without express or implied warranty of any kind.+*/++/*  * Copyright (C) 2000 by USC/ISI- * All rights reserved.                                            - *                                                                + * All rights reserved.+ *  * Redistribution and use in source and binary forms are permitted  * provided that the above copyright notice and this paragraph are  * duplicated in all such forms and that any documentation, advertising@@ -11,15 +42,15 @@  * Southern California, Information Sciences Institute.  The name of the  * University may not be used to endorse or promote products derived from  * this software without specific prior written permission.- * + *  * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  *  * $Header: /nfs/jade/vint/CVSROOT/ns-2/routing/rtmodule.h,v 1.13 2002/09/18 05:41:52 sundarra Exp $  *- * Definition of RoutingModule, base class for all extensions to routing - * functionality in a Node. These modules are meant to be "plugin", and + * Definition of RoutingModule, base class for all extensions to routing+ * functionality in a Node. These modules are meant to be "plugin", and  * should be configured via node-config{} interface in tcl/lib/ns-lib.tcl.  */ @@ -32,7 +63,8 @@ #include "classifier-hash.h" #include "classifier-hier.h" -+// P.M. & P.B. modifications+#include "classifier-umts.h"  class NsObject; class Node;@@ -42,16 +74,16 @@  class RoutingModule : public TclObject { public:-	RoutingModule(); +	RoutingModule(); 	/* 	 * Returns the node to which this module is attached.-	 */ +	 */ 	inline Node* node() { return n_; } 	/* 	 * Node-related module-specific initialization can be done here. 	 * However: (1) RoutingModule::attach() must be called from derived-	 * class so the value of n_ is setup, (2) module-specific -	 * initialization that does not require knowledge of Node should +	 * class so the value of n_ is setup, (2) module-specific+	 * initialization that does not require knowledge of Node should 	 * always stay in the module constructor. 	 * 	 * Return TCL_ERROR if initialization fails.@@ -63,12 +95,12 @@ 	/* support for populating rtg table */ 	void route_notify(RoutingModule *rtm); 	void unreg_route_notify(RoutingModule *rtm);-	virtual void add_route(char *dst, NsObject *target); +	virtual void add_route(char *dst, NsObject *target); 	virtual void delete_route(char *dst, NsObject *nullagent); 	void set_table_size(int nn); 	void set_table_size(int level, int csize); 	RoutingModule *next_rtm_;-	+ protected: 	Node *n_; 	Classifier *classifier_;@@ -89,7 +121,7 @@ 	virtual const char* module_name() const { return "Mcast"; } 	virtual int command(int argc, const char*const* argv); protected:-	DestHashClassifier *classifier_;	+	DestHashClassifier *classifier_; };  class HierRoutingModule : public RoutingModule {@@ -101,6 +133,16 @@ 	HierClassifier *classifier_; }; +// P.M. & P.B. modifications+class UmtsRoutingModule : public RoutingModule {+public:+	UmtsRoutingModule() : RoutingModule() {}+	virtual const char* module_name() const { return "Umts"; }+	virtual int command(int argc, const char*const* argv);+protected:+	UmtsClassifier *classifier_;+};+ class ManualRoutingModule : public RoutingModule { public: 	ManualRoutingModule() : RoutingModule() {}diff -ur tcl/lib/ns-default.tcl ns-umts-extensions/code/ns-default.tcl--- tcl/lib/ns-default.tcl	2002-10-19 22:41:36.000000000 +0000+++ ns-umts-extensions/code/ns-default.tcl	2003-06-01 20:10:45.000000000 +0000@@ -1,7 +1,35 @@ # -*-	Mode:tcl; tcl-indent-level:8; tab-width:8; indent-tabs-mode:t -*- #-# Time-stamp: <2000-09-13 13:48:04 haoboy>+# * Modified and extended by Pablo Martin and Paula Ballester,+# * Strathclyde University, Glasgow.+# * June, 2003.+# *+#+# Copyright (c) 2003 Strathclyde University of Glasgow, Scotland.+# * All rights reserved.+# *+# * Redistribution and use in source and binary forms, with or without+# * modification, are permitted provided that the following conditions+# * are met:+# *+# * 1. Redistributions of source code and binary code must contain+# * the above copyright notice, this list of conditions and the following+# * disclaimer.+# *+# * 2. All advertising materials mentioning features or use of this software+# * must display the following acknowledgement:+# * This product includes software developed at Strathclyde University of+# * Glasgow, Scotland.+# *+# * 3. The name of the University may not be used to endorse or promote+# * products derived from this software without specific prior written+# * permission.+# * STRATHCLYDE UNIVERSITY OF GLASGOW, MAKES NO REPRESENTATIONS+# * CONCERNING EITHER THE MERCHANTABILITY OF THIS SOFTWARE OR THE+# * SUITABILITY OF THIS SOFTWARE FOR ANY PARTICULAR PURPOSE.  The software+# * is provided "as is" without express or implied warranty of any kind. #+ # Copyright (c) 1996-1997 Regents of the University of California. # All rights reserved. # @@ -98,6 +126,12 @@  Queue/DropTail/PriQueue set Prefer_Routing_Protocols    1 +# P.M. & P.B. modifications+Queue/DropTail/FCQueue set limit_ 1000+Queue/DropTail/FCQueue set verbose_ 0+Queue/DropTail/BsFCQueue set limit_ 5000+Queue/DropTail/BsFCQueue set verbose_ 0+ # special cmu implemented priority queue used by DSR CMUPriQueue set qlen_logthresh_ 10 CMUPriQueue set fw_logthresh_ 25@@ -206,7 +240,7 @@ # Default for queue_in_bytes_ changed to true on 4/28/2002. Queue/Vq set markpkts_ false  Queue/Vq set ecnlim_ 0.8-Queue/Vq set buflim_ 1.0 +Queue/Vq set buflim_ 1.0 # Queue/Vq set gamma_ 0.895 Queue/Vq set gamma_ 0.98 # Default for gamma_ changed to 0.98 on 4/28/2002.@@ -359,6 +393,11 @@ Classifier/Addr/MPLS set control_driven_ 0 Classifier/Addr/MPLS set data_driven_ 0 +# P.M. & P.B. modifications+Classifier/Umts set type_ 0	;# default wired node+Classifier/Umts set id_ -1++ # # FEC models #@@ -501,6 +540,9 @@ Node set multiPath_ 0 Node set rtagent_port_ 255 +# P.M. & P.B. modifications+Node set update_ 0+ # setting port for diffusion application agent Node set DIFFUSION_APP_PORT 254 @@ -517,8 +559,8 @@  # Default settings for Hierarchical topology #-# Bits are allocated for different fields like port, nodeid, mcast, -# hierarchical-levels. +# Bits are allocated for different fields like port, nodeid, mcast,+# hierarchical-levels. # All Mask and Shift values are stored in Class AddrParams. AddrParams set ALL_BITS_SET 0xffffffff AddrParams PortShift 0@@ -542,7 +584,7 @@ Simulator set addressType_   "" Simulator set MovementTrace_ OFF # This flag should be initially empty. It will be set to either ON or OFF-# by Simulator::create-wireless-node{}. +# by Simulator::create-wireless-node{}. Simulator set IMEPFlag_ "" Simulator set WirelessNewTrace_ 0 Simulator set propInstCreated_ 0@@ -558,10 +600,15 @@ Simulator set AgentTrace_ ON Simulator set RouterTrace_ OFF Simulator set MacTrace_   OFF+# P.M. & P.B. modifications+Simulator set PhyTrace_   OFF  # use tagged traces or positional traces? Simulator set TaggedTrace_ OFF +# P.M. & P.B. modifications+Simulator set umts-routing 0+ SessionHelper set rc_ 0                      ;# just to eliminate warnings SessionHelper set debug_ false @@ -587,17 +634,17 @@ MIPEncapsulator set debug_ false  # GAF- + GAFPartner set addr_ 0 GAFPartner set port_ 254 GAFPartner set shift_ 0 GAFPartner set mask_ [AddrParams set ALL_BITS_SET]-GAFPartner set debug_ false                  - +GAFPartner set debug_ false+ # HTTP-related defaults are in ../tcl/webcache/http-agent.tcl  #-# Wireless simulation support +# Wireless simulation support #  Mac set debug_ false@@ -607,6 +654,41 @@ Mac/Tdma set slot_packet_len_	1500 Mac/Tdma set max_node_num_	64 +# P.M. & P.B. modifications+Phy/Umts set verbose_ 0+Phy/Umts set error_rate_ 0+Phy/Umts set phy_error_ 0+Phy/Umts set delay_ 0+Phy/Umts set bandwidth_ 0+Phy/Umts set debug_ 0+Phy/Umts set max_num_ms_ 100+Phy/UmtsNodeB set verbose_ 0+Phy/UmtsNodeB set error_rate_ 0+Phy/UmtsNodeB set phy_error_ 0+Phy/UmtsNodeB set delay_ 0+Phy/UmtsNodeB set bandwidth_ 0+Phy/UmtsNodeB set debug_ 0++# P.M. & P.B. modifications+Mac/Umts set verbose_ 0+Mac/UmtsNodeb set verbose_ 0++# P.M. & P.B. modifications+Rlc/Umts set rlcverbose_ 0+Rlc/Umts set delay_ 0+Rlc/Umts set bandwidth_ 0+Rlc/Umts set rlcfragsz_  20; # rlc frag size+Rlc/Umts set debug_ 0+Rlc/UmtsNodeB set rlcverbose_ 0+Rlc/UmtsNodeB 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -