Network order or Host order for raw xlat style

Eugene Syromiatnikov esyr at redhat.com
Wed Jan 2 18:24:22 UTC 2019


On Wed, Jan 02, 2019 at 10:19:46AM -0800, shankarapailoor wrote:
> Hi,
> 
> strace currently decodes sockaddr fields of sin_port and sin_addr in
> macro form of htonl(X) and inet_addr("Y") even when using -Xraw which
> seems wrong. I'm working on fixing this but I wonder: should the raw
> value of these fields should be the network ordered value or host
> ordered value?

htonl() is used precisely for signifying byte order. If there's not such
sign, host order is assumed. The same for inet_addr().

As an alternative, the data in question can be printed as a hex string
or a byte array.

> Regards,
> Shankara Pailoor
> -- 
> Strace-devel mailing list
> Strace-devel at lists.strace.io
> https://lists.strace.io/mailman/listinfo/strace-devel


More information about the Strace-devel mailing list