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

Re: [ns] traffictrace.cc bug



regarding byte order. shouldn't the htonl function be a dummy function in
case the byte order for that machine is the same as the network order ?

-srinivasan

On Thu, 9 Mar 2000, Roman A Pletka wrote:

> Pang Kun wrote:
> > 
> > the code below should definitely be commented out:
> > .....
> > t->trec_time = htonl(t->trec_time);
> > t->trec_size = htonl(t->trec_size);
> > .....
> > 
> > Faint, it cost me several days to study my MPEG video
> > generation code. But the bug is in ns code, after commenting
> > it out, my simulation run ok.
> > 
> > Perhaps I am wrong, but could anyone tell me what are these
> > two code for?
> The byte order of an integer value in the memory depends
> on the processor used (in fact the Intel's byte order 
> differs from the rest of the world). The function just does 
> the translation from the host byte order to the network byte order.
> Depending on the byte order in your traffic trace file you should
> or should not use the functions.
> 
> hth
> Roman
> 
> -- 
> --------------------------------------------------------
> Roman Pletka                [email protected]
>