码迷,mamicode.com
首页 > 其他好文 > 详细

2017-9-6-luci Analysis

时间:2017-09-16 13:47:28      阅读:410      评论:0      收藏:0      [点我收藏+]

标签:cu2   cfa   import   py3   oat   image   dir   wix   vpc   

2017-9-6-luci Analysis

modules

  • luci.model.uci

  • luci.model.network

  • luci.util

  • luci.cbi

  • luci.template

  • ubus call network.interface.wan status

  1. { 
  2. "up": true, 
  3. "pending": false, 
  4. "available": true, 
  5. "autostart": true, 
  6. "uptime": 67646, 
  7. "l3_device": "pppoe-wan", 
  8. "proto": "pppoe", 
  9. "device": "eth0.2", 
  10. "updated": [ 
  11. "addresses", 
  12. "routes" 
  13. ], 
  14. "metric": 0, 
  15. "delegation": true, 
  16. "ipv4-address": [ 
  17. { 
  18. "address": "10.104.60.163", 
  19. "mask": 32 
  20. } 
  21. ], 
  22. "ipv6-address": [ 
  23.  
  24. ], 
  25. "ipv6-prefix": [ 
  26.  
  27. ], 
  28. "ipv6-prefix-assignment": [ 
  29.  
  30. ], 
  31. "route": [ 
  32. { 
  33. "target": "0.0.0.0", 
  34. "mask": 0, 
  35. "nexthop": "10.104.0.1", 
  36. "source": "0.0.0.0\/0" 
  37. } 
  38. ], 
  39. "dns-server": [ 
  40. "211.140.13.188", 
  41. "211.140.188.188" 
  42. ], 
  43. "dns-search": [ 
  44.  
  45. ], 
  46. "inactive": { 
  47. "ipv4-address": [ 
  48.  
  49. ], 
  50. "ipv6-address": [ 
  51.  
  52. ], 
  53. "route": [ 
  54.  
  55. ], 
  56. "dns-server": [ 
  57.  
  58. ], 
  59. "dns-search": [ 
  60.  
  61. ] 
  62. }, 
  63. "data": { 
  64.  
  65. } 
  66. } 
  67.  
  • ubus call network.device status
  1.  
  2. { 
  3. "br-lan": { 
  4. "external": false, 
  5. "present": true, 
  6. "type": "Bridge", 
  7. "up": true, 
  8. "carrier": true, 
  9. "bridge-members": [ 
  10. "eth0.1", 
  11. "ra0" 
  12. ], 
  13. "mtu": 1500, 
  14. "macaddr": "54:36:9b:1c:27:47", 
  15. "txqueuelen": 0, 
  16. "ipv6": true, 
  17. "statistics": { 
  18. "collisions": 0, 
  19. "rx_frame_errors": 0, 
  20. "tx_compressed": 0, 
  21. "multicast": 0, 
  22. "rx_length_errors": 0, 
  23. "tx_dropped": 0, 
  24. "rx_bytes": 479772195, 
  25. "rx_missed_errors": 0, 
  26. "tx_errors": 0, 
  27. "rx_compressed": 0, 
  28. "rx_over_errors": 0, 
  29. "tx_fifo_errors": 0, 
  30. "rx_crc_errors": 0, 
  31. "rx_packets": 1481931, 
  32. "tx_heartbeat_errors": 0, 
  33. "rx_dropped": 0, 
  34. "tx_aborted_errors": 0, 
  35. "tx_packets": 1976848, 
  36. "rx_errors": 0, 
  37. "tx_bytes": 2241546625, 
  38. "tx_window_errors": 0, 
  39. "rx_fifo_errors": 0, 
  40. "tx_carrier_errors": 0 
  41. } 
  42. }, 
  43. "eth0": { 
  44. "external": false, 
  45. "present": true, 
  46. "type": "Network device", 
  47. "up": true, 
  48. "carrier": true, 
  49. "mtu": 1500, 
  50. "macaddr": "54:36:9b:1c:27:47", 
  51. "txqueuelen": 1000, 
  52. "ipv6": true, 
  53. "statistics": { 
  54. "collisions": 0, 
  55. "rx_frame_errors": 0, 
  56. "tx_compressed": 0, 
  57. "multicast": 0, 
  58. "rx_length_errors": 0, 
  59. "tx_dropped": 0, 
  60. "rx_bytes": 2598313278, 
  61. "rx_missed_errors": 0, 
  62. "tx_errors": 0, 
  63. "rx_compressed": 0, 
  64. "rx_over_errors": 0, 
  65. "tx_fifo_errors": 0, 
  66. "rx_crc_errors": 0, 
  67. "rx_packets": 2998486, 
  68. "tx_heartbeat_errors": 0, 
  69. "rx_dropped": 0, 
  70. "tx_aborted_errors": 0, 
  71. "tx_packets": 2593532, 
  72. "rx_errors": 0, 
  73. "tx_bytes": 1846900606, 
  74. "tx_window_errors": 0, 
  75. "rx_fifo_errors": 0, 
  76. "tx_carrier_errors": 0 
  77. } 
  78. }, 
  79. "lo": { 
  80. "external": false, 
  81. "present": true, 
  82. "type": "Network device", 
  83. "up": true, 
  84. "carrier": true, 
  85. "mtu": 65536, 
  86. "macaddr": "00:00:00:00:00:00", 
  87. "txqueuelen": 0, 
  88. "ipv6": true, 
  89. "statistics": { 
  90. "collisions": 0, 
  91. "rx_frame_errors": 0, 
  92. "tx_compressed": 0, 
  93. "multicast": 0, 
  94. "rx_length_errors": 0, 
  95. "tx_dropped": 0, 
  96. "rx_bytes": 8805399, 
  97. "rx_missed_errors": 0, 
  98. "tx_errors": 0, 
  99. "rx_compressed": 0, 
  100. "rx_over_errors": 0, 
  101. "tx_fifo_errors": 0, 
  102. "rx_crc_errors": 0, 
  103. "rx_packets": 165986, 
  104. "tx_heartbeat_errors": 0, 
  105. "rx_dropped": 0, 
  106. "tx_aborted_errors": 0, 
  107. "tx_packets": 165986, 
  108. "rx_errors": 0, 
  109. "tx_bytes": 8805399, 
  110. "tx_window_errors": 0, 
  111. "rx_fifo_errors": 0, 
  112. "tx_carrier_errors": 0 
  113. } 
  114. }, 
  115. "pppoe-wan": { 
  116. "external": true, 
  117. "present": true, 
  118. "type": "Network device", 
  119. "up": true, 
  120. "carrier": true, 
  121. "statistics": { 
  122. "collisions": 0, 
  123. "rx_frame_errors": 0, 
  124. "tx_compressed": 0, 
  125. "multicast": 0, 
  126. "rx_length_errors": 0, 
  127. "tx_dropped": 0, 
  128. "rx_bytes": 2209323454, 
  129. "rx_missed_errors": 0, 
  130. "tx_errors": 0, 
  131. "rx_compressed": 0, 
  132. "rx_over_errors": 0, 
  133. "tx_fifo_errors": 0, 
  134. "rx_crc_errors": 0, 
  135. "rx_packets": 1986151, 
  136. "tx_heartbeat_errors": 0, 
  137. "rx_dropped": 0, 
  138. "tx_aborted_errors": 0, 
  139. "tx_packets": 1557905, 
  140. "rx_errors": 0, 
  141. "tx_bytes": 477192652, 
  142. "tx_window_errors": 0, 
  143. "rx_fifo_errors": 0, 
  144. "tx_carrier_errors": 0 
  145. } 
  146. }, 
  147. "ra0": { 
  148. "external": true, 
  149. "present": true, 
  150. "type": "Network device", 
  151. "up": true, 
  152. "carrier": true, 
  153. "ipv6": false, 
  154. "statistics": { 
  155. "collisions": 0, 
  156. "rx_frame_errors": 0, 
  157. "tx_compressed": 0, 
  158. "multicast": 5429, 
  159. "rx_length_errors": 0, 
  160. "tx_dropped": 0, 
  161. "rx_bytes": 222510556, 
  162. "rx_missed_errors": 0, 
  163. "tx_errors": 0, 
  164. "rx_compressed": 0, 
  165. "rx_over_errors": 0, 
  166. "tx_fifo_errors": 0, 
  167. "rx_crc_errors": 0, 
  168. "rx_packets": 1075574, 
  169. "tx_heartbeat_errors": 0, 
  170. "rx_dropped": 0, 
  171. "tx_aborted_errors": 0, 
  172. "tx_packets": 994141, 
  173. "rx_errors": 6, 
  174. "tx_bytes": 903091445, 
  175. "tx_window_errors": 0, 
  176. "rx_fifo_errors": 0, 
  177. "tx_carrier_errors": 0 
  178. } 
  179. } 
  180. } 
  181.  

luci.cbi

widget

  • SimpleForm
  • ListValue
  • Value and Value.widget = “radio”, Value.template=“cbi/network_ifacelist”
  • Value and Value.widget = “checkbox”, Value.templae=
  • DummyValue
技术分享

luci.model.network

API

技术分享
技术分享
技术分享
  1. "network": { 
  2. "wan": { 
  3. "ifname": "eth0.4090", 
  4. "proto": "static" 
  5. "ipaddr": "192.168.2.1" 
  6. "netmask": "255.255.255.0" 
  7. "gateway": "192.168.254.254" 
  8. "username": "oakridge" 
  9. "password": "oakridge" 
  10. }, 
  11. "lan4092": { 
  12. "ifname": "eth0.4092", 
  13. "protocol": "static" 
  14. }, 
  15. "lan4093": { 
  16. "ifname": "eth0.4093", 
  17. "protocol": "static" 
  18. }, 
  19. "lan4094": { 
  20. "ifname": "eth0.4094", 
  21. "protocol": "static" 
  22. }, 
  23. "wan4090": { 
  24. "ifname": "eth1", 
  25. "protocol": "none" 
  26. }, 
  27. "wan": { 
  28. "ifname": "eth0.4090", 
  29. "protocol": "dhcp", 
  30. "macaddr": "f0:9f:c2:6d:24:7f" 
  31. } 
  32. } 

WebUI Process

技术分享

nicephil@gmail.com 2017-9-6

2017-9-6-luci Analysis

标签:cu2   cfa   import   py3   oat   image   dir   wix   vpc   

原文地址:http://www.cnblogs.com/nicephil/p/7530676.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!