Projecte

General

Perfil

Lua model » Historial » Versió 10

Pau Escrich, 25-07-2012 14:45

1 9 Joel Espunya
h1. qMp reference (GSoC)
2 1 Pau Escrich
3 7 Joel Espunya
h2. model [Use qmp.debug]
4 2 Pau Escrich
5 5 Joel Espunya
--- Get a section type or an option
6
-- @param section	UCI section name
7
-- @param option	UCI option (optional)
8
-- @return			UCI value
9
*get(section, option)*
10 1 Pau Escrich
11 5 Joel Espunya
--- Create a new section and initialize it with data.
12
-- @param type		UCI section type
13
-- @param name		UCI section name (optional)
14
-- @param values	Table of key - value pairs to initialize the section with (optional)
15
-- @return			Name of created section
16
*add(type, name, values)*
17 1 Pau Escrich
18 5 Joel Espunya
--- Create a new anonymous section and initialize it with data.
19
-- @param type		UCI section type
20
-- @param values	Table of key - value pairs to initialize the section with (optional)
21
-- @return			Name of created section
22
*add_type(type, values)*
23 1 Pau Escrich
24 5 Joel Espunya
--- Deletes a section or an option.
25
-- @param section	UCI section name
26
-- @param option	UCI option (optional)
27
-- @return			Boolean whether operation succeeded
28
*delete(section, option)*
29 1 Pau Escrich
30 5 Joel Espunya
--- Deletes all the UCI sections of a given type
31
-- @param type		UCI section type
32
-- @return			Boolean whether operation succeeded
33
*delete_type(type)*
34 1 Pau Escrich
35 5 Joel Espunya
--- Set a value or create a named section.
36
-- @param section	UCI section name
37
-- @param option	UCI option or UCI section type
38
-- @param value		UCI value or nil if you want to create a section
39
-- @return			Boolean whether operation succeeded
40
*set(section, option, value)*
41
42
--- Set given values as list.
43
-- @param section	UCI section name
44
-- @param option	UCI option
45
-- @param value		UCI value
46
-- @return			Boolean whether operation succeeded
47
*set_list(section, option, value)*
48
49
--- Get a table with the information of some sections of a given type 
50
-- @param type		UCI section type
51
-- @param index		UCI section type index (optional)
52
-- @param option	UCI option (optional)
53
-- @return			Table or UCI value
54
*get_type(type, index, option)*
55
56
--- Get a table with all the sections of a given type
57
-- @param type		UCI section type
58
-- @return			Table 
59
*get_all_type(type)*
60
61
--- Get a table with the information of the section of a given type and index 
62
-- @param type		UCI section type
63
-- @param index		UCI section type index
64
-- @return			Table 
65
*get_type_index(type, index)*
66
67
--- Get an option of the section of a given type and index 
68
-- @param type		UCI section type
69
-- @param index		UCI section type index 
70
-- @param option	UCI option
71
-- @return			UCI value
72
*get_type_option(type, index, option)*
73
74
--- Commit the changed done with a UCI-Cursor
75
-- @param c UCI-Cursor
76
-- @return Boolean whether operation succeeded 
77
*commit(c)*
78
79
--- Create a new UCI-Cursor
80
-- @return UCI-Cursor or an error on failure
81
*raw()*
82
83
--- Applies UCI configuration changes
84
-- @param cmd	Don't apply only return the command
85
*apply(cmd)*
86
87 6 Joel Espunya
h2. bgp [Use qmp.model]
88
89
--- Get the published networks of the current node
90
-- @return table
91
*get_networks()*
92
93
--- Get the devices working on bpg mode
94
-- @return	UCI value
95
*get_devices()*
96
97
--- Add a BGP peer
98
-- @param as AS of the BGP peer
99
-- @param ip IP of the BGP peer
100
-- @param netmask Netmask of the BGP peer
101
-- @return	Name of created section
102
*add_peer(as, ip, netmask)*
103
104
--- Set the devices working on BGP mode
105
-- @param devices Devices working on bgp mode (string)
106
-- @return	Boolean whether operation succeeded
107
*set_device(devices)*
108
109
--- Add a network to being published by BGP
110
-- @param network network range to be published
111
-- @return Boolean whether operation succeeded
112
*add_network(network)*
113
114
--- Remove the current BGP configuration 
115
*clear()*
116
	
117
--- Set the AS of the working node
118
-- @param as AS of the working node 
119
-- @return	Boolean whether operation succeeded
120
*set_as(as)*
121
122
--- Get the AS of the working node
123
-- @return AS of the working node 
124
*get_as()*
125
126 10 Pau Escrich
h2. network [Use qmp.model]
127
128
*add_if(name,iface) ##proto=none
129
130
*add_br(name,ifaces) ##proto=none
131
132
*add_alias(name,viface) ##proto=none
133
134
*set_ipv4(name,ip,mask) ##proto=static
135
136
*set_ipv6(name,network ##proto=static
137
138
*set_dhcp(name) ##proto=dhcp
139
140
*set_dns(dns) ##defined in loopback
141
142
*add_route4(name,viface,ipdest,netmask,gw) ##(guifi,backbone1,10.0.0.0,255.0.0.0,172.77.11.1)
143
144
*add_route6(...)
145
146 6 Joel Espunya
h2. control [Use qmp.model and qmpl.bgp]
147 5 Joel Espunya
148 3 Joel Espunya
--- Remove the current bgp configuration 
149 1 Pau Escrich
*remove_bgp_config()*
150 3 Joel Espunya
151
--- Add a bgp peer 
152
-- @param as AS of the BGP peer (if doesn't exist, it should be given as an argument)
153
-- @param ip IP of the BGP peer  (if doesn't exist, it should be given as an argument)
154
-- @param netmask Netmask of the BGP peer  (if doesn't exist, it should be given as an argument)
155
-- @return	Boolean whether operation succeeded
156 1 Pau Escrich
*add_bgp_peer(as, ipdest, netmask)*
157 3 Joel Espunya
158
--- Add a network to being published by bgp
159
-- @param network network range to be published (if doesn't exist, it should be given as an argument)
160
-- @return Boolean whether operation succeeded
161 1 Pau Escrich
*add_bgp_network(range)*
162
163 3 Joel Espunya
164
--- Set the devices working on bpg mode
165
-- @param devices Devices working on bgp mode (if doesn't exist, it should be given as an argument)
166
-- @return	Boolean whether operation succeeded
167 1 Pau Escrich
*set_bgp_devices(devices)*
168 3 Joel Espunya
169
--- Set the AS of the working node
170
-- @param as AS of the working node (if doesn't exist, it should be given as an argument)
171
-- @return	Boolean whether operation succeeded
172 1 Pau Escrich
*set_bgp_as(as)*
173 3 Joel Espunya
174
--- Applies UCI configuration changes
175 1 Pau Escrich
*apply_changes()*
176 7 Joel Espunya
177
h2. debug
178
179
--- Add one line to the system log file with the tag qMp
180
-- @param msg	string
181
*logger(msg)*
182 1 Pau Escrich
183 3 Joel Espunya
184
h2. more information 
185 1 Pau Escrich
186
http://wiki.openwrt.org/doc/techref/uci
187
http://luci.subsignal.org/api/luci