I am trying add new routing protocol, but occurs the following error:
fault segmentation.
I put print in my agent.cc and see that the error occurs this part:
int myAgent::command(int argc, const char*const* argv){
Tcl& tcl = Tcl::instance();
if (argc == 3)
{ Packet* pkt = allocpkt();
hdr_ip* hdrip = hdr_ip::access(pkt);
hdr_tar5* hdr = hdr_tar5::access(pkt);
if (strcmp(argv[1],"addr") == 0 ) {
hdr->ret = 0;
myaddr = Address::instance().str2addr(
argv[2]);
hdr->ret = 0;
hdr->TTL=0;
send(pkt,0);
Packet::free(pkt);
return (TCL_OK);
}
}
Thanks,