All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Guido Günther" <agx@sigxcpu.org>, "Riku Voipio" <riku.voipio@iki.fi>
Subject: Re: [PATCH v8 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content
Date: Mon, 21 Oct 2019 14:54:04 +0200	[thread overview]
Message-ID: <9e764015-29b0-8608-0f15-0719aa1be248@vivier.eu> (raw)
In-Reply-To: <20191021114857.20538-6-f4bug@amsat.org>

Le 21/10/2019 à 13:48, Philippe Mathieu-Daudé a écrit :
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Tested-By: Guido Günther <agx@sigxcpu.org>
> ---
> v8: use tswap32 (lvivier)
> ---
>  linux-user/strace.c | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index fd5596a640..5fa7748427 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -8,6 +8,7 @@
>  #include <arpa/inet.h>
>  #include <netinet/tcp.h>
>  #include <linux/if_packet.h>
> +#include <linux/netlink.h>
>  #include <sched.h>
>  #include "qemu.h"
>  
> @@ -398,6 +399,12 @@ print_sockaddr(abi_ulong addr, abi_long addrlen)
>              gemu_log("}");
>              break;
>          }
> +        case AF_NETLINK: {
> +            struct target_sockaddr_nl *nl = (struct target_sockaddr_nl *)sa;
> +            gemu_log("{nl_family=AF_NETLINK,nl_pid=%u,nl_groups=%u}",
> +                     tswap32(nl->nl_pid), tswap32(nl->nl_groups));
> +            break;
> +        }
>          default:
>              gemu_log("{sa_family=%d, sa_data={", sa->sa_family);
>              for (i = 0; i < 13; i++) {
> @@ -424,6 +431,9 @@ print_socket_domain(int domain)
>      case PF_INET:
>          gemu_log("PF_INET");
>          break;
> +    case PF_NETLINK:
> +        gemu_log("PF_NETLINK");
> +        break;
>      case PF_PACKET:
>          gemu_log("PF_PACKET");
>          break;
> @@ -473,6 +483,33 @@ print_socket_protocol(int domain, int type, int protocol)
>          return;
>      }
>  
> +    if (domain == PF_NETLINK) {
> +        switch (protocol) {
> +        case NETLINK_ROUTE:
> +            gemu_log("NETLINK_ROUTE");
> +            break;
> +        case NETLINK_AUDIT:
> +            gemu_log("NETLINK_AUDIT");
> +            break;
> +        case NETLINK_NETFILTER:
> +            gemu_log("NETLINK_NETFILTER");
> +            break;
> +        case NETLINK_KOBJECT_UEVENT:
> +            gemu_log("NETLINK_KOBJECT_UEVENT");
> +            break;
> +        case NETLINK_RDMA:
> +            gemu_log("NETLINK_RDMA");
> +            break;
> +        case NETLINK_CRYPTO:
> +            gemu_log("NETLINK_CRYPTO");
> +            break;
> +        default:
> +            gemu_log("%d", protocol);
> +            break;
> +        }
> +        return;
> +    }
> +
>      switch (protocol) {
>      case IPPROTO_IP:
>          gemu_log("IPPROTO_IP");
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>



  reply	other threads:[~2019-10-21 12:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 11:48 [PATCH v8 0/9] linux-user: strace improvements Philippe Mathieu-Daudé
2019-10-21 11:48 ` [PATCH v8 1/9] linux-user/strace: Display invalid pointer in print_timeval() Philippe Mathieu-Daudé
2019-10-21 13:23   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 2/9] linux-user/strace: Add print_timezone() Philippe Mathieu-Daudé
2019-10-21 12:49   ` Laurent Vivier
2019-10-21 13:24   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 3/9] linux-user/strace: Improve settimeofday() Philippe Mathieu-Daudé
2019-10-21 13:25   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 4/9] linux-user/syscall: Introduce target_sockaddr_nl Philippe Mathieu-Daudé
2019-10-21 13:26   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 5/9] linux-user/strace: Dump AF_NETLINK sockaddr content Philippe Mathieu-Daudé
2019-10-21 12:54   ` Laurent Vivier [this message]
2019-10-21 11:48 ` [PATCH v8 6/9] linux-user/strace: Add print_sockfd() Philippe Mathieu-Daudé
2019-10-21 13:27   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 7/9] linux-user/strace: Improve bind() output Philippe Mathieu-Daudé
2019-10-21 13:27   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 8/9] linux-user/strace: Let print_sockaddr() have a 'last' argument Philippe Mathieu-Daudé
2019-10-21 12:54   ` Laurent Vivier
2019-10-21 13:28   ` Laurent Vivier
2019-10-21 11:48 ` [PATCH v8 9/9] linux-user/syscall: Align target_sockaddr fields using ABI types Philippe Mathieu-Daudé
2019-10-21 12:55   ` Laurent Vivier
2019-10-21 13:29   ` Laurent Vivier
2019-10-21 16:11 ` [PATCH v8 0/9] linux-user: strace improvements no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e764015-29b0-8608-0f15-0719aa1be248@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=agx@sigxcpu.org \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.