today I've written a proof-of-concept for
getting rid of oldstyle networking aka 'ifconfig'.

The approach is to to have an function ifconfig()
in /etc/functions.sh, which is included in all
startup-scripts anyway, and if there is an /usr/sbin/ip,
translate old_style to new_style...

Next steps, before delivering a patch, is to test
some 'complex' setups and cleanup the code and also
translate 'route' to 'ip route' and 'arp' to 'ip neigh'.

bye, Bastian Bittorf

this is the bootlog of on r16356 without 'ifconfig':

up12s '/sbin/hotplug-call' calls 'ifconfig lo' -> '/etc/ip2ifconfig_wrapper.sh 
lo' (show_specific_dev)
up13s '/sbin/hotplug-call' calls 'ifconfig lo 0.0.0.0' -> 'ip address add 
0.0.0.0 dev lo'
up13s '/sbin/hotplug-call' calls 'ifconfig lo' -> '/etc/ip2ifconfig_wrapper.sh 
lo' (show_specific_dev)
up13s '/sbin/hotplug-call' calls 'ifconfig lo up' -> 'ip link set dev lo up'
up14s '/sbin/hotplug-call' calls 'ifconfig lo 127.0.0.1 netmask 255.0.0.0 
broadcast +' -> 'ip address add 127.0.0.1/8 broadcast + dev lo'
up14s '/sbin/hotplug-call' calls 'ifconfig' -> '/etc/ip2ifconfig_wrapper.sh' 
(show_all_devs)
up16s '/sbin/hotplug-call' calls 'ifconfig eth0.0' -> error (not in 
/proc/net/dev)
up16s '/sbin/hotplug-call' calls 'ifconfig eth0 up' -> 'ip link set dev eth0 up'
up16s '/sbin/hotplug-call' calls 'ifconfig eth0.1' -> error (not in 
/proc/net/dev)
up16s '/sbin/hotplug-call' calls 'ifconfig eth0 up' -> 'ip link set dev eth0 up'
up17s '/sbin/hotplug-call' calls 'ifconfig eth0.0' -> 
'/etc/ip2ifconfig_wrapper.sh eth0.0' (show_specific_dev)
up18s '/sbin/hotplug-call' calls 'ifconfig eth0.0 0.0.0.0' -> 'ip address add 
0.0.0.0 dev eth0.0'
up18s '/sbin/hotplug-call' calls 'ifconfig eth0.0' -> 
'/etc/ip2ifconfig_wrapper.sh eth0.0' (show_specific_dev)
up19s '/sbin/hotplug-call' calls 'ifconfig eth0.0' -> 
'/etc/ip2ifconfig_wrapper.sh eth0.0' (show_specific_dev)
up20s '/sbin/hotplug-call' calls 'ifconfig br-lan' -> error (not in 
/proc/net/dev)
up20s '/sbin/hotplug-call' calls 'ifconfig br-lan up' -> 'ip link set dev 
br-lan up'
up20s '/sbin/hotplug-call' calls 'ifconfig eth0.0 up' -> 'ip link set dev 
eth0.0 up'
up21s '/sbin/hotplug-call' calls 'ifconfig eth0.1' -> 
'/etc/ip2ifconfig_wrapper.sh eth0.1' (show_specific_dev)
up22s '/sbin/hotplug-call' calls 'ifconfig eth0.1 0.0.0.0' -> 'ip address add 
0.0.0.0 dev eth0.1'
up22s '/sbin/hotplug-call' calls 'ifconfig eth0.1' -> 
'/etc/ip2ifconfig_wrapper.sh eth0.1' (show_specific_dev)
up23s '/sbin/hotplug-call' calls 'ifconfig eth0.1' -> 
'/etc/ip2ifconfig_wrapper.sh eth0.1' (show_specific_dev)
up24s '/sbin/hotplug-call' calls 'ifconfig eth0.1 up' -> 'ip link set dev 
eth0.1 up'
up25s '/sbin/hotplug-call' calls 'ifconfig' -> '/etc/ip2ifconfig_wrapper.sh' 
(show_all_devs)
up26s '/usr/share/udhcpc/default.script' calls 'ifconfig eth0.1 0.0.0.0' -> 'ip 
address add 0.0.0.0 dev eth0.1'
up31s '/sbin/hotplug-call' calls 'ifconfig br-lan up' -> 'ip link set dev 
br-lan up'
up31s '/sbin/wifi' calls 'ifconfig' -> '/etc/ip2ifconfig_wrapper.sh' 
(show_all_devs)
up32s '/sbin/hotplug-call' calls 'ifconfig br-lan up' -> 'ip link set dev 
br-lan up'
up32s '/sbin/hotplug-call' calls 'ifconfig br-lan 192.168.1.28 netmask 
255.255.255.0 broadcast +' -> 'ip address add 192.168.1.28/24 broadcast + dev 
br-lan'
up33s '/sbin/hotplug-call' calls 'ifconfig' -> '/etc/ip2ifconfig_wrapper.sh' 
(show_all_devs)
up37s '/sbin/wifi' calls 'ifconfig wlan0 up' -> 'ip link set dev wlan0 up'
up39s '/sbin/wifi' calls 'ifconfig wlan0' -> '/etc/ip2ifconfig_wrapper.sh 
wlan0' (show_specific_dev)
up39s '/sbin/wifi' calls 'ifconfig wlan0 0.0.0.0' -> 'ip address add 0.0.0.0 
dev wlan0'
up40s '/sbin/wifi' calls 'ifconfig wlan0' -> '/etc/ip2ifconfig_wrapper.sh 
wlan0' (show_specific_dev)
up40s '/sbin/wifi' calls 'ifconfig br-lan' -> '/etc/ip2ifconfig_wrapper.sh 
br-lan' (show_specific_dev)
up41s '/sbin/wifi' calls 'ifconfig wlan0 up' -> 'ip link set dev wlan0 up'


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

Reply via email to