[Click] endianness

Eddie Kohler kohler at cs.ucla.edu
Tue Mar 20 09:30:36 EST 2007


#if CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN
...
#elif CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN
...
#endif

(or of course you can use "if (CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN)".)


David Biot wrote:
> Dear,
> 
> I'm writing an element to append a sequence number to the packet-data. I
> would like to make sure this is as cross-platform as possible. Is there
> a way to know what the endianness of the current machine is? Normally I
> would use a function where I store a bit-array and cast this to a short,
> but as I discovered, casting is not possible with click.
> 
> -- David Biot
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list