openwrt中一些与网络有关的脚本

/lib/network/config.sh
/lib/network/ppp.sh
/lib/network/pppoe.sh
/lib/network/switch.sh
该脚本内部定义有如下函数
setup_switch() {
        _vlan_pvid_set=0
        config_load network   // config_load的定义在什么地方?
        config_foreach setup_switch_hw switch
        config_foreach setup_switch_vlan switch_vlan
}


/etc/rc.d/K90network
/etc/rc.d/S40network
/etc/config/network  网络配置文件
/etc/init.d/network
修改网络配置之后,可以通过该脚本使配置生效,具体 调用命令可以是/etc/init.d/network restart
脚本中有如下代码,为何要对setup_switch进行两次定义呢,因为在/lib/network/switch中也定义有setup_switch()
setup_switch() { return 0; }
include /lib/network
setup_switch

/usr/lib/lua/luci/controller/admin/network.lua
/usr/lib/lua/luci/model/cbi/admin_network
/usr/lib/lua/luci/model/cbi/admin_network/dhcpleases.lua
/usr/lib/lua/luci/model/cbi/admin_network/hosts.lua
/usr/lib/lua/luci/model/cbi/admin_network/iface_add.lua
/usr/lib/lua/luci/model/cbi/admin_network/ifaces.lua
/usr/lib/lua/luci/model/cbi/admin_network/network.lua
/usr/lib/lua/luci/model/cbi/admin_network/routes.lua
/usr/lib/lua/luci/model/cbi/admin_network/vlan.lua
/usr/lib/lua/luci/model/cbi/admin_network/wifi.lua
/usr/lib/lua/luci/model/cbi/admin_network/wifi_add.lua
/usr/lib/lua/luci/model/cbi/admin_network/wireless.lua
/usr/lib/lua/luci/model/cbi/luci_statistics/network.lua
/usr/lib/lua/luci/model/network.lua
/usr/lib/lua/luci/view/admin_network
/usr/lib/lua/luci/view/admin_network/diagnostics.htm
/usr/lib/lua/luci/view/admin_network/iface_overview.htm
/usr/lib/lua/luci/view/admin_network/iface_status.htm
/usr/lib/lua/luci/view/admin_network/lease_status.htm
/usr/lib/lua/luci/view/admin_network/wifi_join.htm
/usr/lib/lua/luci/view/admin_network/wifi_overview.htm
/usr/lib/lua/luci/view/admin_network/wifi_status.htm
/usr/lib/lua/luci/view/admin_statistics/networkplugins.htm
/usr/lib/lua/luci/view/cbi/network_ifacelist.htm
/usr/lib/lua/luci/view/cbi/network_netinfo.htm
/usr/lib/lua/luci/view/cbi/network_netlist.htm
/usr/lib/lua/luci/view/diag/network_config_index.htm



你可能感兴趣的:(网络,脚本,NetWork,include)