From: Andrew Lunn <andrew@lunn.ch>
To: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Cc: b.a.t.m.a.n@lists.open-mesh.org, a@unstable.cc
Subject: Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs
Date: Tue, 3 May 2016 14:45:51 +0200 [thread overview]
Message-ID: <20160503124551.GA16952@lunn.ch> (raw)
In-Reply-To: <3771281.MWFGszot8n@bentobox>
> 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]: Potential nexthops ...\n");
Ah, yes. I wanted to come back and look at this. It needs an extra
call to ask what algorithm is being used, so you know which header to
print.
> the nexthops are also done differently now (not sure if this is better
> but at least something which should be discussed):
I've deliberately not made the output the same as the kernel debugfs.
There is no real reason to do that. You should not be 'screen
scraping' batctl, you should use the netlink socket...
Anything where the kernel consolidates information does not happen. We
get the raw information from the kernel, and it is printed as is, with
the exception that bathosts is used to translate MAC addresses to
names. There are also likely to be white space changes.
The callback structure used by netlink does not help here. You get to
see one originator record at once. So in order to print consolidated
information, you would have to build a database in the callback
function, and once all the information is available, do the
consolidate and then printing. Doable, but i took the easier option of
printing a line per originator record.
> originator
> ==========
>
> netlink
> -------
>
> [B.A.T.M.A.N. adv 2016.1-62-g55e9890, MainIF/MAC: eth0/02:ba:de:af:fe:01 (bat0/f2:f2:2d:c3:71:8c BATMAN_IV)]
> * 02:ba:de:af:fe:02 0.004s (251) 02:ba:de:af:fe:02 [ eth0]
>
> debugfs
> -------
>
> [B.A.T.M.A.N. adv 2016.1-62-g55e9890, MainIF/MAC: eth0/02:ba:de:af:fe:01 (bat0 BATMAN_IV)]
> Originator last-seen (#/255) Nexthop [outgoingIF]: Potential nexthops ...
> 02:ba:de:af:fe:02 0.024s (251) 02:ba:de:af:fe:02 [ eth0]: 02:ba:de:af:fe:02 (251)
>
> The output "No batman nodes in range ...\n" also isn't there anymore
> (not that I would miss it).
Again, the callback structure makes that messy. A global variable
which needs setting in the callback, and after parsing all the
records, if that global variable is not set, print the "No batman
nodes in range ...\n"
Andrew
prev parent reply other threads:[~2016-05-03 12:45 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
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 [this message]
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=20160503124551.GA16952@lunn.ch \
--to=andrew@lunn.ch \
--cc=a@unstable.cc \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=sven.eckelmann@open-mesh.com \
/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