bird-openwrt: update to version 0.3
[feed/routing.git] / bird-openwrt / bird6-openwrt / src / model / overview.lua
1 --[[
2 Copyright (C) 2014-2017 - Eloi Carbo
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ]]--
17
18 require("luci.sys")
19 local http = require "luci.http"
20 local uci = require "luci.model.uci"
21 local uciout = uci.cursor()
22
23 m=Map("bird6", "Bird6 UCI configuration helper", "")
24
25 -- Named section: "bird"
26
27 s_bird_uci = m:section(NamedSection, "bird", "bird", "Bird6 file settings", "")
28 s_bird_uci.addremove = False
29
30 uuc = s_bird_uci:option(Flag, "use_UCI_config", "Use UCI configuration", "Use UCI configuration instead of the /etc/bird6.conf file")
31
32 ucf = s_bird_uci:option(Value, "UCI_config_file", "UCI File", "Specify the file to place the UCI-translated configuration")
33 ucf.default = "/tmp/bird6.conf"
34
35 -- Named Section: "table"
36
37 s_bird_table = m:section(TypedSection, "table", "Tables configuration", "Configuration of the tables used in the protocols")
38 s_bird_table.addremove = true
39 s_bird_table.anonymous = true
40
41 name = s_bird_table:option(Value, "name", "Table name", "Descriptor ID of the table")
42
43 -- Named section: "global"
44
45 s_bird_global = m:section(NamedSection, "global", "global", "Global options", "Basic Bird6 settings")
46 s_bird_global.addremove = False
47
48 id = s_bird_global:option(Value, "router_id", "Router ID", "Identification number of the router. By default, is the router's IP.")
49
50 lf = s_bird_global:option(Value, "log_file", "Log File", "File used to store log related data.")
51
52 l = s_bird_global:option(MultiValue, "log", "Log", "Set which elements do you want to log.")
53 l:value("all", "All")
54 l:value("info", "Info")
55 l:value("warning","Warning")
56 l:value("error","Error")
57 l:value("fatal","Fatal")
58 l:value("debug","Debug")
59 l:value("trace","Trace")
60 l:value("remote","Remote")
61 l:value("auth","Auth")
62
63 d = s_bird_global:option(MultiValue, "debug", "Debug", "Set which elements do you want to debug.")
64 d:value("all", "All")
65 d:value("states","States")
66 d:value("routes","Routes")
67 d:value("filters","Filters")
68 d:value("interfaces","Interfaces")
69 d:value("events","Events")
70 d:value("packets","Packets")
71
72 listen_addr = s_bird_global:option(Value, "listen_bgp_addr", "BGP Address", "Set the Addres that BGP will listen to.")
73 listen_addr.optional = true
74
75 listen_port = s_bird_global:option(Value, "listen_bgp_port", "BGP Port", "Set the port that BGP will listen to.")
76 listen_port.optional = true
77
78 listen_dual = s_bird_global:option(Flag, "listen_bgp_dual", "BGP Dual/ipv6", "Set if BGP connections will listen ipv6 only 'ipv6only' or both ipv4/6 'dual' routes")
79 listen_dual.optional = true
80
81 function m.on_commit(self,map)
82 luci.sys.exec('/etc/init.d/bird6 restart')
83 end
84
85 return m