Re: Functions htonq and ntohq in <click/integers.hh>
Markku Savela <[email protected]> Thu, 11 Oct 2012 10:08:38 +0300
| Newsgroups | gmane.network.routing.click |
|---|---|
| Message-ID | <[email protected]> |
On 10/11/2012 09:37 AM, Markku Savela wrote:
> On 10/11/2012 02:45 AM, Eddie Kohler wrote
> Oh well, must have some
> error in my thought process then... will explore more.
Ok, something fishy on the MIPS (Octeon) side of my code
I've in packet payload...
uint64_t in_packets;
and before sending the packet out, I do something like
x.in_packets = htonq(x.in_packets)
when the in_packets is 7, the wireshark shows it as
... 00 00 00 07 00 00 00 00 ...
Apparently MIPS in big endian mode and calling htonq is not
correct. I was using htonq in same sense as "htonl", which
always works, whether host is big or little endian.