?? ns-mac802_16-lib.tcl
字號:
# Copyright (c) 2006 Korea Advanced Institute of Science and Technology,# All rights reserved.# # Permission to use, copy, modify, and distribute this software and# its documentation for any purpose, without fee, and without# written agreement is hereby granted, provided that the above# copyright notice and the following two paragraphs appear in all# copies of this software.# # IN NO EVENT SHALL KOREA ADVANCED INSTITUTE OF SCIENCE AND TECHNOLOGY BE# LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR# CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND# ITS DOCUMENTATION, EVEN IF KOREA ADVANCED INSTITUTE OF SCIENCE AND# TECHNOLOGY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.# # KOREA ADVANCED INSTITUTE OF SCIENCE AND TECHNOLOGY SPECIFICALLY DISCLAIMS# ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE# SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND# KOREA ADVANCED INSTITUTE OF SCIENCE AND TECHNOLOGY HAS NO OBLIGATION TO# PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.# # Code contributed by Seungwoon Kim, swkim@cnlab.kaist.ac.kr, http://cnlab.kaist.ac.kr/~swkim## ns-mac802_16-lib.tcl# tcl procedures to support 802_16 macAgent/RAgent_802_16 set sport_ 0Agent/RAgent_802_16 set dport_ 0Agent/RAgent_802_16 set verbose_ 0Agent instproc init args { eval $self next $args}Agent/RAgent_802_16 instproc init args { eval $self next $args}ARPTable/Static instproc init args { eval $self next $args}Simulator instproc create-ragent802_16 { node } { set ragent [new Agent/RAgent_802_16] set addr [$node node-addr] $ragent addr $addr $ragent node $node if [Simulator set mobile_ip_] { $ragent port-dmux [$node set dmux_] } $node addr $addr $node set ragent_ $ragent return $ragent}Scheduler_802_16 instproc init args { eval $self next $args }Scheduler_802_16 proc instance {} { set scheduler802_16 [Scheduler_802_16 info instances] if { $scheduler802_16 != "" } { return $scheduler802_16 } error "Cannot find instance of Scheduler_802_16"}Mac/802_16 set debug_ falseMac/802_16 set num_connections_ 0Mac/802_16 instproc init args { eval $self next args# $self instvar connection_queue_info_ num_connections_# set connection_queue_info_(0:0:0) 0# incr num_connections_# $self instvar perconnection_outq_# set perconnection_outq_ [new Queue/PerConnectionQ]# $perconnection_outq_ buildPCQ # $self install-pcq $perconnection_outq_# $perconnection_outq_ set mac_ $self set scheduler_802_16 [Scheduler_802_16 instance] $self mac-scheduler $scheduler_802_16 $scheduler_802_16 add-mac $self set ns [Simulator instance] $ns create-eventtrace Event $self}#Mac/802_16 instproc record-connection-info { CID src dst {fid 0} } {# $self instvar connection_info_ num_connections_# if ![info exists connection_info($src:$dst:$fid)] {# set connection_info_($src:$dst:$fid) $CID# $self record-connection-info $src $dst $fid $slotindex# }# else if { $temp != $slotindex } {# $self cmd change-connection-info $src $dst $fid $slotindex# }#}###Mac/802_16 instproc record-connection-info { CID src dst fid slotindex } {# set temp [$self get-connection_info $src $dst $fid]# if { $temp == -1 } {# $self cmd record-connection-info $src $dst $fid $slotindex# }# else if { $temp != $slotindex } {# $self cmd change-connection-info $src $dst $fid $slotindex# }#}#Mac/802_16 instproc record-queue-info { src dst fid slotindex } {# $self instvar connection_queue_info_ num_connections_# set connection_queue_info_($src:$dst:$fid) $slotindex# $self cmd record-connection-queue-info $num_connections_ $src $dst $fid $slotindex# incr num_connections_#}#Mac/802_16 instproc get-queue-info { src dst fid } {# $self instvar connection_queue_info_# return $connection_queue_info_($src:$dst:$fid)#}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -