[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] another implementation question for ad hocs



Hi,

If your packets will be of some new packet type (i.e. ch->ptype() that is
"switched" on is something else than what is already there), you will need
to do that, or at least you will need to add a part saying

case PT_NEWP:
	break;

where PT_NEWP is the new packet type. The reason for having this
format_xyz() function is if you want any protocol specific data in the
trace file (the format_xyz() function writes stuff to the trace 
file). Otherwise I suppose just the above would do (but you need that
case PT_NEWP: stuff, otherwise an error will occur (unknown packet type)).

Hope this helps,

/Anders

On Fri, 30 Mar 2001, Piyush Khengar wrote:
> I have noticed that in the file cmu-trace.cc, there is a switch
> statement (in CMUTrace::format() ) that detects the packet types and
> then calls another function accordingly.
> 
> E.g. case PT_AODV:
> 		format_aodv(p, offset);
> 		break;
> 
> What is the format_aodv/tora/dsr() function used for? I've had a look at
> the code for this function and am not sure of it's significance. Do I
> need to include a format_myagent() function for my protocol?
> 
> Many thanks,
> Piyush
> (ns-2.1b7, red hat 7)
>