[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] new multicast packet header
Thanks for all the help so far, and in advance for help with this problem
below!
Okay, now it is not giving me an error until I try to put a value into my
new header field. If I only call the access function, as in the ping
example, there's no problem. So this line is okay:
hdr_alert* hdr = (hdr_alert*)pkt->access(off_alert_);
But if I add this line I get a bus error:
hdr->orphanID = 1;
I'm suspecting that it's because in the ns-default.tcl file I arbitrarily
assign an initial value to 'off_alert_' of 50. Is this a mistake?
My 'alert.cc' file has this code in it, which I thought initialized
'off_alert_' to the correct value:
AlertAgent::AlertAgent() : Agent(PT_ALERT)
{
//bind("size_", &packetSize_);
bind("packetSize_", &size_);
bind("off_alert_", &off_alert_);
}
-Lori
>
> That ping example is old, maybe it wasn't updated to reflect the
> changes. This is pretty much the only idea I have. But you don't have to
> explicitly modify ns-default and recompile. I (personnaly) like to have the
> default in my scripts so I remember their values...
>
> You have to set default values everytime you do a binding. Otherwise
> they can be hardcoded.
>