I'm attaching a new version of the patch.

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

Index: files/lib/network/wing.sh
===================================================================
--- files/lib/network/wing.sh    (revision 27241)
+++ files/lib/network/wing.sh    (working copy)
@@ -49,6 +49,7 @@

     local hwaddr=$(echo $hwaddrs | sed 's/ .*//');
local ipaddr=$(printf "$prefix.%d.%d.%d" $(echo $hwaddr | awk -F: '{printf "0x%s 0x%s 0x%s",$4,$5,$6}'))
+    local bcast="$prefix.255.255.255"
     local netmask=255.0.0.0

     if ! wing_template_available "profile" "$profile"; then
@@ -77,6 +78,7 @@
         -m "$hwmodes" -c "$freqs" -n "$ifnames" -a "$hwaddrs" $dbg \
         | sed -e "s/__XR_IFNAME__/$iface/g" \
         | sed -e "s/__XR_IP__/$ipaddr/g" \
+        | sed -e "s/__XR_BCAST__/$bcast/g" \
         | sed -e "s/__XR_NM__/$netmask/g" \
         | sed -e "s/__XR_PERIOD__/$period/g" \
         | sed -e "s/__XR_TAU__/$tau/g" > /tmp/$iface.click
@@ -104,9 +106,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: files/usr/bin/wing_status
===================================================================
--- files/usr/bin/wing_status    (revision 0)
+++ 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: files/usr/bin/wing_status
___________________________________________________________________
Added: svn:executable
   + *

Index: files/etc/uci-defaults/wing
===================================================================
--- files/etc/uci-defaults/wing    (revision 27241)
+++ files/etc/uci-defaults/wing    (working copy)
@@ -1,6 +1,6 @@
+uci delete network.mesh
 uci set network.mesh=interface
 uci set network.mesh.proto=wing
-uci set network.mesh.profile=bulk
 uci set network.mesh.rc=minstrel
 uci set network.mesh.ls=fcfs
 uci set network.mesh.metric=wcett
@@ -9,18 +9,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: Makefile
===================================================================
--- Makefile    (revision 27241)
+++ 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:=20110618
+PKG_RELEASE:=1
+PKG_REV:=1b0e2be758af5b2e1bc4e2494f4deb8090be756d

 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=git://github.com/rriggio/click.git
@@ -66,8 +66,9 @@
     (cd $(PKG_BUILD_DIR)/userlevel; \
$(STAGING_DIR_HOST)/bin/click-mkmindriver -p $(PKG_NAME) -C $(STAGING_DIR_HOST) \
         -f $(PKG_BUILD_DIR)/conf/wing/sample.click \
-        -A --all -E Discard -E Print -E PrintWifi -E Null \
+        -A --all -E Discard -E Print -E PrintWifi -E Strip -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