2 # Copyright (C) 2011 OpenWrt.org
4 ucidef_set_interface_loopback
() {
6 set network.loopback='interface'
7 set network.loopback.ifname='lo'
8 set network.loopback.proto='static'
9 set network.loopback.ipaddr='127.0.0.1'
10 set network.loopback.netmask='255.0.0.0'
14 ucidef_set_interface_raw
() {
19 set network.$cfg='interface'
20 set network.$cfg.ifname='$ifname'
21 set network.$cfg.proto='none'
25 ucidef_set_interface_lan
() {
29 set network.lan='interface'
30 set network.lan.ifname='$ifname'
31 set network.lan.type='bridge'
32 set network.lan.proto='static'
33 set network.lan.ipaddr='192.168.1.1'
34 set network.lan.netmask='255.255.255.0'
38 ucidef_set_interface_wan
() {
42 set network.wan='interface'
43 set network.wan.ifname='$ifname'
44 set network.wan.proto='dhcp'
48 ucidef_set_interfaces_lan_wan
() {
52 ucidef_set_interface_lan
"$lan_ifname"
53 ucidef_set_interface_wan
"$wan_ifname"
56 ucidef_set_interface_macaddr
() {
61 set network.$ifname.macaddr='$mac'
71 set network.@switch[-1].name='$name'
72 set network.@switch[-1].reset='$reset'
73 set network.@switch[-1].enable_vlan='$enable'
77 ucidef_add_switch_vlan
() {
82 add network switch_vlan
83 set network.@switch_vlan[-1].device='$device'
84 set network.@switch_vlan[-1].vlan='$vlan'
85 set network.@switch_vlan[-1].ports='$ports'