On 05/30/2012 04:09 PM, Felix Fietkau wrote:
Do you have any call to proto_init_update/proto_send_update in there,
similar to what the dhcp script does when it has acquired a lease?

Hi, thanks for the feedback. I'm making some progresses now. This is the current script:

#!/bin/sh

[ -n "$INCLUDE_ONLY" ] || {
        . /etc/functions.sh
        . ../netifd-proto.sh
        init_proto "$@"
}

proto_wing_init_config() {
        no_device=1
        available=1
        proto_config_add_string "ipaddr"
}

proto_wing_teardown() {
        local config="$1"
        local link="wing-$config"
        [ -f "/var/run/$link.pid" ] && {
                kill -9 $(cat /var/run/$link.pid)
                rm /var/run/$link.pid
        }
}

proto_wing_setup() {

        local config="$1"
        local link="wing-$config"

# here I start the routing daemon which creates a TUN interface called $link

        proto_init_update "$link" 1
        proto_add_ipv4_address "$ipaddr" "$netmasj"

        route -n | grep -q '^0.0.0.0' || {
                proto_add_ipv4_route "0.0.0.0" 0
        }
        
        proto_send_update "$config"

}

[ -n "$INCLUDE_ONLY" ] || {
        add_protocol wing
}

I have one major problem. The mesh works correctly if I call ifup mesh AFTER the boot. The problem is that at bootstrap openwrt tries to bring this interface up before the wifi. Is there a way to tell openwrt to bring this interface up after wifi (or after all the other interface are up)

Could you explain briefly when to use the following constructs:

- no_device=1, this should be for case where the device is created at run time like a tunnel or my mesh protocol

- available=1 ???

- proto_config_add_ ???

- json_get_var / json_add

Thanks
R.


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to