[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e300840-35ea-5f05-e9c1-33a66646042e@gmail.com>
Date: Sun, 23 Aug 2020 19:45:51 -0600
From: David Ahern <dsahern@...il.com>
To: Johannes Berg <johannes@...solutions.net>, netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH 2/2] genl: ctrl: support dumping netlink policy
On 8/19/20 4:29 AM, Johannes Berg wrote:
> @@ -100,6 +102,30 @@ static int print_ctrl_grp(FILE *fp, struct rtattr *arg, __u32 ctrl_ver)
>
> }
>
> +static const char *get_nla_type_str(unsigned int attr)
> +{
> + switch (attr) {
> +#define C(x) case NL_ATTR_TYPE_ ## x: return #x
> + C(U8);
> + C(U16);
> + C(U32);
> + C(U64);
> + C(STRING);
> + C(FLAG);
> + C(NESTED);
> + C(NESTED_ARRAY);
> + C(NUL_STRING);
> + C(BINARY);
> + C(S8);
> + C(S16);
> + C(S32);
> + C(S64);
> + C(BITFIELD32);
> + default:
> + return "unknown";
> + }
> +}
> +
This should go in libnetlink since it generic NLA type strings.
> /*
> * The controller sends one nlmsg per family
> */
Powered by blists - more mailing lists