[Olsr-dev] JSON info dump complete

Henning Rogge (spam-protected)
Thu May 10 08:24:03 CEST 2012


On 05/10/2012 05:09 AM, Hans-Christoph Steiner wrote:
>
> Ok, I just finished tracking down all of the information that I thought
> might be at all useful.  Mostly, I dug thru the txtinfo and httpinfo
> plugins.  I pushed my changes, so they're in olsrd.git now.
>
> Attached is an example dump from the current jsoninfo plugin from a mesh
> of four nodes, which I made by running this:
>
> curl http://localhost:9090/status/config/plugins/>  all.json
>
> * /status gives all of the data of things that change during runtime
> * /config is the complete olsrd_config struct output as JSON
> * /plugins is the complete plugins info from olsrd_config
>
> I would love feedback on all of this.  I tried to use descriptive names
> for all of the JSON keys, please make sure I got them right.  Do the
> data types and structures make sense? etc.

Why is this kind of translation necessary:

abuf_json_float(abuf, "linkCost", 
atof(get_linkcost_text(my_link->linkcost, false, &lqbuffer2)));

You first convert the raw linkcost into text, then into float, then into 
text. Why not skip two conversions?

It might even be a good idea to add another field "rawLinkCost", which 
just includes the 32 bit unsigned integer. That is more easy to parse 
for a program.

What do you think ?

Henning Rogge

-- 
Diplom-Informatiker Henning Rogge , Fraunhofer-Institut für
Kommunikation, Informationsverarbeitung und Ergonomie FKIE
Kommunikationssysteme (KOM)
Neuenahrer Straße 20, 53343 Wachtberg, Germany
Telefon +49 228 9435-961,   Fax +49 228 9435 685
mailto:(spam-protected) http://www.fkie.fraunhofer.de
GPG: E1C6 0914 490B 3909 D944 F80D 4487 C67C 55EC CFE0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6156 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20120510/e5d03e80/attachment.bin>


More information about the Olsr-dev mailing list