Network order or Host order for raw xlat style
shankarapailoor
shankarapailoor at gmail.com
Sat Jan 5 04:41:45 UTC 2019
Sorry, just to be more clear, attached is the updated patch which
prints the fields as hex strings.
On Fri, Jan 4, 2019 at 8:39 PM shankarapailoor
<shankarapailoor at gmail.com> wrote:
>
> Hi Dmitry,
>
> >Why do you print s_addr converted to host order?
>
> Yeah my bad. I changed it to do as Eugene suggested in the earlier
> email and print a hex string. I have done this for sin_port,
> sin6_port, and sin6_flowinfo as well. Let me know if that is ok.
>
> Regards,
> Shankara
>
>
> On Fri, Jan 4, 2019 at 2:38 PM Dmitry V. Levin <ldv at altlinux.org> wrote:
> >
> > Hi,
> >
> > On Thu, Jan 03, 2019 at 11:13:39PM -0800, shankarapailoor wrote:
> > > Hi again,
> > >
> > > I've added support to properly handle xlat styles when decoding both
> > > sockaddr_in6 (sin6_port, sin6_addr, sin6_flowinfo) as well as
> > > sockaddr_in (sin_port, sin_addr). I merged the two into one patch
> > > which is attached. Let me know what you all think!
> >
> > Thanks,
> >
> > [...]
> > > diff --git a/print_fields.h b/print_fields.h
> > > index bcab1b73..05be8389 100644
> > > --- a/print_fields.h
> > > +++ b/print_fields.h
> > > @@ -159,9 +159,28 @@
> > > sizeof((where_).field_), #field_); \
> > > } while (0)
> > >
> > > -# define PRINT_FIELD_INET4_ADDR(prefix_, where_, field_) \
> > > - STRACE_PRINTF("%s%s=inet_addr(\"%s\")", (prefix_), #field_, \
> > > - inet_ntoa((where_).field_))
> > > +#define PRINT_FIELD_INET4_ADDR(prefix_, where_, field_) \
> > > + do { \
> > > + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) { \
> > > + STRACE_PRINTF("%s%s=%#x", \
> > > + (prefix_), #field_, \
> > > + ntohl((where_).field_.s_addr)); \
> >
> > Why do you print s_addr converted to host order?
> > If I understand correctly, XLAT_STYLE_RAW is expected to print values as is.
> >
> >
> > --
> > ldv
> > --
> > Strace-devel mailing list
> > Strace-devel at lists.strace.io
> > https://lists.strace.io/mailman/listinfo/strace-devel
>
>
>
> --
> Regards,
> Shankara Pailoor
--
Regards,
Shankara Pailoor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0001-handle-xlat-styles-when-decoding-sockaddr_in-and-.patch
Type: text/x-patch
Size: 15688 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190104/652c67bb/attachment.bin>
More information about the Strace-devel
mailing list