lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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