Network order or Host order for raw xlat style
shankarapailoor
shankarapailoor at gmail.com
Wed Jan 2 21:33:26 UTC 2019
Hi,
Attached is a patch to handle xlat_styles for sin_port and sin_addr
fields in sockaddr_in decoding. Let me know what you all think.
Regards,
Shankara
On Wed, Jan 2, 2019 at 10:24 AM Eugene Syromiatnikov <esyr at redhat.com> wrote:
>
> 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
> --
> Strace-devel mailing list
> Strace-devel at lists.strace.io
> https://lists.strace.io/mailman/listinfo/strace-devel
--
Regards,
Shankara Pailoor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-make-sockaddr_in-port-and-inet_addr-fields-obey-x.patch
Type: text/x-patch
Size: 10405 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190102/2fc4177f/attachment.bin>
More information about the Strace-devel
mailing list