From 3f8ce1ad107c2248d0810b2e0140079c2156c74a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 27 Nov 2008 14:26:37 +0000 Subject: [PATCH] luci-0.8: merge r3809-r3822 --- .../luci-olsr/luasrc/i18n/olsr.de.lua | 4 +- .../luci-olsr/luasrc/i18n/olsr.de.xml | 4 +- .../luci-olsr/luasrc/i18n/olsr.en.lua | 4 +- .../luci-olsr/luasrc/i18n/olsr.en.xml | 4 +- .../luasrc/model/cbi/olsr/olsrdhna.lua | 27 +++++--- .../luasrc/statistics/rrdtool.lua | 2 +- contrib/package/olsrd-luci/Makefile | 20 +++--- .../package/olsrd-luci/files/etc/init.d/olsrd | 4 +- .../patches/200-olsrd-dyngw-hna.patch | 14 ----- i18n/english/luasrc/i18n/admin-core.en.lua | 8 ++- i18n/english/luasrc/i18n/admin-core.en.xml | 8 ++- i18n/french/luasrc/i18n/admin-core.fr.lua | 6 ++ i18n/french/luasrc/i18n/admin-core.fr.xml | 6 ++ i18n/german/luasrc/i18n/admin-core.de.lua | 6 ++ i18n/german/luasrc/i18n/admin-core.de.xml | 6 ++ .../luasrc/i18n/admin-core.pt-br.lua | 6 ++ .../luasrc/i18n/admin-core.pt-br.xml | 6 ++ i18n/russian/luasrc/i18n/admin-core.ru.lua | 6 ++ i18n/russian/luasrc/i18n/admin-core.ru.xml | 6 ++ libs/core/luasrc/ip.lua | 4 +- libs/sys/luasrc/sys.lua | 47 ++++++++++++++ .../root/lib/uci/schema/default/network | 40 ++++++++++++ .../luasrc/model/cbi/admin_network/routes.lua | 61 ++++++++++++++++--- 23 files changed, 246 insertions(+), 53 deletions(-) delete mode 100644 contrib/package/olsrd-luci/patches/200-olsrd-dyngw-hna.patch diff --git a/applications/luci-olsr/luasrc/i18n/olsr.de.lua b/applications/luci-olsr/luasrc/i18n/olsr.de.lua index dc0cfafab2..4ebcf0e2ed 100644 --- a/applications/luci-olsr/luasrc/i18n/olsr.de.lua +++ b/applications/luci-olsr/luasrc/i18n/olsr.de.lua @@ -75,8 +75,8 @@ olsrd_hna6 = 'IPv6 HNA-Ankündigungen' olsrd_hna6_desc = 'Hna6-Entries ermöglichen die Ankündigung von lokalen IPv6 Host- und Netz-Routen im Mesh-Netzwerk' olsrd_hna6_netaddr = 'Netzwerk-Adresse' olsrd_hna6_netaddr_desc = 'IPv6 Adresse' -olsrd_hna6_netmask = 'Netzmaske' -olsrd_hna6_netmask_desc = 'IPv6 Adresse' +olsrd_hna6_prefix = 'Prefix' +olsrd_hna6_prefix_desc = 'IPv6 Prefix' olsrd_loadplugin = 'Pluginkonfiguration' olsrd_loadplugin_ignore = 'Plugin aktivieren' olsrd_loadplugin_library = 'Bibliothek' diff --git a/applications/luci-olsr/luasrc/i18n/olsr.de.xml b/applications/luci-olsr/luasrc/i18n/olsr.de.xml index 3d9763dc92..3d8b5a211f 100644 --- a/applications/luci-olsr/luasrc/i18n/olsr.de.xml +++ b/applications/luci-olsr/luasrc/i18n/olsr.de.xml @@ -112,8 +112,8 @@ Hna6-Entries ermöglichen die Ankündigung von lokalen IPv6 Host- und Netz-Routen im Mesh-Netzwerk Netzwerk-Adresse IPv6 Adresse -Netzmaske -IPv6 Adresse +Prefix +IPv6 Prefix diff --git a/applications/luci-olsr/luasrc/i18n/olsr.en.lua b/applications/luci-olsr/luasrc/i18n/olsr.en.lua index fbba7653f8..b8621d3f7e 100644 --- a/applications/luci-olsr/luasrc/i18n/olsr.en.lua +++ b/applications/luci-olsr/luasrc/i18n/olsr.en.lua @@ -75,8 +75,8 @@ olsrd_hna6 = 'IPv6 HNA announcements' olsrd_hna6_desc = 'Hna6 entries allow you to propagate local IPv6 host- and network-routes into the mesh network' olsrd_hna6_netaddr = 'Network address' olsrd_hna6_netaddr_desc = 'IPv6 address' -olsrd_hna6_netmask = 'Netmask' -olsrd_hna6_netmask_desc = 'IPv6 address' +olsrd_hna6_prefix = 'Prefix' +olsrd_hna6_prefix_desc = 'IPv6 prefix' olsrd_loadplugin = 'Plugin configuration' olsrd_loadplugin_ignore = 'Enable plugin' olsrd_loadplugin_library = 'Library' diff --git a/applications/luci-olsr/luasrc/i18n/olsr.en.xml b/applications/luci-olsr/luasrc/i18n/olsr.en.xml index 546b7a849c..4dc7d5c943 100644 --- a/applications/luci-olsr/luasrc/i18n/olsr.en.xml +++ b/applications/luci-olsr/luasrc/i18n/olsr.en.xml @@ -112,8 +112,8 @@ Hna6 entries allow you to propagate local IPv6 host- and network-routes into the mesh network Network address IPv6 address -Netmask -IPv6 address +Prefix +IPv6 prefix diff --git a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdhna.lua b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdhna.lua index 632a4d4a4b..ea2f88d794 100644 --- a/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdhna.lua +++ b/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdhna.lua @@ -14,14 +14,23 @@ $Id$ mh = Map("olsrd", translate("olsrd_hna", "OLSR - HNA-Ankündigungen")) -for i, sect in ipairs({ "Hna4", "Hna6" }) do - hna = mh:section(TypedSection, sect) - hna.addremove = true - hna.anonymous = true - hna.template = "cbi/tblsection" - - net = hna:option(Value, "netaddr") - msk = hna:option(Value, "netmask") -end + +hna4 = mh:section(TypedSection, "Hna4") +hna4.addremove = true +hna4.anonymous = true +hna4.template = "cbi/tblsection" + +net4 = hna4:option(Value, "netaddr") +msk4 = hna4:option(Value, "netmask") + + +hna6 = mh:section(TypedSection, "Hna6") +hna6.addremove = true +hna6.anonymous = true +hna6.template = "cbi/tblsection" + +net6 = hna6:option(Value, "netaddr") +msk6 = hna6:option(Value, "prefix") + return mh diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-statistics/luasrc/statistics/rrdtool.lua index 23e0170368..cf420fe6d0 100644 --- a/applications/luci-statistics/luasrc/statistics/rrdtool.lua +++ b/applications/luci-statistics/luasrc/statistics/rrdtool.lua @@ -42,7 +42,7 @@ function Graph.__init__( self, timespan, opts ) -- options opts.timespan = timespan or sections.rrdtool.default_timespan or 900 - opts.rrasingle = opts.rrasingle or ( sections.collectd_rrdtool.RRASingle ~= "0" ) + opts.rrasingle = opts.rrasingle or ( sections.collectd_rrdtool.RRASingle == "1" ) opts.host = opts.host or sections.collectd.Hostname or luci.sys.hostname() opts.width = opts.width or sections.rrdtool.image_width or 400 opts.rrdpath = opts.rrdpath or sections.collectd_rrdtool.DataDir or "/tmp/rrd" diff --git a/contrib/package/olsrd-luci/Makefile b/contrib/package/olsrd-luci/Makefile index c437dceb74..8e22a7448f 100644 --- a/contrib/package/olsrd-luci/Makefile +++ b/contrib/package/olsrd-luci/Makefile @@ -11,13 +11,19 @@ include $(TOPDIR)/rules.mk PKG_BASENAME:=olsrd PKG_NAME:=$(PKG_BASENAME)-luci -PKG_VERSION:=0.5.6 -PKG_RELEASE:=4 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_BASENAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_BASENAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://www.olsr.org/releases/0.5 -PKG_MD5SUM:=918a4d43eebb6d62889ecedb941c2029 +PKG_VERSION:=0.5.6-r2+hg1724 +PKG_RELEASE:=1 + +PKG_HGREV:=cac1df64dcd5 +PKG_SOURCE:=$(PKG_HGREV).tar.gz +PKG_SOURCE_URL:=http://gredler.at/hg/olsrd-0.5.6/archive +PKG_MD5SUM:=95af2d8d6075f74d379b752fb8dda3de +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_BASENAME)-0-5-6-$(PKG_HGREV) + +#PKG_SOURCE:=$(PKG_BASENAME)-$(PKG_VERSION).tar.bz2 +#PKG_SOURCE_URL:=http://www.olsr.org/releases/0.5 +#PKG_MD5SUM:=64b439cde30f48764f02cdd8766aba40 +#PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_BASENAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk diff --git a/contrib/package/olsrd-luci/files/etc/init.d/olsrd b/contrib/package/olsrd-luci/files/etc/init.d/olsrd index 51927156e8..9aee7a3664 100755 --- a/contrib/package/olsrd-luci/files/etc/init.d/olsrd +++ b/contrib/package/olsrd-luci/files/etc/init.d/olsrd @@ -10,7 +10,7 @@ PID=/var/run/olsrd.pid OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 IpVersion=4 AllowNoInt:bool=1 Pollrate=0.025 TcRedundancy=2 MprCoverage=3 LinkQualityFishEye=1 LinkQualityWinSize=100 LinkQualityDijkstraLimit=0+9.0 LinkQualityLevel=2 UseHysteresis:bool=0 FIBMetric=flat ClearScreen:bool=1 Willingness=3 LinkQualityAging=0.1 LinkQualityAlgorithm=etx_fpm' OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2' OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host:list Net:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2' -OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool Ip4Broadcast=255.255.255.255 HelloInterval=2.0 HelloValidityTime=40.0 TcInterval=5.0 TcValidityTime=100.0 MidInterval=18.0 MidValidityTime=324.0 HnaInterval=18.0 HnaValidityTime=108.0' +OLSRD_INTERFACE_SCHEMA='ignore:internal interface:internal AutoDetectChanges:bool Ip4Broadcast HelloInterval=2.0 HelloValidityTime=40.0 TcInterval=5.0 TcValidityTime=100.0 MidInterval=18.0 MidValidityTime=324.0 HnaInterval=18.0 HnaValidityTime=108.0' T=' ' N=' @@ -526,7 +526,7 @@ start() { return 1 fi fi - + SYSTEM_HOSTNAME= SYSTEM_LAT= SYSTEM_LON= diff --git a/contrib/package/olsrd-luci/patches/200-olsrd-dyngw-hna.patch b/contrib/package/olsrd-luci/patches/200-olsrd-dyngw-hna.patch deleted file mode 100644 index 8b4e9c408a..0000000000 --- a/contrib/package/olsrd-luci/patches/200-olsrd-dyngw-hna.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -urb olsrd-0.5.6.orig/lib/dyn_gw/src/olsrd_dyn_gw.c olsrd-0.5.6/lib/dyn_gw/src/olsrd_dyn_gw.c ---- olsrd-0.5.6.orig/lib/dyn_gw/src/olsrd_dyn_gw.c 2008-09-16 01:14:44.000000000 +0200 -+++ olsrd-0.5.6/lib/dyn_gw/src/olsrd_dyn_gw.c 2008-09-16 01:26:55.000000000 +0200 -@@ -191,8 +191,8 @@ - } - - //printf("GOT: %s(%08x)",inet_ntoa(foo_addr),foo_addr.s_addr); -- if (inet_pton(olsr_cnf->ip_version, s_netaddr, &temp_netmask) <= 0) { -- OLSR_PRINTF(0, "Illegal netmask \"%s\"", s_netaddr); -+ if (inet_pton(olsr_cnf->ip_version, s_mask, &temp_netmask) <= 0) { -+ OLSR_PRINTF(0, "Illegal netmask \"%s\"", s_mask); - return 1; - } - diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua index b9d77ceb86..64729f8fc8 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.lua +++ b/i18n/english/luasrc/i18n/admin-core.en.lua @@ -169,6 +169,8 @@ a_n_switch = 'Switch' a_n_conntrack = 'Active Connections' a_n_conntrack_desc = 'This page gives an overview over currently active network connections.' a_n_routes = 'Routes' +a_n_routes4 = 'IPv4 Routes' +a_n_routes6 = 'IPv6 Routes' a_network1 = 'In this area you find all network-related settings.' a_network2 = 'On most routers the network switch can be freely configured and splitted up into several VLANs.' a_network3 = 'Interfaces and PPPoE / PPTP-Settings allow a custom organisation of the network and connections to other networks like the internet.' @@ -223,8 +225,12 @@ network_interface_maxwait = 'Setup wait time' network_interface_maxwait_desc = 'Seconds to wait for the modem to become ready before attempting to connect' a_n_r_routes1 = 'Routes specify over which interface and gateway a certain host or network can be reached.' a_n_routes_static = 'Static Routes' +a_n_routes_static4 = 'Static IPv4 Routes' +a_n_routes_static6 = 'Static IPv6 Routes' a_n_routes_kernel4 = 'Active IPv4-Routes' -a_n_r_target1 = 'host-IP or network' +a_n_routes_kernel6 = 'Active IPv6-Routes' +a_n_r_target1 = 'Host-IP or Network' +a_n_r_target6 = 'IPv6-Address or Network (CIDR)' a_n_r_netmask1 = 'if target is a network' m_n_inet = 'Internet Connection' m_n_local = 'Local Network' diff --git a/i18n/english/luasrc/i18n/admin-core.en.xml b/i18n/english/luasrc/i18n/admin-core.en.xml index e1f29ffbe5..0bd7177aa2 100644 --- a/i18n/english/luasrc/i18n/admin-core.en.xml +++ b/i18n/english/luasrc/i18n/admin-core.en.xml @@ -173,6 +173,8 @@ Active Connections This page gives an overview over currently active network connections. Routes +IPv4 Routes +IPv6 Routes In this area you find all network-related settings. On most routers the network switch can be freely configured and splitted up into several VLANs. Interfaces and PPPoE / PPTP-Settings allow a custom organisation of the network and connections to other networks like the internet. @@ -227,8 +229,12 @@ Seconds to wait for the modem to become ready before attempting to connect Routes specify over which interface and gateway a certain host or network can be reached. Static Routes +Static IPv4 Routes +Static IPv6 Routes Active IPv4-Routes -host-IP or network +Active IPv6-Routes +Host-IP or Network +IPv6-Address or Network (CIDR) if target is a network Internet Connection Local Network diff --git a/i18n/french/luasrc/i18n/admin-core.fr.lua b/i18n/french/luasrc/i18n/admin-core.fr.lua index c3f8d3ae6a..93dfda86b5 100644 --- a/i18n/french/luasrc/i18n/admin-core.fr.lua +++ b/i18n/french/luasrc/i18n/admin-core.fr.lua @@ -169,6 +169,8 @@ a_n_switch = 'Switch' a_n_conntrack = 'Connexions Actives' a_n_conntrack_desc = 'Cette page donne une vue d'ensemble des connexions réseaux actuellement actives.' a_n_routes = 'Routes' +a_n_routes4 = 'IPv4 Routes' +a_n_routes6 = 'IPv6 Routes' a_network1 = 'Dans cette section vous trouverez tous les réglages relatifs au réseau.' a_network2 = 'Sur la plupart des routeurs, les ports des switchs peuvent être configurés et séparés en plusieurs VLANs.' a_network3 = 'Les réglages des interfaces et du PPPoE / PPTP vous permettent une configuration personalisée du réseau.' @@ -223,8 +225,12 @@ network_interface_maxwait = 'Délai d'initialisation' network_interface_maxwait_desc = 'Secondes à attendre pour que le modem soit prêt avant d'essayer de se connecter' a_n_r_routes1 = 'Avec les routes statiques vous pouvez spécifier à travers quelle interface ou passerelle un réseau peut être contacté.' a_n_routes_static = 'Routes statiques' +a_n_routes_static4 = 'Routes IPv4 statiques' +a_n_routes_static6 = 'Routes IPv6 statiques' a_n_routes_kernel4 = 'Routes IPv4 actives' +a_n_routes_kernel6 = 'Routes IPv6 actives' a_n_r_target1 = 'adresse IP ou réseau' +a_n_r_target6 = 'adresse IPv6 ou réseau' a_n_r_netmask1 = 'si la destination est un réseau' m_n_inet = 'Connexion Internet' m_n_local = 'Réseau Local' diff --git a/i18n/french/luasrc/i18n/admin-core.fr.xml b/i18n/french/luasrc/i18n/admin-core.fr.xml index 598780b56f..d3212038a5 100644 --- a/i18n/french/luasrc/i18n/admin-core.fr.xml +++ b/i18n/french/luasrc/i18n/admin-core.fr.xml @@ -173,6 +173,8 @@ Connexions Actives Cette page donne une vue d'ensemble des connexions réseaux actuellement actives. Routes +IPv4 Routes +IPv6 Routes Dans cette section vous trouverez tous les réglages relatifs au réseau. Sur la plupart des routeurs, les ports des switchs peuvent être configurés et séparés en plusieurs VLANs. Les réglages des interfaces et du PPPoE / PPTP vous permettent une configuration personalisée du réseau. @@ -227,8 +229,12 @@ Secondes à attendre pour que le modem soit prêt avant d'essayer de se connecter Avec les routes statiques vous pouvez spécifier à travers quelle interface ou passerelle un réseau peut être contacté. Routes statiques +Routes IPv4 statiques +Routes IPv6 statiques Routes IPv4 actives +Routes IPv6 actives adresse IP ou réseau +adresse IPv6 ou réseau si la destination est un réseau Connexion Internet Réseau Local diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua index 06451b434a..a5280cc38e 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.lua +++ b/i18n/german/luasrc/i18n/admin-core.de.lua @@ -19,10 +19,16 @@ a_n_ptp = 'Punkt-zu-Punkt Verbindungen' a_n_ptp1 = 'Punkt-zu-Punkt Verbindungen über PPPoE oder PPTP werden häufig dazu verwendet, um über DSL o.ä. Techniken eine Verbindung zum Internetgateway eines Internetzugangsanbieters aufzubauen.' a_n_r_netmask1 = 'falls Ziel ein Netzwerk ist' a_n_r_target1 = 'Host-IP oder Netzwerk' +a_n_r_target6 = 'IPv6 Host- oder Netzwerk-Addresse (CIDR)' a_n_routes = 'Routen' +a_n_routes4 = 'IPv4 Routen' +a_n_routes6 = 'IPv6 Routen' a_n_routes1 = 'Routen geben an, über welche Schnittstelle und welches Gateway ein bestimmter Host oder ein bestimmtes Netzwerk erreicht werden kann.' a_n_routes_static = 'Statische Routen' +a_n_routes_static4 = 'Statische IPv4 Routen' +a_n_routes_static6 = 'Statische IPv6 Routen' a_n_routes_kernel4 = 'Aktive IPv4-Routen' +a_n_routes_kernel6 = 'Aktive IPv6-Routen' a_n_switch = 'Switch' a_n_switch1 = 'Die Netzwerkschnittstellen am Router können zu verschienden VLANs zusammengefasst werden, in denen Geräte miteinander direkt kommunizieren können. VLANs werden auch häufig dazu genutzt, um Netzwerke voneiander zu trennen. So ist oftmals eine Schnittstelle als Uplink zu einem größerem Netz, wie dem Internet vorkonfiguriert und die anderen Schnittstellen bilden ein VLAN für das lokale Netzwerk.' a_n_conntrack = 'Aktive Verbindungen' diff --git a/i18n/german/luasrc/i18n/admin-core.de.xml b/i18n/german/luasrc/i18n/admin-core.de.xml index 9ca8b95c8b..5f4e3a7d02 100644 --- a/i18n/german/luasrc/i18n/admin-core.de.xml +++ b/i18n/german/luasrc/i18n/admin-core.de.xml @@ -23,10 +23,16 @@ Punkt-zu-Punkt Verbindungen über PPPoE oder PPTP werden häufig dazu verwendet, um über DSL o.ä. Techniken eine Verbindung zum Internetgateway eines Internetzugangsanbieters aufzubauen. falls Ziel ein Netzwerk ist Host-IP oder Netzwerk +IPv6 Host- oder Netzwerk-Addresse (CIDR) Routen +IPv4 Routen +IPv6 Routen Routen geben an, über welche Schnittstelle und welches Gateway ein bestimmter Host oder ein bestimmtes Netzwerk erreicht werden kann. Statische Routen +Statische IPv4 Routen +Statische IPv6 Routen Aktive IPv4-Routen +Aktive IPv6-Routen Switch Die Netzwerkschnittstellen am Router können zu verschienden VLANs zusammengefasst werden, in denen Geräte miteinander direkt kommunizieren können. VLANs werden auch häufig dazu genutzt, um Netzwerke voneiander zu trennen. So ist oftmals eine Schnittstelle als Uplink zu einem größerem Netz, wie dem Internet vorkonfiguriert und die anderen Schnittstellen bilden ein VLAN für das lokale Netzwerk. Aktive Verbindungen diff --git a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua index 987501a4cd..8038e3713e 100644 --- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua +++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua @@ -169,6 +169,8 @@ a_n_switch = 'Switch' a_n_conntrack = 'Conexões Ativas' a_n_conntrack_desc = 'Esta página fornece informações sobre as conexões de rede ativas.' a_n_routes = 'Rotas' +a_n_routes4 = 'Rotas IPv4' +a_n_routes6 = 'Rotas IPv6' a_network1 = 'Neste espaço você encontrará todas as configurações relacionadas à rede.' a_network2 = 'Na maioria dos roteadores o switch de rede pode ser configurado livremente e dividos em diversas VLANs.' a_network3 = 'Interfaces e Configurações-PPPoE / PPTP permite uma organização customizada da rede e conexões com outras redes, como a Internet.' @@ -223,8 +225,12 @@ network_interface_maxwait = 'Configurar tempo de espera' network_interface_maxwait_desc = 'Segundos de espera para o modem ficar pronto antes de tentar se conectar' a_n_r_routes1 = 'Rotas específicas sobre qual interface e gateway um determinado host ou rede pode ser alcançado.' a_n_routes_static = 'Rotas Estáticas' +a_n_routes_static4 = 'Rotas Estáticas IPv4' +a_n_routes_static6 = 'Rotas Estáticas IPv6' a_n_routes_kernel4 = 'Rotas-IPv4 ativas' +a_n_routes_kernel6 = 'Rotas-IPv6 ativas' a_n_r_target1 = 'IP do host ou rede' +a_n_r_target6 = 'IPv6 do host ou rede' a_n_r_netmask1 = 'se o destino for uma rede' m_n_inet = 'Conexão com a Internet' m_n_local = 'Rede Local' diff --git a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml index c898fcb138..8fee8c142e 100644 --- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml +++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml @@ -173,6 +173,8 @@ Conexões Ativas Esta página fornece informações sobre as conexões de rede ativas. Rotas +Rotas IPv4 +Rotas IPv6 Neste espaço você encontrará todas as configurações relacionadas à rede. Na maioria dos roteadores o switch de rede pode ser configurado livremente e dividos em diversas VLANs. Interfaces e Configurações-PPPoE / PPTP permite uma organização customizada da rede e conexões com outras redes, como a Internet. @@ -227,8 +229,12 @@ Segundos de espera para o modem ficar pronto antes de tentar se conectar Rotas específicas sobre qual interface e gateway um determinado host ou rede pode ser alcançado. Rotas Estáticas +Rotas Estáticas IPv4 +Rotas Estáticas IPv6 Rotas-IPv4 ativas +Rotas-IPv6 ativas IP do host ou rede +IPv6 do host ou rede se o destino for uma rede Conexão com a Internet Rede Local diff --git a/i18n/russian/luasrc/i18n/admin-core.ru.lua b/i18n/russian/luasrc/i18n/admin-core.ru.lua index 8e19863b19..723907fe99 100644 --- a/i18n/russian/luasrc/i18n/admin-core.ru.lua +++ b/i18n/russian/luasrc/i18n/admin-core.ru.lua @@ -161,6 +161,8 @@ dhcp_dnsmasq_addnhosts = 'дополнительный hostfile' dhcp_dnsmasq_queryport = 'порт запросов' a_n_switch = 'Свитч' a_n_routes = 'Маршрутизация' +a_n_routes4 = 'Маршрутизация IPv4' +a_n_routes6 = 'Маршрутизация IPv6' a_n_routes1 = 'Маршрутизация служит для определения через какой интерфейс и шлюз можно пройти к определённому хосту или сегменту сети.' a_network1 = 'В этом разделе вы сможете найти всё что касается настроек сети.' a_network2 = 'В большенстве роутеров сетевой свитч может быть свободно настроен и добавлен в различные VLAN'ы.' @@ -193,8 +195,12 @@ network_interface_keepalive = 'Keep-Alive' network_interface_keepalive_desc = 'Количество неудачных соединений для инициализации переподсоединения к серверу' a_n_r_routes1 = 'Маршрутизация служит для определения через какой интерфейс и шлюз можно пройти к определённому хосту или сегменту сети.' a_n_routes_static = 'Статическая маршрутизация' +a_n_routes_static4 = 'Статическая маршрутизация IPv4' +a_n_routes_static6 = 'Статическая маршрутизация IPv6' a_n_routes_kernel4 = 'Включение IPv4-Маршрутизации' +a_n_routes_kernel6 = 'Включение IPv6-Маршрутизации' a_n_r_target1 = 'Хост-IP или сеть' +a_n_r_target6 = 'Хост-IPv6 или сеть' a_n_r_netmask1 = 'если сеть' m_n_inet = 'Интернет соединение' m_n_local = 'Локальная сеть' diff --git a/i18n/russian/luasrc/i18n/admin-core.ru.xml b/i18n/russian/luasrc/i18n/admin-core.ru.xml index b98786f268..d5b55a0137 100644 --- a/i18n/russian/luasrc/i18n/admin-core.ru.xml +++ b/i18n/russian/luasrc/i18n/admin-core.ru.xml @@ -165,6 +165,8 @@ порт запросов Свитч Маршрутизация +Маршрутизация IPv4 +Маршрутизация IPv6 Маршрутизация служит для определения через какой интерфейс и шлюз можно пройти к определённому хосту или сегменту сети. В этом разделе вы сможете найти всё что касается настроек сети. @@ -198,8 +200,12 @@ Количество неудачных соединений для инициализации переподсоединения к серверу Маршрутизация служит для определения через какой интерфейс и шлюз можно пройти к определённому хосту или сегменту сети. Статическая маршрутизация +Статическая маршрутизация IPv4 +Статическая маршрутизация IPv6 Включение IPv4-Маршрутизации +Включение IPv6-Маршрутизации Хост-IP или сеть +Хост-IPv6 или сеть если сеть Интернет соединение Локальная сеть diff --git a/libs/core/luasrc/ip.lua b/libs/core/luasrc/ip.lua index bba701ae24..590ea76b2f 100644 --- a/libs/core/luasrc/ip.lua +++ b/libs/core/luasrc/ip.lua @@ -314,7 +314,7 @@ function Hex( hex, prefix, family, swap ) end end - return __bless({ family, data, len }) + return __bless({ family, data, prefix }) end @@ -481,7 +481,7 @@ end -- @see cidr.broadcast -- @see cidr.mask function cidr.host( self ) - return __bless({ self[1], data, __maxlen(self[1]) }) + return __bless({ self[1], self[2], __maxlen(self[1]) }) end --- Return a corresponding CIDR representing the netmask of this instance. diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua index 52ed0c36d9..b7e374d7cf 100644 --- a/libs/sys/luasrc/sys.lua +++ b/libs/sys/luasrc/sys.lua @@ -361,6 +361,53 @@ function net.routes() return _parse_delimited_table(io.lines("/proc/net/route")) end +--- Returns the current ipv6 kernel routing table entries. +-- @return Table of tables with properties of the corresponding routes. +-- The following fields are defined for route entry tables: +-- { "src_ip", "src_prefix", "dst_ip", "dst_prefix", "nexthop_ip", +-- "metric", "refcount", "usecount", "flags", "device" } +function net.routes6() + local routes = { } + + for line in io.lines("/proc/net/ipv6_route") do + + local dst_ip, dst_prefix, src_ip, src_prefix, nexthop, + metric, refcnt, usecnt, flags, dev = line:match( + "([a-f0-9]+) ([a-f0-9]+) " .. + "([a-f0-9]+) ([a-f0-9]+) " .. + "([a-f0-9]+) ([a-f0-9]+) " .. + "([a-f0-9]+) ([a-f0-9]+) " .. + "([^%s]+) +([^%s]+)" + ) + + src_ip = luci.ip.Hex( + src_ip, tonumber(src_prefix, 16), + luci.ip.FAMILY_INET6, false + ) + + dst_ip = luci.ip.Hex( + dst_ip, tonumber(dst_prefix, 16), + luci.ip.FAMILY_INET6, false + ) + + nexthop = luci.ip.Hex( nexthop, 128, luci.ip.FAMILY_INET6, false ) + + routes[#routes+1] = { + src_ip = src_ip:host():string(), + src_prefix = src_ip:prefix(), + dst_ip = dst_ip:host():string(), + dst_prefix = dst_ip:prefix(), + nexthop_ip = nexthop:string(), + metric = tonumber(metric, 16), + refcount = tonumber(refcnt, 16), + usecount = tonumber(usecnt, 16), + flags = tonumber(flags), -- hex? + device = dev + } + end + + return routes +end --- Tests whether the given host responds to ping probes. -- @param host String containing a hostname or IPv4 address diff --git a/modules/admin-core/root/lib/uci/schema/default/network b/modules/admin-core/root/lib/uci/schema/default/network index e0a6dc1908..8cf79cb3f6 100644 --- a/modules/admin-core/root/lib/uci/schema/default/network +++ b/modules/admin-core/root/lib/uci/schema/default/network @@ -386,6 +386,46 @@ config variable option datatype 'ip4addr' option required 'true' +config variable + option name 'metric' + option title 'Metric' + option section 'network.route6' + option datatype 'uint' + + + +config section + option name 'route6' + option title 'Static IPv6 route definition' + option package 'network' + +config variable + option name 'interface' + option title 'Interface' + option section 'network.route6' + option valueof 'network.interface' + option required 'true' + +config variable + option name 'target' + option title 'Target IPv6 host or network (CIDR)' + option section 'network.route6' + option datatype 'ip6addr' + option required 'true' + +config variable + option name 'gateway' + option title 'IPv6 gateway' + option section 'network.route6' + option datatype 'ip6addr' + option required 'true' + +config variable + option name 'metric' + option title 'Metric' + option section 'network.route6' + option datatype 'uint' + config section diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua b/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua index aa32324e69..a236e8c196 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua @@ -16,35 +16,61 @@ m = Map("network", translate("a_n_routes"), translate("a_n_routes1")) if not arg or not arg[1] then local routes = luci.sys.net.routes() - + v = m:section(Table, routes, translate("a_n_routes_kernel4")) - + net = v:option(DummyValue, "iface", translate("network")) function net.cfgvalue(self, section) return luci.tools.webadmin.iface_get_network(routes[section].Iface) or routes[section].Iface end - + target = v:option(DummyValue, "target", translate("target")) function target.cfgvalue(self, section) return luci.ip.Hex(routes[section].Destination, 32):string() end - + netmask = v:option(DummyValue, "netmask", translate("netmask")) function netmask.cfgvalue(self, section) return luci.ip.Hex(routes[section].Mask, 32):string() end - + gateway = v:option(DummyValue, "gateway", translate("gateway")) function gateway.cfgvalue(self, section) return luci.ip.Hex(routes[section].Gateway, 32):string() end - + + metric = v:option(DummyValue, "Metric", translate("metric")) + + + local routes6 = luci.sys.net.routes6() + + v = m:section(Table, routes6, translate("a_n_routes_kernel6")) + + net = v:option(DummyValue, "iface", translate("network")) + function net.cfgvalue(self, section) + return luci.tools.webadmin.iface_get_network(routes6[section].device) + or routes6[section].device + end + + target = v:option(DummyValue, "target", translate("target")) + function target.cfgvalue(self, section) + return routes6[section].dst_ip .. "/" .. routes6[section].dst_prefix + end + + gateway = v:option(DummyValue, "gateway", translate("gateway6")) + function gateway.cfgvalue(self, section) + return routes6[section].src_ip .. "/" .. routes6[section].src_prefix + end + metric = v:option(DummyValue, "Metric", translate("metric")) + function metric.cfgvalue(self, section) + return string.format( "%08X", routes6[section].metric ) + end end -s = m:section(TypedSection, "route", translate("a_n_routes_static")) +s = m:section(TypedSection, "route", translate("a_n_routes_static4")) s.addremove = true s.anonymous = true @@ -63,4 +89,23 @@ s:option(Value, "netmask", translate("netmask"), translate("a_n_r_netmask1")).rm s:option(Value, "gateway", translate("gateway")) -return m \ No newline at end of file + +s = m:section(TypedSection, "route6", translate("a_n_routes_static6")) +s.addremove = true +s.anonymous = true + +s.template = "cbi/tblsection" + +iface = s:option(ListValue, "interface", translate("interface")) +luci.tools.webadmin.cbi_add_networks(iface) + +if not arg or not arg[1] then + net.titleref = iface.titleref +end + +s:option(Value, "target", translate("target"), translate("a_n_r_target6")) + +s:option(Value, "gateway", translate("gateway6")).rmempty = true + + +return m -- 2.30.2