This patch updates the Wing package to the latest Git version
which includes several bug fixes. The patch adds also a script
wing_status which can be used to dump some information about
the routing daemon (links, routes, statistics about the probes, etc.)

Signed-off-by: Roberto Riggio<roberto.rig...@create-net.org>

--
Index: net/wing/files/lib/network/wing.sh
===================================================================
--- net/wing/files/lib/network/wing.sh  (revision 26910)
+++ net/wing/files/lib/network/wing.sh  (working copy)
@@ -104,9 +104,13 @@

        ps | grep /usr/bin/click | grep -v grep | awk '{print $1}'>  
/var/run/$iface.pid

-       ifconfig "$iface" "$ipaddr" netmask "$netmask"
+       ifconfig "$iface" "$ipaddr" netmask "$netmask"
+       route add default dev "$iface"
+
+       uci_set_state network $config ifname "$iface"
        uci_set_state network $config ipaddr "$ipaddr"
        uci_set_state network $config netmask "$netmask"
+       uci_set_state network $config gateway "0.0.0.0"

        env -i ACTION="ifup" INTERFACE="$config" DEVICE="$iface" PROTO=wing 
/sbin/hotplug-call "iface"&

Index: net/wing/files/usr/bin/wing_status
===================================================================
--- net/wing/files/usr/bin/wing_status  (revision 0)
+++ net/wing/files/usr/bin/wing_status  (revision 0)
@@ -0,0 +1,124 @@
+#!/bin/sh
+
+# Copyright (c) 2006, Roberto Riggio
+#
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   - Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   - Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   - Neither the name of the CREATE-NET nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ROUTES=0
+STATIC=0
+HOSTS=0
+LINKS=0
+ARP=0
+GATEWAY=0
+PROBES=0
+
+show_status() {
+
+       [ $ROUTES = 1 ]&&  {
+               printf "Routes:\n"
+               write_handler lt.dijkstra true
+               read_handler lt.routes
+       }
+
+       [ $STATIC = 1 ]&&  {
+               printf "\nStatic Routes:\n"
+               read_handler wr/querier.static_routes
+       }
+
+       [ $HOSTS = 1 ]&&  {
+               printf "\nIP:\n"
+               read_handler lt.ip
+               printf "\nHosts:\n"
+               read_handler lt.hosts
+       }
+
+       [ $LINKS = 1 ]&&  {
+               printf "\nLinks:\n"
+               read_handler lt.links
+       }
+
+       [ $ARP = 1 ]&&  {
+               printf "\nARP Table:\n"
+               read_handler arp.table
+       }
+
+       [ $GATEWAY = 1 ]&&  {
+               printf "\nBest gateway:\n"
+               read_handler wr/set_gateway.gateway
+               printf "\nGateways:\n"
+               read_handler wr/gw.gateway_stats
+               printf "\nHNAs:\n"
+               read_handler wr/gw.hnas
+       }
+
+       [ $PROBES = 1 ]&&  {
+               interfaces=$(read_handler lt.interfaces)
+               for interface in $interfaces; do
+                       printf "\nBroadcast statistics ($interface):\n"
+                       read_handler wr/es/es_$interface.bcast_stats
+               done
+       }
+
+       exit 0
+
+}
+
+if [ $# -eq 0 ]; then
+       ROUTES=1
+       STATIC=1
+       HOSTS=1
+       LINKS=1
+       ARP=1
+       GATEWAY=1
+       PROBES=1
+fi
+
+while getopts "rshlagp" OPTVAL
+do
+       case $OPTVAL in
+       r) ROUTES=1
+         ;;
+       r) STATIC=1
+         ;;
+       h) HOSTS=1
+         ;;
+       l) LINKS=1
+         ;;
+       a) ARP=1
+         ;;
+       g) GATEWAY=1
+         ;;
+       p) PROBES=1
+         ;;
+       *) ROUTES=1; STATIC=1; HOSTS=1; LINKS=1; ARP=1; GATEWAY=1; PROBES=1
+         ;;
+       esac
+done
+
+show_status

Property changes on: net/wing/files/usr/bin/wing_status
___________________________________________________________________
Added: svn:executable
   + *

Index: net/wing/files/etc/uci-defaults/wing
===================================================================
--- net/wing/files/etc/uci-defaults/wing        (revision 26910)
+++ net/wing/files/etc/uci-defaults/wing        (working copy)
@@ -1,3 +1,4 @@
+uci delete network.mesh
 uci set network.mesh=interface
 uci set network.mesh.proto=wing
 uci set network.mesh.profile=bulk
@@ -9,18 +10,18 @@
 uci set network.mesh.tau=100000
 uci set network.mesh.debug=false

-cfg=$(uci add firewall zone)
-uci set firewall.$cfg.name="mesh"
-uci set firewall.$cfg.input="ACCEPT"
-uci set firewall.$cfg.output="ACCEPT"
-uci set firewall.$cfg.forward="REJECT"
-uci set firewall.$cfg.masq="1"
+uci add firewall zone
+uci set firewall.@zone[-1].name="mesh"
+uci set firewall.@zone[-1].input="ACCEPT"
+uci set firewall.@zone[-1].output="ACCEPT"
+uci set firewall.@zone[-1].forward="REJECT"
+uci set firewall.@zone[-1].masq="1"

-cfg=$(uci add firewall forwarding)
-uci set firewall.$cfg.src="lan"
-uci set firewall.$cfg.dest="mesh"
+uci add firewall forwarding
+uci set firewall.@forwarding[-1].src="lan"
+uci set firewall.@forwarding[-1].dest="mesh"

-cfg=$(uci add firewall forwarding)
-uci set firewall.$cfg.src="mesh"
-uci set firewall.$cfg.dest="wan"
+uci add firewall forwarding
+uci set firewall.@forwarding[-1].src="mesh"
+uci set firewall.@forwarding[-1].dest="wan"

Index: net/wing/Makefile
===================================================================
--- net/wing/Makefile   (revision 26910)
+++ net/wing/Makefile   (working copy)
@@ -8,9 +8,9 @@
 include $(TOPDIR)/rules.mk

 PKG_NAME:=wing
-PKG_VERSION:=20110329
-PKG_RELEASE:=2
-PKG_REV:=4ef2a352b29c26ce76d8b3d7c6897d301362a101
+PKG_VERSION:=20110516
+PKG_RELEASE:=1
+PKG_REV:=1d83b36008778157e3d8da05de33d6601298aebe

 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=git://github.com/rriggio/click.git
@@ -68,6 +68,7 @@
                -f $(PKG_BUILD_DIR)/conf/wing/sample.click \
                -A --all -E Discard -E Print -E PrintWifi -E Null \
                -E InfiniteSource -E RatedSource -E EtherEncap -E UDPIPEncap \
+               -E RadiotapEncapHT -E SetTXRateHT \
                -E WINGETTMetric -E WINGETXMetric -E WINGHopCountMetric \
                -E ProbeTXRate -E MadwifiRate -E AutoRateFallback -E Minstrel \
                -E FairBuffer -E DeAggregator -E DWRRSched -E WFQSched -E 
WRRSched; \

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to