- 论坛徽章:
- 0
|
这几天,西南科技大学的朋友给我发邮件说使用TORA协议做无线仿真时遇到一个错误,调试不成功。我就索性看了下脚本文件,可我偏偏找不到错误,很奇怪,找了很久。ps:我用的ns2.33。
总是报错:
(_o17 cmd line 1)
invoked from within
"_o17 cmd port-dmux _o32"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o17" line 2)
(SplitObject unknown line 2)
invoked from within
"$agent port-dmux $dmux_"
(procedure "_o14" line 11)
(Node/MobileNode add-target-rtagent line 11)
invoked from within
"$self add-target-rtagent $agent $port"
(procedure "_o14" line 22)
(Node/MobileNode add-target line 22)
invoked from within
"$self add-target $agent $port"
(procedure "_o14" line 15)
(Node attach line 15)
invoked from within
"$node attach $ragent [Node set rtagent_port_]"
(procedure "_o3" line 68)
(Simulator create-wireless-node line 68)
invoked from within
"_o3 create-wireless-node"
(procedure "_o3" line 14)
(Simulator node line 14)
invoked from within
"$ns_ node"
("for" body line 2)
invoked from within
"for {set i 0} {$i
脚本看了很久,真找不到错误。于是我开始怀疑TORA本身的问题,于是把TORA改为了AODV。结果就正常了,不再报错了~~~看来NS2下TORA协议本身就有问题。呵呵!
-------------------------------------------------------------------
-------------------------------------------------------------------
以下是NS2下TORA纠错的方法:
(1). tora.h中:
加上NSObject * port_dmux_;
(2). tora.cc中:
TORAAgent::command()
TclObject *obj;//第一句
//下面的句子 加到最后一个else if后面。
else if (strcmp(argv[1], "port-dmux") == 0) {
if ((obj = TclObject::lookup(argv[2])) == 0) {
fprintf(stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1],
argv[2]);
return TCL_ERROR;
}
port_dmux_ = (NsObject *) obj;
return TCL_OK;
}
然后make
就可能用tora协议了
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/82448/showart_1943497.html |
|