|
发表于 2020-2-22 12:51:09
|
显示全部楼层
openwrt中设计路由器网段的方法,也是通过类似方法实现的吗?如下
switch (env[0]) {
/* Analyze the environment string. It is the script 'c' line starting */
/* at position 2. What you write to the script file is returned here. */
case 'a' :
/* Network parameters - file 'network.cgi' */
switch (env[2]) {
case 'i':
/* Write the local IP address. The format string is included */
/* in environment string of the script line. */
len = sprintf((char *)buf,(const char *)&env[4],LocM.IpAdr[0],
LocM.IpAdr[1],LocM.IpAdr[2],LocM.IpAdr[3]);
break; |
|