码迷,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. "up": true
  2. "pending": false
  3. "available": true
  4. "autostart": true
  5. "uptime": 67646
  6. "l3_device": "pppoe-wan"
  7. "proto": "pppoe"
  8. "device": "eth0.2"
  9. "updated": [ 
  10. "addresses"
  11. "routes" 
  12. ], 
  13. "metric": 0
  14. "delegation": true
  15. "ipv4-address": [ 

  16. "address": "10.104.60.163"
  17. "mask": 32 

  18. ], 
  19. "ipv6-address": [ 
  20.  
  21. ], 
  22. "ipv6-prefix": [ 
  23.  
  24. ], 
  25. "ipv6-prefix-assignment": [ 
  26.  
  27. ], 
  28. "route": [ 

  29. "target": "0.0.0.0"
  30. "mask": 0
  31. "nexthop": "10.104.0.1"
  32. "source": "0.0.0.0\/0" 

  33. ], 
  34. "dns-server": [ 
  35. "211.140.13.188"
  36. "211.140.188.188" 
  37. ], 
  38. "dns-search": [ 
  39.  
  40. ], 
  41. "inactive": { 
  42. "ipv4-address": [ 
  43.  
  44. ], 
  45. "ipv6-address": [ 
  46.  
  47. ], 
  48. "route": [ 
  49.  
  50. ], 
  51. "dns-server": [ 
  52.  
  53. ], 
  54. "dns-search": [ 
  55.  

  56. }, 
  57. "data": { 
  58.  


  59.  
  • ubus call network.device status
  1.  

  2. "br-lan": { 
  3. "external": false
  4. "present": true
  5. "type": "Bridge"
  6. "up": true
  7. "carrier": true
  8. "bridge-members": [ 
  9. "eth0.1"
  10. "ra0" 
  11. ], 
  12. "mtu": 1500
  13. "macaddr": "54:36:9b:1c:27:47"
  14. "txqueuelen": 0
  15. "ipv6": true
  16. "statistics": { 
  17. "collisions": 0
  18. "rx_frame_errors": 0
  19. "tx_compressed": 0
  20. "multicast": 0
  21. "rx_length_errors": 0
  22. "tx_dropped": 0
  23. "rx_bytes": 479772195
  24. "rx_missed_errors": 0
  25. "tx_errors": 0
  26. "rx_compressed": 0
  27. "rx_over_errors": 0
  28. "tx_fifo_errors": 0
  29. "rx_crc_errors": 0
  30. "rx_packets": 1481931
  31. "tx_heartbeat_errors": 0
  32. "rx_dropped": 0
  33. "tx_aborted_errors": 0
  34. "tx_packets": 1976848
  35. "rx_errors": 0
  36. "tx_bytes": 2241546625
  37. "tx_window_errors": 0
  38. "rx_fifo_errors": 0
  39. "tx_carrier_errors": 0 

  40. }, 
  41. "eth0": { 
  42. "external": false
  43. "present": true
  44. "type": "Network device"
  45. "up": true
  46. "carrier": true
  47. "mtu": 1500
  48. "macaddr": "54:36:9b:1c:27:47"
  49. "txqueuelen": 1000
  50. "ipv6": true
  51. "statistics": { 
  52. "collisions": 0
  53. "rx_frame_errors": 0
  54. "tx_compressed": 0
  55. "multicast": 0
  56. "rx_length_errors": 0
  57. "tx_dropped": 0
  58. "rx_bytes": 2598313278
  59. "rx_missed_errors": 0
  60. "tx_errors": 0
  61. "rx_compressed": 0
  62. "rx_over_errors": 0
  63. "tx_fifo_errors": 0
  64. "rx_crc_errors": 0
  65. "rx_packets": 2998486
  66. "tx_heartbeat_errors": 0
  67. "rx_dropped": 0
  68. "tx_aborted_errors": 0
  69. "tx_packets": 2593532
  70. "rx_errors": 0
  71. "tx_bytes": 1846900606
  72. "tx_window_errors": 0
  73. "rx_fifo_errors": 0
  74. "tx_carrier_errors": 0 

  75. }, 
  76. "lo": { 
  77. "external": false
  78. "present": true
  79. "type": "Network device"
  80. "up": true
  81. "carrier": true
  82. "mtu": 65536
  83. "macaddr": "00:00:00:00:00:00"
  84. "txqueuelen": 0
  85. "ipv6": true
  86. "statistics": { 
  87. "collisions": 0
  88. "rx_frame_errors": 0
  89. "tx_compressed": 0
  90. "multicast": 0
  91. "rx_length_errors": 0
  92. "tx_dropped": 0
  93. "rx_bytes": 8805399
  94. "rx_missed_errors": 0
  95. "tx_errors": 0
  96. "rx_compressed": 0
  97. "rx_over_errors": 0
  98. "tx_fifo_errors": 0
  99. "rx_crc_errors": 0
  100. "rx_packets": 165986
  101. "tx_heartbeat_errors": 0
  102. "rx_dropped": 0
  103. "tx_aborted_errors": 0
  104. "tx_packets": 165986
  105. "rx_errors": 0
  106. "tx_bytes": 8805399
  107. "tx_window_errors": 0
  108. "rx_fifo_errors": 0
  109. "tx_carrier_errors": 0 

  110. }, 
  111. "pppoe-wan": { 
  112. "external": true
  113. "present": true
  114. "type": "Network device"
  115. "up": true
  116. "carrier": true
  117. "statistics": { 
  118. "collisions": 0
  119. "rx_frame_errors": 0
  120. "tx_compressed": 0
  121. "multicast": 0
  122. "rx_length_errors": 0
  123. "tx_dropped": 0
  124. "rx_bytes": 2209323454
  125. "rx_missed_errors": 0
  126. "tx_errors": 0
  127. "rx_compressed": 0
  128. "rx_over_errors": 0
  129. "tx_fifo_errors": 0
  130. "rx_crc_errors": 0
  131. "rx_packets": 1986151
  132. "tx_heartbeat_errors": 0
  133. "rx_dropped": 0
  134. "tx_aborted_errors": 0
  135. "tx_packets": 1557905
  136. "rx_errors": 0
  137. "tx_bytes": 477192652
  138. "tx_window_errors": 0
  139. "rx_fifo_errors": 0
  140. "tx_carrier_errors": 0 

  141. }, 
  142. "ra0": { 
  143. "external": true
  144. "present": true
  145. "type": "Network device"
  146. "up": true
  147. "carrier": true
  148. "ipv6": false
  149. "statistics": { 
  150. "collisions": 0
  151. "rx_frame_errors": 0
  152. "tx_compressed": 0
  153. "multicast": 5429
  154. "rx_length_errors": 0
  155. "tx_dropped": 0
  156. "rx_bytes": 222510556
  157. "rx_missed_errors": 0
  158. "tx_errors": 0
  159. "rx_compressed": 0
  160. "rx_over_errors": 0
  161. "tx_fifo_errors": 0
  162. "rx_crc_errors": 0
  163. "rx_packets": 1075574
  164. "tx_heartbeat_errors": 0
  165. "rx_dropped": 0
  166. "tx_aborted_errors": 0
  167. "tx_packets": 994141
  168. "rx_errors": 6
  169. "tx_bytes": 903091445
  170. "tx_window_errors": 0
  171. "rx_fifo_errors": 0
  172. "tx_carrier_errors": 0 



  173.  

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" 


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
迷上了代码!