public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Cc: Janne Paatero <janne.paatero@ruag.com>
Subject: Re: [B.A.T.M.A.N.] Alfred batadv-vis json conformance
Date: Wed, 2 Oct 2013 15:36:00 +0200	[thread overview]
Message-ID: <20131002133600.GD16339@lunn.ch> (raw)
In-Reply-To: <20131002130548.GA24077@pandem0nium>

On Wed, Oct 02, 2013 at 03:05:48PM +0200, Simon Wunderlich wrote:
> Hey Andrew,
> 
> On Tue, Oct 01, 2013 at 10:26:48PM +0200, Andrew Lunn wrote:
> > Hi Folks
> > 
> > I will soon need to parse the output of batadv-vis -f json.  However,
> > its not really, json, it does not pass json validation tools. Hence i
> > doubt i can use the standard parsing libraries.
> 
> Yes, it is only JSON line-wise, but not the whole output. This output format
> however is the same as we have/had in the batctl JSON output which comes
> from the kernel (I think that was your contribution in the first place?).
> 
> Therefore I'd like to leave this old format as it is to allow communities
> to seamlessly switch from batctl json vis to alfred-vis.

Hi Simon

That is what i was expecting. So when i did the first implementation
this morning, i added a new format, cjson, for conforming json. Not
the best of names, but i could not think of anything better.

> I don't want to "parse" any transferred data in alfred, but we can do this
> for tools like alfred-vis 

No parsing needed, its just needs new functions to print it. RFC patch
to come soon.

> >   { "primary" : "02:00:00:00:13:01",
> >     "secondary" : [ 
> >       "02:00:00:30:13:01"
> >     ],
> >     "neighbors" : [
> >        { "router" : "02:00:00:00:13:01", "neighbor" : "02:00:00:00:10:01", "label" : "1.000" },
> >        { "router" : "02:00:00:00:13:01", "neighbor" : "02:00:00:00:12:01", "label" : "1.000" },
> >        { "router" : "02:00:00:30:13:01", "neighbor" : "02:00:00:30:10:01", "label" : "1.016" },
> >        { "router" : "02:00:00:00:13:01", "neighbor" : "02:00:00:00:11:01", "label" : "1.000" }
> >     ],
> >     "TT" : [
> >        { "router" : "02:00:00:00:13:01", "gateway" : "8e:4c:77:b3:65:b4" }
> >     ]
> >   }
> > ]
> > 
> > I'm also wondering if label and gateway could have more meaningful
> > names? TQ and host? Also, is TT the best?
> 
> Hm, that is a good question. We also have the batman v with new metrics
> coming up,

I've not been following BATMAN V too well. Is it metric, or metrics?
Can we simply change label to metric?

> Maybe we can change the names to:
>  * for neighbors: router->nexthop
>  * TT: "gateway" -> "client", "router" -> "node", maybe also change TT to clients?

So here is what i have implemented.

# batadv-vis -f cjson 
[
  { "primary" : "02:00:00:00:12:01",
    "neighbors" : [
       { "router" : "02:00:00:00:12:01",
         "neighbor" : "02:00:00:00:10:01",
         "metric" : "1.000" },
       { "router" : "02:00:00:00:12:01",
         "neighbor" : "02:00:00:00:13:01",
         "metric" : "1.012" },
       { "router" : "02:00:00:00:12:01",
         "neighbor" : "02:00:00:00:11:01",
         "metric" : "1.000" }
    ],
    "clients" : [
       { "node" : "02:00:00:00:12:01",
         "client" : "8e:4c:88:c4:76:c5" }
    ]
  }
]

	Andrew

  reply	other threads:[~2013-10-02 13:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-01 20:26 [B.A.T.M.A.N.] Alfred batadv-vis json conformance Andrew Lunn
2013-10-02 13:05 ` Simon Wunderlich
2013-10-02 13:36   ` Andrew Lunn [this message]
2013-10-06  8:35     ` Nicolás Echániz
2013-10-07  9:00       ` Andrew Lunn
2013-10-02 16:01   ` Antonio Quartulli
2013-10-03  6:09     ` Martin Hundebøll
2013-10-03  8:11       ` Andrew Lunn
2013-10-03  8:22         ` Antonio Quartulli
2013-10-03  8:53           ` Andrew Lunn
2013-10-03  9:00             ` Antonio Quartulli
2013-10-03  9:05               ` 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=20131002133600.GD16339@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=janne.paatero@ruag.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