Hi all.
I have coded my own protocol and I get three errors while compiling NS2.
I have made the necessary changes in the files packet.h, ns-packet.tcl,
ns-default.tcl and ns-lib.tcl. Also priqueue.cc and Makefile.in.
The changes are as follows -
~~~packet.h~~~
Defined the following ---
static const packet_t PT_MSPROTOCH = 63;
static const packet_t PT_MSPROTODD = 64;
Added the following in p_info()---
name_[PT_MSPROTOCH] = "msprotoch"; // MS Protocol Cluster Head
name_[PT_MSPROTODD] = "msprotodd"; // MS Protocol Data Discovery
~~~ ns-default.tcl ~~~
Agent/MSProtoClusterHead set level_id 0
Agent/MSProtoClusterHead set sector_id 0
~~~ ns-packet.tcl ~~~
foreach prot {
# Common:
###...
MSProto # MSProto -Mobile Static Protocol
###
}
MSProto is the folder inside which all the protocol files reside.
I am not sure what else is supposed to be entered here.
~~~ ns-lib.tcl ~~~
Added the following -
Simulator instproc create-msprotoch-agent { node } {
# Create Cluster Head routing agent
set ragent [new Agent/MSClusterHead [$node node-addr]]
$self at 0.0 "$ragent start"
$node set ragent_ $ragent
return $ragent
}
Simulator instproc create-msprotodd-agent { node } {
# Create Data Discovery routing agent
set ragent [new Agent/MS [$node node-addr]]
$self at 0.0 "$ragent start"
$node set ragent_ $ragent
return $ragent
}
Simulator instproc create-wireless-node args {
..
MSClusterHead {
set ragent [$self create-msprotoch-agent $node]
}
MSDataDiscovery {
set ragent [$self create-msprotodd-agent $node]
}
..
}
MSClusterHead and MSDataDiscovery are the two agents.
On compiling I get the following three errors-
In file included from MSProto/msproto.cc:5:
MSProto/msproto.h:35: error: multiple types in one declaration
MSProto/msproto.cc: In constructor ‘MSClusterHead::MSClusterHead(nsaddr_t)’:
MSProto/msproto.cc:70: error: no matching function for call to
‘MSClusterHead::bind(const char [9], u_int8_t*)’
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:177: note: candidates are:
void TclObject::bind(const char*, TracedInt*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:178: note:
void TclObject::bind(const char*, TracedDouble*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:179: note:
void TclObject::bind(const char*, double*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:182: note:
void TclObject::bind(const char*, unsigned int*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:183: note:
void TclObject::bind(const char*, int*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:185: note:
void TclObject::bind(const char*, TclObject**)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:188: note:
void TclObject::bind(const char*, int64_t*)
MSProto/msproto.cc:71: error: no matching function for call to
‘MSClusterHead::bind(const char [10], u_int8_t*)’
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:177: note: candidates are:
void TclObject::bind(const char*, TracedInt*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:178: note:
void TclObject::bind(const char*, TracedDouble*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:179: note:
void TclObject::bind(const char*, double*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:182: note:
void TclObject::bind(const char*, unsigned int*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:183: note:
void TclObject::bind(const char*, int*)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:185: note:
void TclObject::bind(const char*, TclObject**)
/home/deepti/ns-allinone-2.34/tclcl-1.19/tclcl.h:188: note:
void TclObject::bind(const char*, int64_t*)
make: *** [MSProto/msproto.o] Error 1
r...@deepti-laptop:/home/deepti/ns-allinone-2.34/ns-2.34#
PS: Please find the files attached with this mail.
http://old.nabble.com/file/p28162719/msproto.cc msproto.cc
http://old.nabble.com/file/p28162719/msproto.h msproto.h
http://old.nabble.com/file/p28162719/msprotopkt.h msprotopkt.h
Thanks and Regards,
The Learner
--
View this message in context:
http://old.nabble.com/Error-with-bind%28%29-function.-tp28162719p28162719.html
Sent from the ns-users mailing list archive at Nabble.com.