From: Sven Eckelmann <sven@narfation.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs
Date: Tue, 03 May 2016 14:54:26 +0200 [thread overview]
Message-ID: <3986955.uBauJeRErD@bentobox> (raw)
In-Reply-To: <20160503124719.GB16952@lunn.ch>
[-- Attachment #1: Type: text/plain, Size: 985 bytes --]
On Tuesday 03 May 2016 14:47:19 Andrew Lunn wrote:
> On Tue, May 03, 2016 at 02:26:34PM +0200, Sven Eckelmann wrote:
> > On Tuesday 03 May 2016 14:20:46 Andrew Lunn wrote:
> > [...]
> > > There does not seem to be a way to say that BATADV_ATTR_VERSION is
> > > also an NLA_STRING.
> >
> > Please check "policy" in the link I gave you.
>
> I did. And i still don't get how you can check the type.
>
> Andrew
struct nla_policy {
uint16_t type;
uint16_t minlen;
uint16_t maxlen;
};
there is an entry for type, minlen and maxlen. The type member is to check for
the type. Here is an example how to check the type from batctl:
static struct nla_policy info_data_link_policy[IFLA_MAX + 1] = {
[IFLA_LINKINFO] = { .type = NLA_NESTED },
[IFLA_LINK] = { .type = NLA_U32 },
};
[...]
ret = nlmsg_parse(n, sizeof(struct ifinfomsg), tb, IFLA_MAX,
info_data_link_policy);
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-05-03 12:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 20:56 [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs Andrew Lunn
2016-05-03 7:07 ` Sven Eckelmann
2016-05-03 12:20 ` Andrew Lunn
2016-05-03 12:26 ` Sven Eckelmann
2016-05-03 12:47 ` Andrew Lunn
2016-05-03 12:54 ` Sven Eckelmann [this message]
2016-05-03 13:08 ` Andrew Lunn
2016-05-03 20:16 ` Marek Lindner
2016-05-03 20:30 ` Andrew Lunn
2016-05-03 9:47 ` Sven Eckelmann
2016-05-03 9:51 ` Sven Eckelmann
2016-05-03 10:30 ` Sven Eckelmann
2016-05-03 12:45 ` Andrew Lunn
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=3986955.uBauJeRErD@bentobox \
--to=sven@narfation.org \
--cc=andrew@lunn.ch \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox