public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven.eckelmann@open-mesh.com>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: a@unstable.cc
Subject: Re: [B.A.T.M.A.N.] [PATCHv2] batctl: Use netlink to replace some of debugfs
Date: Tue, 03 May 2016 12:30:40 +0200	[thread overview]
Message-ID: <3771281.MWFGszot8n@bentobox> (raw)
In-Reply-To: <1462222618-29761-1-git-send-email-andrew@lunn.ch>

[-- Attachment #1: Type: text/plain, Size: 6076 bytes --]

[....]
> +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 = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]);
> +
> +	if (!if_indextoname(nla_get_u32(attrs[BATADV_ATTR_HARD_IFINDEX]),
> +			    ifname))
> +		ifname[0] = '\0';
> +
> +	if (attrs[BATADV_ATTR_FLAG_BEST])
> +		c = '*';
> +
> +	last_seen_msecs = nla_get_u32(attrs[BATADV_ATTR_LAST_SEEN_MSECS]);
> +	last_seen = (float)last_seen_msecs / 1000.0;
> +	last_seen_secs = last_seen_msecs / 1000;
> +	last_seen_msecs = last_seen_msecs % 1000;
> +
> +	/* skip timed out originators */
> +	if (opts->read_opt & NO_OLD_ORIGS)
> +		if (last_seen > opts->orig_timeout)
> +			return NL_OK;
> +
> +	if (attrs[BATADV_ATTR_THROUGHPUT]) {
> +		throughput_kbits = nla_get_u32(attrs[BATADV_ATTR_THROUGHPUT]);
> +		throughput_mbits = throughput_kbits / 1000;
> +		throughput_kbits = throughput_kbits % 1000;
> +
> +		if (!(opts->read_opt & USE_BAT_HOSTS)) {
> +			printf(" %c %02x:%02x:%02x:%02x:%02x:%02x %4i.%03is (%9u.%1u) %02x:%02x:%02x:%02x:%02x:%02x [%10s]\n",

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");

the nexthops are also done differently now (not sure if this is better
but at least something which should be discussed):

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).


claimtable
==========

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)]
    Client               VID      Originator        [o] (CRC   )

debugfs
-------

    Claims announced for the mesh bat0 (orig 02:ba:de:af:fe:01, group id 0x9053)
       Client               VID      Originator        [o] (CRC   )


gateway
=======

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)]
       Router           TQ      Next Hop        outgoingIf   Bandwidth

debugfs
-------
          Gateway      (#/255)           Nexthop [outgoingIF]: advertised uplink bandwidth ... [B.A.T.M.A.N. adv 2016.1-62-g55e9890, MainIF/MAC: eth0/02:ba:de:af:fe:01 (bat0)]
    No gateways in range ...


transtable_global
=================

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)]
           Client         VID Flags Last ttvn     Via        ttvn  (CRC       )
     * 1a:fd:d4:3b:b9:06    0 [....] (  2) 02:ba:de:af:fe:02 (  2) (0x36e70691)
     * 33:33:ff:3b:b9:06   -1 [....] (  2) 02:ba:de:af:fe:02 (  2) (0x777c331a)
     * 01:00:5e:00:00:01   -1 [....] (  2) 02:ba:de:af:fe:02 (  2) (0x777c331a)
     * 1a:fd:d4:3b:b9:06   -1 [....] (  1) 02:ba:de:af:fe:02 (  2) (0x777c331a)
     * 33:33:00:00:00:01   -1 [....] (  1) 02:ba:de:af:fe:02 (  2) (0x777c331a)

debugfs
-------

    Globally announced TT entries received via the mesh bat0
           Client         VID  (TTVN)       Originator      (Curr TTVN) (CRC       ) Flags
     * 1a:fd:d4:3b:b9:06    0   (  2) via 02:ba:de:af:fe:02     (  2)   (0x36e70691) [....]
     * 33:33:ff:3b:b9:06   -1   (  2) via 02:ba:de:af:fe:02     (  2)   (0x777c331a) [....]
     * 01:00:5e:00:00:01   -1   (  2) via 02:ba:de:af:fe:02     (  2)   (0x777c331a) [....]
     * 1a:fd:d4:3b:b9:06   -1   (  1) via 02:ba:de:af:fe:02     (  2)   (0x777c331a) [....]
     * 33:33:00:00:00:01   -1   (  1) via 02:ba:de:af:fe:02     (  2)   (0x777c331a) [....]

Odd to exchange the order of the flags. @Antonio, do you see some problem in
it? It seems to be nice because now tg and tl look similar.


transtable_local
================

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)]
        Client         VID Flags    Last seen (CRC       )
    f2:f2:2d:c3:71:8c    0 [.P....]   0.000   (0xd56fb81f)
    f2:f2:2d:c3:71:8c   -1 [.P....]   0.000   (0x01d52e50)
    01:00:5e:00:00:01   -1 [.P....]   0.000   (0x01d52e50)
    33:33:ff:c3:71:8c   -1 [.P....]   0.000   (0x01d52e50)
    33:33:00:00:00:01   -1 [.P....]   0.000   (0x01d52e50)

debugfs
-------

    Locally retrieved addresses (from bat0) announced via TT (TTVN: 2):
           Client         VID Flags    Last seen (CRC       )
     * f2:f2:2d:c3:71:8c    0 [.P....]   0.000   (0xd56fb81f)
     * f2:f2:2d:c3:71:8c   -1 [.P....]   0.000   (0x01d52e50)
     * 01:00:5e:00:00:01   -1 [.P....]   0.000   (0x01d52e50)
     * 33:33:ff:c3:71:8c   -1 [.P....]   0.000   (0x01d52e50)
     * 33:33:00:00:00:01   -1 [.P....]   0.000   (0x01d52e50)




I personally think that the new common header is nice and should be kept. "No
..." lines could also be be dropped. The header to the originators should be
added again and I am not sure about the new format (but cannot say anything
bad about it because it follows the style used in other debugfs files).

@Simon, could this new originator format be problematic when there is
alternating/bonding?

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-05-03 10:30 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 [this message]
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=3771281.MWFGszot8n@bentobox \
    --to=sven.eckelmann@open-mesh.com \
    --cc=a@unstable.cc \
    --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