📄 umts.patch
字号:
+ int update_;+ double bw_atof(const char* s);+ }; #endif /* __ns_node_h__ */diff -ur common/packet.h ns-umts-extensions/code/packet.h--- common/packet.h 2002-09-18 05:41:50.000000000 +0000+++ ns-umts-extensions/code/packet.h 2003-06-01 20:10:45.000000000 +0000@@ -1,4 +1,35 @@ /* -*- 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) 1997 Regents of the University of California. * All rights reserved.@@ -55,6 +86,9 @@ #define HDR_MAC(p) (hdr_mac::access(p)) #define HDR_MAC802_11(p) ((hdr_mac802_11 *)hdr_mac::access(p)) #define HDR_MAC_TDMA(p) ((hdr_mac_tdma *)hdr_mac::access(p))+// P.M. & P.B. modifications+#define HDR_PHY_UMTS(p) (hdr_phy::access(p))+#define HDR_RLC_UMTS(p) (hdr_rlc_umts::access(p)) #define HDR_SMAC(p) ((hdr_smac *)hdr_mac::access(p)) #define HDR_LL(p) (hdr_ll::access(p)) #define HDR_IP(p) (hdr_ip::access(p))@@ -91,14 +125,15 @@ PT_CtrMcast_Encap, PT_CtrMcast_Decap, PT_SRM,+ /* simple signalling messages */- PT_REQUEST, - PT_ACCEPT, - PT_CONFIRM, - PT_TEARDOWN, ++ PT_REQUEST,+ PT_ACCEPT,+ PT_CONFIRM,+ PT_TEARDOWN, PT_LIVE, // packet from live network PT_REJECT,- PT_TELNET, // not needed: telnet use TCP PT_FTP, PT_PARETO,@@ -126,6 +161,7 @@ PT_TFRC_ACK, PT_PING, + // Diffusion packets - Chalermek PT_DIFF, @@ -136,7 +172,7 @@ PT_LDP, // GAF packet- PT_GAF, + PT_GAF, // ReadAudio traffic PT_REALAUDIO,@@ -144,6 +180,10 @@ // Pushback Messages PT_PUSHBACK, + // P.M. & P.B. modifications+ PT_PREAMBLE, // RACH preamble to NodeB+ PT_RRC_FAILURE, // PHY->RRC if there is no AICH+ #ifdef HAVE_STL // Pragmatic General Multicast PT_PGM,@@ -181,19 +221,19 @@ name_[PT_CtrMcast_Decap]= "CtrMcast_Decap"; name_[PT_SRM]= "SRM"; - name_[PT_REQUEST]= "sa_req"; + name_[PT_REQUEST]= "sa_req"; name_[PT_ACCEPT]= "sa_accept"; name_[PT_CONFIRM]= "sa_conf"; name_[PT_TEARDOWN]= "sa_teardown";- name_[PT_LIVE]= "live"; + name_[PT_LIVE]= "live"; name_[PT_REJECT]= "sa_reject";- name_[PT_TELNET]= "telnet"; name_[PT_FTP]= "ftp"; name_[PT_PARETO]= "pareto"; name_[PT_EXP]= "exp"; name_[PT_INVAL]= "httpInval"; name_[PT_HTTP]= "http";+ name_[PT_ENCAPSULATED]= "encap"; name_[PT_MFTP]= "mftp"; name_[PT_ARP]= "ARP";@@ -220,16 +260,20 @@ name_[PT_LDP] = "LDP"; // for GAF- name_[PT_GAF] = "gaf"; + name_[PT_GAF] = "gaf"; // RealAudio packets name_[PT_REALAUDIO] = "ra"; - //pushback + //pushback name_[PT_PUSHBACK] = "pushback"; + // P.M. & P.B. modifications+ name_[PT_PREAMBLE] = "preamble";+ name_[PT_RRC_FAILURE] = "rrc_failure";+ #ifdef HAVE_STL- // for PGM+ // for PGM name_[PT_PGM] = "PGM"; #endif //STL @@ -239,7 +283,7 @@ name_[PT_NTYPE]= "undefined"; }- const char* name(packet_t p) const { + const char* name(packet_t p) const { if ( p <= PT_NTYPE ) return name_[p]; return 0; }@@ -289,7 +333,7 @@ } virtual ~PacketData() { if (data_ != NULL) - delete []data_; + delete []data_; } unsigned char* data() { return data_; } @@ -361,7 +405,7 @@ // the pkt stamp carries all info about how/where the pkt // was sent needed for a receiver to determine if it correctly // receives the pkt- PacketStamp txinfo_; + PacketStamp txinfo_; /* * According to cmu code:@@ -369,7 +413,7 @@ * and is cleared by the link layer. It is an ugly hack, but * there's really no other way because NS always calls * the recv() function of an object.- * + * */ u_int8_t incoming; @@ -386,7 +430,7 @@ UNKN_IFACE= -1, /* * iface value for locally originated packets */- ANY_IFACE= -2 /* + ANY_IFACE= -2 /* * hashnode with iif == ANY_IFACE_ * matches any pkt iface (imported from TCL); * this value should be different from @@ -412,6 +456,9 @@ * systems don't have NONE or ILINK). */ enum ns_af_enum { NS_AF_NONE, NS_AF_ILINK, NS_AF_INET };+ +// P.M. & P.B. modifications+enum chan_t {AICH, SCH, PICH, PCCPCH, SCCPCH, DPDCH, DPCCH, PRACH, BCH, PCH, FACH, DCH, RACH, BCCH, PCCH, CCCH, DCCH, DTCH, TO_RRC, FROM_RRC}; struct hdr_cmn { enum dir_t { DOWN= -1, NONE= 0, UP= 1 };@@ -424,9 +471,12 @@ double ts_; // timestamp: for q-delay measurement int iface_; // receiving interface (label) dir_t direction_; // direction: 0=none, 1=up, -1=down- // source routing + // source routing char src_rt_valid; + // P.M. & P.B. modifications+ chan_t channel_t_; // channel type for UMTS+ //Monarch extn begins nsaddr_t prev_hop_; // IP addr of forwarding hop nsaddr_t next_hop_; // next hop for this packet@@ -435,7 +485,7 @@ // called if pkt can't obtain media or isn't ack'd. not called if // droped by a queue- FailureCallback xmit_failure_; + FailureCallback xmit_failure_; void *xmit_failure_data_; /*@@ -461,7 +511,7 @@ inline static hdr_cmn* access(const Packet* p) { return (hdr_cmn*) p->access(offset_); }- + /* per-field member functions */ inline packet_t& ptype() { return (ptype_); } inline int& size() { return (size_); }@@ -471,6 +521,10 @@ inline int& fecsize() {return fecsize_; } inline double& timestamp() { return (ts_); } inline int& iface() { return (iface_); }++ // P.M. & P.B. modifications+ inline chan_t& channel_t() { return (channel_t_); }+ inline dir_t& direction() { return (direction_); } // monarch_begin inline nsaddr_t& next_hop() { return (next_hop_); }diff -ur mac/ll.cc ns-umts-extensions/code/ll.cc--- mac/ll.cc 2002-03-14 01:12:52.000000000 +0000+++ ns-umts-extensions/code/ll.cc 2003-06-01 20:10:45.000000000 +0000@@ -12,7 +12,7 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software- * must display the following acknowledgement:+ * must display the following acknowledgement: * This product includes software developed by the Daedalus Research * Group at the University of California Berkeley. * 4. Neither the name of the University nor of the Laboratory may be used@@ -32,18 +32,28 @@ * SUCH DAMAGE. * * Contributed by the Daedalus Research Group, http://daedalus.cs.berkeley.edu- */+ */ #ifndef lint static const char rcsid[] = "@(#) $Header: /nfs/jade/vint/CVSROOT/ns-2/mac/ll.cc,v 1.46 2002/03/14 01:12:52 haldar Exp $ (UCB)"; #endif -#include <errmodel.h>-#include <mac.h>-#include <ll.h>++#include "packet.h"+#include "delay.h"+#include "mobilenode.h"+#include "address.h"++#include "arp.h"+#include "queue.h"+#include "cmu-trace.h"++//#include <errmodel.h>+#include "mac.h"+#include "ll.h" #include <address.h>-#include <dsr/hdr_sr.h>+ int hdr_ll::offset_; @@ -107,7 +117,7 @@ lanrouter_ = (LanRouter*) TclObject::lookup(argv[2]); return (TCL_OK); }-+ } else if (argc == 2) { if (strcmp(argv[1], "ifq") == 0) {@@ -165,7 +175,7 @@ void LL::sendDown(Packet* p)-{ +{ hdr_cmn *ch = HDR_CMN(p); hdr_ip *ih = HDR_IP(p); @@ -173,14 +183,14 @@ //nsaddr_t dst = ih->dst(); hdr_ll *llh = HDR_LL(p); char *mh = (char*)p->access(hdr_mac::offset_);- + llh->seqno_ = ++seqno_; llh->lltype() = LL_DATA; mac_->hdr_src(mh, mac_->addr()); mac_->hdr_type(mh, ETHERTYPE_IP); int tx = 0;- + switch(ch->addr_type()) { case NS_AF_ILINK:@@ -190,9 +200,9 @@ case NS_AF_INET: dst = ch->next_hop(); /* FALL THROUGH */- + case NS_AF_NONE:- + if (IP_BROADCAST == (u_int32_t) dst) { mac_->hdr_dst((char*) HDR_MAC(p), MAC_BROADCAST);@@ -206,12 +216,12 @@ //if (varp_) { //tx = varp_->arpresolve(dst, p); //break;- - //} ++ //} /* FALL THROUGH */ - default:- + default: + int IPnh = (lanrouter_) ? lanrouter_->next_hop(p) : -1; if (IPnh < 0) mac_->hdr_dst((char*) HDR_MAC(p),macDA_);@@ -221,7 +231,7 @@ mac_->hdr_dst((char*) HDR_MAC(p), IPnh); break; }- + if (tx == 0) { Scheduler& s = Scheduler::instance(); // let mac decide when to take a new packet from the queue.diff -ur mac/ll.h ns-umts-extensions/code/ll.h--- mac/ll.h 2000-09-01 03:04:06.000000000 +0000+++ ns-umts-extensions/code/ll.h 2003-06-01 20:10:45.000000000 +0000@@ -1,4 +1,35 @@ /* -*- 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) 1997 Regents of the University of California. * All rights reserved.@@ -39,26 +70,44 @@ #ifndef ns_ll_h #define ns_ll_h -#include <delay.h>-#include <queue.h>+#include "marshall.h"+#include <connector.h>+#include <random.h>+#include <mac.h>++#include "packet.h"+#include "delay.h"+#include "queue.h" #include <arp.h> #include <classifier.h> #include <lanRouter.h> #include <varp.h> + enum LLFrameType { LL_DATA = 0x0001,- LL_ACK = 0x0010+ LL_ACK = 0x0010,+ LL_SETUP = 0x0011,+ LL_SETUP_REPLY = 0x0100,+ LL_FAILURE = 0X0101,+ LL_PAGING = 0x0110,+ LL_RES_REQ = 0x0111,+ LL_RES_REPLY = 0x1000,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -