<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>netring</title><revhistory><revision><revnumber>1</revnumber><date>2012-04-30 21:20:43</date><authorinitials>2001:1418:1a9:eeab:218:f3ff:fe87:9494</authorinitials></revision></revhistory></articleinfo><section><title>The Problem</title><para>Actually each community network do a lot of duplicated work to develop/maintain/manage their monitoring/managing systems </para></section><section><title>The Idea</title><para>Join forces to develop a common code base for ours map servers. </para><para>Very different community networks have, many differents needs, but very tiny core of common needs is still present. </para></section><section><title>Step 1</title><para>Find What is really common, for example </para><para>Can we assume on every community network: </para><para>Each node have one or more device?        Yes core for me </para><para>Each device can belong just to one node?  Yes core for me </para><para>Each device have one or more neighbor ( that can belong to the same or to a different node ) attached by a link? Yes core for me </para><para>Each link can be characterized by different values ( for example in Pisa we have TQ, but in Rome they have dBm and  ETX )so here i think we can assume as common part that the link may exist or not and do &quot;quality measurement&quot; an extension  &lt;- Not core for me </para><para>and so on </para><para>so we can define a set of property i suggest in a json like sintax that all node and devices have so for example </para><para>node.status={active, potencial} </para><para>node.readeableName=&quot;Pisa::Eigenlab&quot; </para><para>node.slug=&quot;eigenlab&quot; </para><para>. </para><para>. </para><para>. </para><para>device.father=&quot;&quot;       &lt;- node sluf or id or something like that goes here </para><para>device.reachMeAt=&quot;&quot;    &lt;- something that permit to reach the device, can be for example one or more of eigenlab.n.ninux.org, 2001:1418:1a9:eeab:0:15:6dfd:71ce, 00:15:6d:fc:71:ce </para><para>device.neigh=&quot;&quot;        &lt;- things like   00:15:6d:7c:09:9e, pacinotti.n.ninux.org, 2001:1418:1a9:eeab:0:15:6d7d:99e </para><para>and so on </para></section><section><title>Step 2</title><para>Wow it is just the core but there are already a lot of information i have to put all of this manually <inlinemediaobject><imageobject><imagedata depth="16" fileref="http://ninux.org//moin_static197/ninuxtheme02/img/sad.png" width="16"/></imageobject><textobject><phrase>:(</phrase></textobject></inlinemediaobject> ?   No we have to do that more automatic possible, so we should put on netRing just device.reachMeAt more an userid+pass or an ssh authorized key or stuf like that so netRing can suck by himself all that stuff </para><para>But how netRing know how to do that ?? Go to step 4 if you cannot wait <inlinemediaobject><imageobject><imagedata depth="16" fileref="http://ninux.org//moin_static197/ninuxtheme02/img/smile4.png" width="16"/></imageobject><textobject><phrase>;)</phrase></textobject></inlinemediaobject> </para></section><section><title>Step 3</title><para>Each community can define one or more extension property that some of their nodes/devices may have for example someone can be interested in what clients are connected to their node or how much traffic the node routed </para></section><section><title>Step 4</title><para>We have to add supply a &quot;template file&quot; that explain to netRing ( obviously nerRing have to understand that language ) how to do that and it could be somethings like that </para><screen><![CDATA[<template name="UBNT_PICO_OWRT_EGN" description="Picostation M* OpenWrt + eigenNet template">
        <property name="reachMeAt" coreId="device.reachMeAt" get="manual" />
        <property name="user" coreId="device.auth.user" get="manual" />
        <property name="user" extId="device.auth.passwd" get="manual" />
        <property name="user" extId="device.auth.sshAuthKey" get="manual" />
        <property name="accept_clients" extId="uci.eigennet.network.accept_clients">
                <description>
                        1 if the device accept clients.
                        0 if the device is a pure node ( doesn't accept ethernet and wireless clients )
                </description>
                <method name="get">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} '
                                . /etc/functions.sh
                                config_load eigennet
                                local accept_clients
                                config_get_bool accept_clients network "accept_clients" 1
                                echo $accept_clients
                                '
                        ?>
                </method>
                <method name="set">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} "uci set eigennet.network.accept_clients=$1"
                        ?>
                </method>
        </property>
        <property name="wifi_clients" extId="uci.eigennet.network.wifi_clients">
                <description>
                        1 if the device is accepting wireless clients
                        0 otherwise
                </description>
                <method name="get">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} '
                                . /etc/functions.sh
                                config_load eigennet
                                local wifi_clients
                                config_get_bool wifi_clients network "wifi_clients" 1
                                echo $wifi_clients
                                '
                        ?>
                </method>
                <method name="set">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} "uci set eigennet.network.wifi_clients=$1"
                        ?>
                </method>
        </property>
        <property name="meshSSID" extId="uci.eigennet.wireless.meshSSID">
                <description>
                        Broadcasted SSID on wireless mesh interfaces
                </description>
                <method name="get">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} '
                                . /etc/functions.sh
                                config_load eigennet
                                local meshSSID
                                config_get meshSSID wireless "meshSSID"
                                echo $meshSSID
                                '
                        ?>
                </method>
                <method name="set">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} "uci set eigennet.wireless.meshSSID=$1"
                        ?>
                </method>
        </property>
        <property name="meshChannel" extId="uci.eigennet.wireless.meshChannel">
                <description>
                        Wireless mesh channel
                </description>
                <method name="get">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} '
                                . /etc/functions.sh
                                config_load eigennet
                                local meshChannel
                                config_get meshChannel wireless "meshChannel"
                                echo $meshChannel
                                '
                        ?>
                </method>
                <method name="set">
                        <?bash
                                #!/bin/bash
                                ssh_shot ${device.reachMeAt} "uci set eigennet.wireless.meshSSID=$1"
                        ?>
                </method>
        </property>
        <property name="clientsMacList" extId="batman-adv.tl">
                <method name="get">
                <?bash
                        #!/bin/bash
                        ssh_shot ${device.reachMeAt} "batctl tl" | tail -n +2 bat | grep --only-matching -i '[0-9A-F]\{2\}\(:[0-9A-F]\{2\}\)\{5\}'
                ?>
                </method>
        </property>
        <method name="apply">
                <?bash
                        #!/bin/bash
                        ssh_shot ${device.reachMeAt} "
                        cp -r /etc/config /etc/config.back
                        uci set eigennet.bootmode=4
                        /etc/init.d/eigennet restart"
                ?>
        </method>
        <method name="test">
                <method name="apply">
                <?bash
                        #!/bin/bash
                        ssh_shot ${device.reachMeAt} "
                        uci set eigennet.bootmode=1
                        /etc/init.d/eigennet restart"
                ?>
        </method>
</template>]]></screen></section></article>