Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Andrew Lunn
> > Once the code is mostly complete and stable, i think a local copy > > would be good. It does seems to be the common way. > > A local copy sounds like a sensible choice and common practice. Hi Marek v3 has a local copy. Andrew

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Marek Lindner
On Tuesday, May 03, 2016 14:20:46 Andrew Lunn wrote: > On Tue, May 03, 2016 at 09:07:35AM +0200, Sven Eckelmann wrote: > > [...] > > > > > +ifeq ($(origin LIBNL_GENL_CFLAGS) $(origin LIBNL_GENL_LDLIBS), > > > undefined undefined) + LIBNL_GENL_NAME ?= libnl-genl-3.0 > > > + ifeq ($(shell

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Andrew Lunn
On Tue, May 03, 2016 at 02:54:26PM +0200, Sven Eckelmann wrote: > 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

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Sven Eckelmann
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

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Andrew Lunn
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

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Andrew Lunn
> It looks like the header line is missing here. The debugfs table show > something like: > > " Originator last-seen (#/255) Nexthop [outgoingIF]: > Potential nexthops ...\n"); > > or > > " Originator last-seen ( throughput) Nexthop > [outgoingIF]:

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Sven Eckelmann
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. Kind regards, Sven signature.asc Description: This is a digitally signed message part.

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Andrew Lunn
On Tue, May 03, 2016 at 09:07:35AM +0200, Sven Eckelmann wrote: > [...] > > +ifeq ($(origin LIBNL_GENL_CFLAGS) $(origin LIBNL_GENL_LDLIBS), undefined > > undefined) > > + LIBNL_GENL_NAME ?= libnl-genl-3.0 > > + ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_GENL_NAME) > > 2>/dev/null),) > >

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Sven Eckelmann
[] > +static int originators_callback(struct nl_msg *msg, void *arg) > +{ [...] > + > + if (!genlmsg_valid_hdr(nlh, 0)) { > + fputs("Received invalid data from kernel.", stderr); [...] > + > + orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]); > + neigh =

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Sven Eckelmann
> #include "debug.h" > #include "debugfs.h" > #include "functions.h" > +#include "netlink.h" > #include "sys.h" Header file is missing in this patch. Kind regards, Sven signature.asc Description: This is a digitally signed message part.

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Sven Eckelmann
On Monday 02 May 2016 22:56:57 Andrew Lunn wrote: > The kernel has gained support for exporting some information via > netlink. Use this when available, rather than debugfs. > > If netlink is not available, or the information is not yet available > via netlink, batctl will fall back to debugfs.

Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-03 Thread Sven Eckelmann
[...] > +ifeq ($(origin LIBNL_GENL_CFLAGS) $(origin LIBNL_GENL_LDLIBS), undefined > undefined) > + LIBNL_GENL_NAME ?= libnl-genl-3.0 > + ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_GENL_NAME) 2>/dev/null),) > +$(error No $(LIBNL_GENL_NAME) development libraries found!) > + endif > +

[B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs

2016-05-02 Thread Andrew Lunn
The kernel has gained support for exporting some information via netlink. Use this when available, rather than debugfs. If netlink is not available, or the information is not yet available via netlink, batctl will fall back to debugfs. Signed-off-by: Andrew Lunn --- v2: Verify