Projecte

General

Perfil

Lua model » Historial » Versió 4

Joel Espunya, 25-06-2012 21:59

1 3 Joel Espunya
!!h1. Lua model
2 1 Pau Escrich
3
h2. model
4 2 Pau Escrich
5 1 Pau Escrich
- get(section,option)
6
- add(section,option,value=nil)
7
- del(section,option)
8
- set(section,option,value)
9
10
- get_type(type,index=nil,option=nil)
11
  -> table[1..n][1..z]
12
  -> table[1..n]
13
  -> value
14
15
- get_indexes(type)
16
  -> table[1..n]
17
18
- set_type(type,index=nil,option=nil,value)
19
20
- raw() -> ucicursor
21
22 3 Joel Espunya
h2. control
23
--- Remove the current bgp configuration 
24
*remove_bgp_config()*
25 1 Pau Escrich
26 3 Joel Espunya
--- Add a bgp peer 
27
-- @param as AS of the BGP peer (if doesn't exist, it should be given as an argument)
28
-- @param ip IP of the BGP peer  (if doesn't exist, it should be given as an argument)
29
-- @param netmask Netmask of the BGP peer  (if doesn't exist, it should be given as an argument)
30
-- @return	Boolean whether operation succeeded
31
*add_bgp_peer(as, ipdest, netmask)*
32 1 Pau Escrich
33 3 Joel Espunya
--- Add a network to being published by bgp
34
-- @param network network range to be published (if doesn't exist, it should be given as an argument)
35
-- @return Boolean whether operation succeeded
36
*add_bgp_network(range)*
37 1 Pau Escrich
38
39 3 Joel Espunya
--- Set the devices working on bpg mode
40
-- @param devices Devices working on bgp mode (if doesn't exist, it should be given as an argument)
41
-- @return	Boolean whether operation succeeded
42
*set_bgp_devices(devices)*
43 1 Pau Escrich
44 3 Joel Espunya
--- Set the AS of the working node
45
-- @param as AS of the working node (if doesn't exist, it should be given as an argument)
46
-- @return	Boolean whether operation succeeded
47
*set_bgp_as(as)*
48 1 Pau Escrich
49 3 Joel Espunya
--- Applies UCI configuration changes
50
*apply_changes()*
51 1 Pau Escrich
52
53 3 Joel Espunya
h2. more information 
54
55 1 Pau Escrich
http://wiki.openwrt.org/doc/techref/uci
56
http://luci.subsignal.org/api/luci