]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
web-user-interface: Add lldp.cgi
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Nov 2025 16:46:54 +0000 (16:46 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 7 Nov 2025 11:22:05 +0000 (11:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
22 files changed:
config/rootfiles/common/web-user-interface
doc/language_issues.de
doc/language_issues.en
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
doc/language_issues.tw
doc/language_issues.zh
doc/language_missings
html/cgi-bin/lldp.cgi [new file with mode: 0644]
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
langs/es/cgi-bin/es.pl
langs/fr/cgi-bin/fr.pl
langs/nl/cgi-bin/nl.pl
langs/pl/cgi-bin/pl.pl
langs/ru/cgi-bin/ru.pl
langs/tr/cgi-bin/tr.pl

index aa31491d24e1022febaf1ff4fdc2db45eece1ec5..29fb52c2876b5e31d440800db0950d122690202f 100644 (file)
@@ -29,6 +29,7 @@ srv/web/ipfire/cgi-bin/index.cgi
 srv/web/ipfire/cgi-bin/ipblocklist.cgi
 srv/web/ipfire/cgi-bin/ipinfo.cgi
 srv/web/ipfire/cgi-bin/iptables.cgi
+srv/web/ipfire/cgi-bin/lldp.cgi
 srv/web/ipfire/cgi-bin/location-block.cgi
 srv/web/ipfire/cgi-bin/logs.cgi
 srv/web/ipfire/cgi-bin/logs.cgi/calamaris.dat
index ed9c2044940a7cf7cca7586da05d201f09222e10..37be0c63c1bff7e59cbf4b625119b3ab728e36f2 100644 (file)
@@ -218,7 +218,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
index e40571450c51cccf7c93757c5b20180edcd93e59..b2250d8afa51839bacd4215f7538542955d7f99c 100644 (file)
@@ -548,6 +548,7 @@ WARNING: untranslated string: default IP address = Default IP Address
 WARNING: untranslated string: default lease time = Default lease time (mins):
 WARNING: untranslated string: default renewal time = Default Renewal Time
 WARNING: untranslated string: delete = Delete
+WARNING: untranslated string: description = Description
 WARNING: untranslated string: desired = Desired
 WARNING: untranslated string: dest ip and port = Dest. IP: Port
 WARNING: untranslated string: destination = Destination
@@ -1235,6 +1236,9 @@ WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: legend = Legend
 WARNING: untranslated string: lifetime = Lifetime:
 WARNING: untranslated string: link-layer encapsulation = Link-Layer Encapsulation
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local ip address = Local IP Address
 WARNING: untranslated string: local ntp server specified but not enabled = Local NTP server specified but not enabled
@@ -1558,7 +1562,7 @@ WARNING: untranslated string: profile name = Profile name:
 WARNING: untranslated string: profile name not given = Profile name not given.
 WARNING: untranslated string: profile saved = Profile saved: 
 WARNING: untranslated string: proto = Proto
-WARNING: untranslated string: protocol = Protocol:
+WARNING: untranslated string: protocol = Protocol
 WARNING: untranslated string: proxy admin password = Cache administrator password
 WARNING: untranslated string: proxy cachemgr = Activate cachemanager
 WARNING: untranslated string: proxy errmsg filedescriptors = Wrong amount of filedescriptors
@@ -2140,6 +2144,7 @@ WARNING: untranslated string: version = Version
 WARNING: untranslated string: virtual address = Virtual Address
 WARNING: untranslated string: virtual private networking = Virtual Private Networking
 WARNING: untranslated string: visit us at = Visit us at
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpi number = VPI number:
 WARNING: untranslated string: vpn = VPN
 WARNING: untranslated string: vpn altname syntax = SubjectAltName is a comma separated list of email, dns, uri, rid and ip objects.<br />email:an email address. Syntax email:copy takes the email field from the cert to be used.<br />DNS:a valid domain name.<br />URI:any valid uri.<br />RID:registered object identifier.<br />IP:an IP address.<br />Note:charset is limited and case is significant.<br />Example:<br /><b>email:</b>ipfire@foo.org<b>,email:</b>copy<b>,DNS:</b>www.ipfire.org<b>,IP:</b>127.0.0.1<b>,URI:</b>http://url/to/something
index ffb077eb042d065e437201984e1b2957a153b3e3..48c69f189394f9b044d5f3a4dece063a5d8abd2c 100644 (file)
@@ -240,7 +240,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1075,6 +1074,9 @@ WARNING: untranslated string: ids reports weekly = Send a weekly report
 WARNING: untranslated string: ids send email on alert = Send email on alert
 WARNING: untranslated string: indirect target selection = Indirect target selection
 WARNING: untranslated string: info messages = unknown string
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: mdstat = Mdstat
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: offloaded = Offloaded
@@ -1107,6 +1109,7 @@ WARNING: untranslated string: rss = RSS
 WARNING: untranslated string: rss long = Resident Set Size
 WARNING: untranslated string: smt not implemented = Not Implemented
 WARNING: untranslated string: transient sheduler attacks = Transient sheduler attacks
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn deprecated = Deprecated
 WARNING: untranslated string: wio = unknown string
 WARNING: untranslated string: wio checked = unknown string
index 2dbaeb3bcfbb718276821fd4ba9a6bbc089124ad..28408469c984574f229613b05380f2ef77937b6c 100644 (file)
@@ -240,7 +240,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1071,6 +1070,9 @@ WARNING: untranslated string: invalid keepalive interval = Invalid Keepalive Int
 WARNING: untranslated string: invalid network = Invalid Network
 WARNING: untranslated string: ips throughput = Throughput
 WARNING: untranslated string: last updated = Last Updated
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local port = Local Port
 WARNING: untranslated string: local subnets = Local Subnets
@@ -1120,6 +1122,7 @@ WARNING: untranslated string: system time = System Time (as of last page load)
 WARNING: untranslated string: timeformat = %Y-%m-%d at %H:%M:%S %Z
 WARNING: untranslated string: total = Total
 WARNING: untranslated string: transient sheduler attacks = Transient sheduler attacks
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn deprecated = Deprecated
 WARNING: untranslated string: warning = Warning
 WARNING: untranslated string: wg client pool = Client Pool
index 4b168598686b33a519337e58ef5dba4261466cc2..e1a71dea09724cc7b1b7d8688e274da921b9ed33 100644 (file)
@@ -208,7 +208,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1263,6 +1262,9 @@ WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: itlb multihit = iTLB MultiHit
 WARNING: untranslated string: last updated = Last Updated
 WARNING: untranslated string: link-layer encapsulation = Link-Layer Encapsulation
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local ip address = Local IP Address
 WARNING: untranslated string: local port = Local Port
@@ -1437,6 +1439,7 @@ WARNING: untranslated string: updxlrtr passive mode = Delivery only/no download
 WARNING: untranslated string: uplink bit rate = Uplink Bit Rate
 WARNING: untranslated string: user management = User Management
 WARNING: untranslated string: version = Version
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn broken = Broken
 WARNING: untranslated string: vpn connecting = CONNECTING
 WARNING: untranslated string: vpn deprecated = Deprecated
index 0857c00ce9f7127eb6b519731135ab272d790ee0..2a5f24b9d7b6efa1c6738f136e553c101b8f8cc7 100644 (file)
@@ -209,7 +209,6 @@ WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: demon login script
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1270,6 +1269,9 @@ WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: itlb multihit = iTLB MultiHit
 WARNING: untranslated string: last updated = Last Updated
 WARNING: untranslated string: link-layer encapsulation = Link-Layer Encapsulation
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local ip address = Local IP Address
 WARNING: untranslated string: local port = Local Port
@@ -1457,6 +1459,7 @@ WARNING: untranslated string: updxlrtr passive mode = Delivery only/no download
 WARNING: untranslated string: uplink bit rate = Uplink Bit Rate
 WARNING: untranslated string: user management = User Management
 WARNING: untranslated string: vendor = Vendor
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn broken = Broken
 WARNING: untranslated string: vpn connecting = CONNECTING
 WARNING: untranslated string: vpn deprecated = Deprecated
index b005b9946bf3ce2b37bfc6ee6b9af843a3043825..570f4a3d56222e7b7505c43b0752a8d7c36b53ae 100644 (file)
@@ -193,7 +193,6 @@ WARNING: translation string unused: delete cron
 WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1399,6 +1398,9 @@ WARNING: untranslated string: last updated = Last Updated
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
 WARNING: untranslated string: link-layer encapsulation = Link-Layer Encapsulation
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local ip address = Local IP Address
 WARNING: untranslated string: local port = Local Port
@@ -1675,6 +1677,7 @@ WARNING: untranslated string: user management = User Management
 WARNING: untranslated string: vendor = Vendor
 WARNING: untranslated string: version = Version
 WARNING: untranslated string: visit us at = Visit us at
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn broken = Broken
 WARNING: untranslated string: vpn connecting = CONNECTING
 WARNING: untranslated string: vpn deprecated = Deprecated
index 46aa8120f45e2a47ea511592e16c773b7fb92b1f..272998de3b2832ee2d5ea4182433a1235d8a1d9f 100644 (file)
@@ -192,7 +192,6 @@ WARNING: translation string unused: delete cron
 WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1398,6 +1397,9 @@ WARNING: untranslated string: last updated = Last Updated
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
 WARNING: untranslated string: link-layer encapsulation = Link-Layer Encapsulation
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local ip address = Local IP Address
 WARNING: untranslated string: local port = Local Port
@@ -1674,6 +1676,7 @@ WARNING: untranslated string: user management = User Management
 WARNING: untranslated string: vendor = Vendor
 WARNING: untranslated string: version = Version
 WARNING: untranslated string: visit us at = Visit us at
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn broken = Broken
 WARNING: untranslated string: vpn connecting = CONNECTING
 WARNING: untranslated string: vpn deprecated = Deprecated
index 8e3eb45cbe5aca5bdc8bfb5776fac128d930462c..3b30c7d4cd97fca41d75ef23e090a8f6d337480b 100644 (file)
@@ -230,7 +230,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1201,6 +1200,9 @@ WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: itlb multihit = iTLB MultiHit
 WARNING: untranslated string: last updated = Last Updated
 WARNING: untranslated string: link-layer encapsulation = Link-Layer Encapsulation
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: load average = Load Average
 WARNING: untranslated string: local ip address = Local IP Address
 WARNING: untranslated string: local port = Local Port
@@ -1334,6 +1336,7 @@ WARNING: untranslated string: transport mode does not support vti = VTI is not s
 WARNING: untranslated string: updxlrtr passive mode = Delivery only/no download mode
 WARNING: untranslated string: user management = User Management
 WARNING: untranslated string: version = Version
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn deprecated = Deprecated
 WARNING: untranslated string: vpn start action add = Wait for connection initiation
 WARNING: untranslated string: vpn subjectaltname missing = SubjectAlternativeName cannot be emtpy.
index 2a058e7205fe070cde8f86843c64ec050803a7ac..9fe0df551c7f320a3c9faba09b08f104d81cb0ee 100644 (file)
@@ -242,7 +242,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1083,6 +1082,9 @@ WARNING: untranslated string: ids reports weekly = Send a weekly report
 WARNING: untranslated string: ids send email on alert = Send email on alert
 WARNING: untranslated string: indirect target selection = Indirect target selection
 WARNING: untranslated string: info messages = unknown string
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: max bandwidth = Maximum bandwidth
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: offloaded = Offloaded
@@ -1125,6 +1127,7 @@ WARNING: untranslated string: rss = RSS
 WARNING: untranslated string: rss long = Resident Set Size
 WARNING: untranslated string: smt not implemented = Not Implemented
 WARNING: untranslated string: transient sheduler attacks = Transient sheduler attacks
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn deprecated = Deprecated
 WARNING: untranslated string: wio = unknown string
 WARNING: untranslated string: wio checked = unknown string
index 2a058e7205fe070cde8f86843c64ec050803a7ac..9fe0df551c7f320a3c9faba09b08f104d81cb0ee 100644 (file)
@@ -242,7 +242,6 @@ WARNING: translation string unused: delete pc
 WARNING: translation string unused: delete share
 WARNING: translation string unused: delete user
 WARNING: translation string unused: deprecated fs warn
-WARNING: translation string unused: description
 WARNING: translation string unused: destination ip bad
 WARNING: translation string unused: destination ip or net
 WARNING: translation string unused: destination net
@@ -1083,6 +1082,9 @@ WARNING: untranslated string: ids reports weekly = Send a weekly report
 WARNING: untranslated string: ids send email on alert = Send email on alert
 WARNING: untranslated string: indirect target selection = Indirect target selection
 WARNING: untranslated string: info messages = unknown string
+WARNING: untranslated string: lldp = Link Layer Discovery Protocol
+WARNING: untranslated string: lldp neighbors = Neighbors
+WARNING: untranslated string: lldp there are no neighbors = There are currently no neighbors
 WARNING: untranslated string: max bandwidth = Maximum bandwidth
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: offloaded = Offloaded
@@ -1125,6 +1127,7 @@ WARNING: untranslated string: rss = RSS
 WARNING: untranslated string: rss long = Resident Set Size
 WARNING: untranslated string: smt not implemented = Not Implemented
 WARNING: untranslated string: transient sheduler attacks = Transient sheduler attacks
+WARNING: untranslated string: vlan = VLAN
 WARNING: untranslated string: vpn deprecated = Deprecated
 WARNING: untranslated string: wio = unknown string
 WARNING: untranslated string: wio checked = unknown string
index 24602b7d193730a2c28311b916b59ed446c8561d..bb07f3fab0cf9ef0154eaa91b5efb430e6c6f608 100644 (file)
 < ids reports weekly
 < ids send email on alert
 < indirect target selection
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < mdstat
 < offloaded
 < online
 < rss long
 < smt not implemented
 < transient sheduler attacks
+< vlan
 < vpn deprecated
 < wlanap 802.11ac
 < wlanap 802.11ac 160mhz
 < invalid network
 < ips throughput
 < last updated
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < load average
 < local port
 < local subnets
 < total
 < transient sheduler attacks
 < upload fcdsl.o
+< vlan
 < vpn deprecated
 < warning
 < wg
 < last updated
 < legacy architecture warning
 < link-layer encapsulation
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < load average
 < local ip address
 < local port
 < uplink bit rate
 < user management
 < version
+< vlan
 < vpn broken
 < vpn connecting
 < vpn deprecated
 < last updated
 < legacy architecture warning
 < link-layer encapsulation
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < load average
 < local ip address
 < local port
 < uplink bit rate
 < user management
 < vendor
+< vlan
 < vpn broken
 < vpn connecting
 < vpn deprecated
 < legacy architecture warning
 < lifetime
 < link-layer encapsulation
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < load average
 < local ip address
 < local port
 < vendor
 < version
 < visit us at
+< vlan
 < vpn broken
 < vpn connecting
 < vpn deprecated
 < legacy architecture warning
 < lifetime
 < link-layer encapsulation
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < load average
 < local ip address
 < local port
 < vendor
 < version
 < visit us at
+< vlan
 < vpn broken
 < vpn connecting
 < vpn deprecated
 < last updated
 < legacy architecture warning
 < link-layer encapsulation
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < load average
 < local ip address
 < local port
 < updxlrtr passive mode
 < user management
 < version
+< vlan
 < vpn deprecated
 < vpn start action add
 < vpn subjectaltname missing
 < ids reports weekly
 < ids send email on alert
 < indirect target selection
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < max bandwidth
 < offloaded
 < online
 < rss long
 < smt not implemented
 < transient sheduler attacks
+< vlan
 < vpn deprecated
 < wlanap 802.11ac
 < wlanap 802.11ac 160mhz
 < ids reports weekly
 < ids send email on alert
 < indirect target selection
+< lldp
+< lldp neighbors
+< lldp there are no neighbors
 < max bandwidth
 < offloaded
 < online
 < rss long
 < smt not implemented
 < transient sheduler attacks
+< vlan
 < vpn deprecated
 < wlanap 802.11ac
 < wlanap 802.11ac 160mhz
diff --git a/html/cgi-bin/lldp.cgi b/html/cgi-bin/lldp.cgi
new file mode 100644 (file)
index 0000000..755d3dc
--- /dev/null
@@ -0,0 +1,240 @@
+#!/usr/bin/perl
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2025 Michael Tremer <michael.tremer@ipfire.org>               #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+use strict;
+use JSON::PP;
+
+# enable only the following on debugging purpose
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
+
+require "/var/ipfire/general-functions.pl";
+require "${General::swroot}/header.pl";
+
+my %cgiparams = ();
+my @errormessages = ();
+
+# Fetch CGI parameters
+&Header::getcgihash(\%cgiparams, {'wantfile' => 1, 'filevar' => 'FH'});
+
+# Read the settings
+my %settings = ();
+&General::readhash("${General::swroot}/lldp/settings", \%settings);
+
+# Save on main page
+if ($cgiparams{"ACTION"} eq $Lang::tr{'save'}) {
+       # Store whether enabled or not
+       if ($cgiparams{'ENABLED'} =~ m/^(on|off)?$/) {
+               $settings{'ENABLED'} = $cgiparams{'ENABLED'};
+       }
+
+       # XXX Validate the description
+       $settings{"DESCRIPTION"} = $cgiparams{"DESCRIPTION"};
+
+       # Don't continue on error
+       goto MAIN if (scalar @errormessages);
+
+       # Store the configuration file
+       &General::writehash("${General::swroot}/lldp/settings", \%settings);
+
+       # Start if enabled
+       if ($settings{"ENABLED"} eq "on") {
+               &General::system("/usr/local/bin/lldpdctrl", "restart");
+       } else {
+               &General::system("/usr/local/bin/lldpdctrl", "stop");
+       }
+}
+
+# The main page starts here
+MAIN:
+       # Send HTTP Headers
+       &Header::showhttpheaders();
+
+       # Open the page
+       &Header::openpage($Lang::tr{'lldp'}, 1, '');
+
+       # Show any error messages
+       &Header::errorbox(@errormessages);
+
+       # Open a box for Global Settings
+       &Header::openbox('100%', '', $Lang::tr{'global settings'});
+
+       my %checked = (
+               "ENABLED" => ($settings{"ENABLED"} eq "on") ? "checked" : "",
+       );
+
+       print <<END;
+               <form method="POST" action="">
+                       <table class="form">
+                               <tr>
+                                       <td>$Lang::tr{'enabled'}</td>
+                                       <td>
+                                               <input type="checkbox" name="ENABLED" $checked{'ENABLED'} />
+                                       </td>
+                               </tr>
+
+                               <tr>
+                                       <td>$Lang::tr{'description'}</td>
+                                       <td>
+                                               <input type="text" name="DESCRIPTION" value="$settings{'DESCRIPTION'}" />
+                                       </td>
+                               </tr>
+
+                               <tr class="action">
+                                       <td colspan="2">
+                                               <input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
+                                       </td>
+                               </tr>
+                       </table>
+               </form>
+END
+       &Header::closebox();
+
+       # Load data about all peers
+       my @output = &General::system_output("lldpctl", "-f", "json0");
+
+       my $json;
+
+       # Parse the JSON output
+       eval {
+               $json = decode_json join("\n", @output);
+               1;
+       } or do {
+               $json = undef;
+       };
+
+       # Show a list with all peers if the service is enabled
+       if ($settings{"ENABLED"} eq "on") {
+               &Header::opensection($Lang::tr{'lldp neighbors'});
+
+               # Fetch the interface object
+               my $interface = $json->{"lldp"}[0]->{"interface"};
+
+               print <<END;
+                       <table class='tbl'>
+                               <tr>
+                                       <th>
+                                               $Lang::tr{'name'}
+                                       </th>
+
+                                       <th>
+                                               $Lang::tr{'interface'}
+                                       </th>
+
+                                       <th>
+                                               $Lang::tr{'port'}
+                                       </th>
+
+                                       <th style="text-align: right;">
+                                               $Lang::tr{'vlan'}
+                                       </th>
+
+                                       <th>
+                                               $Lang::tr{'protocol'}
+                                       </th>
+
+                                       <th>
+                                               $Lang::tr{'description'}
+                                       </th>
+                               </tr>
+END
+
+                               foreach my $peer (@{ $interface }) {
+                                       my $intf = $peer->{"name"};
+                                       my $proto = $peer->{"via"};
+                                       my $name = "";
+                                       my $descr = "";
+                                       my $port_name = "";
+                                       my $vlan_id = "";
+
+                                       # Fetch the chassis
+                                       foreach my $chassis (@{ $peer->{"chassis"} }) {
+                                               $name = &Header::escape(
+                                                       $chassis->{"name"}[0]->{"value"}
+                                               );;
+                                               $descr = &Header::escape(
+                                                       $chassis->{"descr"}[0]->{"value"}
+                                               );
+
+                                               # Replace any line breaks in the description
+                                               $descr =~ s/\n/<br>/g;
+                                       }
+
+                                       # Fetch the port
+                                       foreach my $port (@{ $peer->{"port"} }) {
+                                               $port_name = $port->{"descr"}[0]->{"value"};
+                                       }
+
+                                       # Fetch the VLAN
+                                       foreach my $vlan (@{ $peer->{"vlan"} }) {
+                                               $vlan_id = $vlan->{"vlan-id"};
+                                       }
+
+                                       print <<END;
+                                               <tr>
+                                                       <th scope="row">
+                                                               $name
+                                                       </th>
+
+                                                       <td>
+                                                               $intf
+                                                       </td>
+
+                                                       <td>
+                                                               $port_name
+                                                       </td>
+
+                                                       <td style="text-align: right;">
+                                                               $vlan_id
+                                                       </td>
+
+                                                       <td>
+                                                               $proto
+                                                       </td>
+
+                                                       <td>
+                                                               $descr
+                                                       </td>
+                                               </tr>
+END
+                               }
+
+                               # Show a message if there are no neighbors
+                               unless (scalar @{ $interface }) {
+                                       print <<END;
+                                               <tr>
+                                                       <td colspan="6" style="text-align: center;">
+                                                               $Lang::tr{'lldp there are no neighbors'}
+                                                       </td>
+                                               </tr>
+END
+                               }
+
+               print <<END;
+                       </table>
+END
+
+               &Header::closesection();
+       }
+
+       &Header::closepage();
+
+       exit(0);
index 55804a89726663db751258a0de763db91b04bf67..132c04ff1736ead77411c954aa3b57ca9d7a9ff3 100644 (file)
 'lifetime' => 'Lebensdauer:',
 'line' => 'Leitung',
 'linkq' => 'Antwortzeit',
+'lldp' => 'Link-Layer-Discovery-Protokoll',
+'lldp neighbors' => 'Nachbarn',
+'lldp there are no neighbors' => 'Aktuell gibt es keine Nachbarn',
 'load average' => 'Load Average',
 'load printer' => 'Lade Drucker',
 'loaded modules' => 'Geladene Module:',
 'profile saved' => 'Profil gespeichert: ',
 'profiles' => 'Profile:',
 'proto' => 'Proto',
-'protocol' => 'Protokoll:',
+'protocol' => 'Protokoll',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Diagramme zur Proxyauslastung',
 'proxy admin password' => 'Cache Administrator Passwort',
 'virtual private networking' => 'Virtuelles Privates Netzwerk',
 'visible in browselist' => 'Sichtbar in der Verzeichnisliste',
 'visit us at' => 'Besuchen Sie uns auf',
+'vlan' => 'VLAN',
 'voldown10' => 'Laustärke um 10 verringern',
 'voldown5' => 'Laustärke um 5 verringern',
 'volup10' => 'Laustärke um 10 erhöhen',
index 08967bc8457f71f435e1e602a0c42cd0130e303a..9cef3edd2abbc5f562061d5660dc86eb784253b5 100644 (file)
 'line' => 'Line',
 'link-layer encapsulation' => 'Link-Layer Encapsulation',
 'linkq' => 'Link Quality',
+'lldp' => 'Link Layer Discovery Protocol',
+'lldp neighbors' => 'Neighbors',
+'lldp there are no neighbors' => 'There are currently no neighbors',
 'load average' => 'Load Average',
 'load printer' => 'Load Printer',
 'loaded modules' => 'Loaded modules:',
 'profile saved' => 'Profile saved: ',
 'profiles' => 'Profiles:',
 'proto' => 'Proto',
-'protocol' => 'Protocol:',
+'protocol' => 'Protocol',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Proxy access graphs',
 'proxy admin password' => 'Cache administrator password',
 'virtual private networking' => 'Virtual Private Networking',
 'visible in browselist' => 'visible in browselist',
 'visit us at' => 'Visit us at',
+'vlan' => 'VLAN',
 'voldown10' => 'Decrease volume by 10',
 'voldown5' => 'Decrease volume by 5',
 'volup10' => 'Increase volume by 10',
index a4764e6cb7480f58481869abf8de66b4b0d5fd3d..fb529805eab47797666db515faf2d9980cd58e02 100644 (file)
 'profile saved' => 'Perfil guardado:',
 'profiles' => 'Perfiles:',
 'proto' => 'Proto',
-'protocol' => 'Protocolo:',
+'protocol' => 'Protocolo',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Gráficas de acceso al proxy',
 'proxy admin password' => 'Contraseña del Administrador del Caché',
index a7085b773ed11c8908718999d9fb47cc1e805304..57db1f39489e644390b089424093190eac370ba6 100644 (file)
 'profile saved' => 'Profil sauvegardé:',
 'profiles' => 'Profils :',
 'proto' => 'Proto',
-'protocol' => 'Protocole :',
+'protocol' => 'Protocole',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Graphiques des accès proxy',
 'proxy admin password' => 'Mot de passe admnistrateur du cache',
index 17db7389f66371bd9410b89c40387550a97276ae..c4612da4a06ff5c0e8dcde1557e77165db079420 100644 (file)
 'profile saved' => 'Profiel opgeslagen: ',
 'profiles' => 'Profielen:',
 'proto' => 'Proto',
-'protocol' => 'Protocol:',
+'protocol' => 'Protocol',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Proxy toegangsgrafieken',
 'proxy admin password' => 'Cache beheerder wachtwoord',
index 0326a37e67eb315d9aaabcff548f6e1fcb77d03a..0972de0b31fd646c2d68c84ef8ed91fd9636d776 100644 (file)
 'profile saved' => 'Zapisano profil: ',
 'profiles' => 'Profile:',
 'proto' => 'Proto',
-'protocol' => 'Protokół:',
+'protocol' => 'Protokół',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Wykresy dostępu do Proxy',
 'proxy admin password' => 'Hasło administratora Cache',
index ae4450fe3d6423306f631d06c95c4b5b3ab60025..8472e1fdeae56954851e104dbec1fa3df3c80526 100644 (file)
 'profile saved' => 'Профиль сохранён: ',
 'profiles' => 'Профили:',
 'proto' => 'Proto',
-'protocol' => 'Протокол:',
+'protocol' => 'Протокол',
 'proxy' => 'Proxy',
 'proxy access graphs' => 'Proxy access graphs',
 'proxy admin password' => 'Cache administrator password',
index ad8fec7eb86c7582c70b7474969419a398970284..320ff2018ec9ccce5f3d084c79eb505191799f59 100644 (file)
 'profile saved' => 'Kaydedilen profiller: ',
 'profiles' => 'Profiller:',
 'proto' => 'Kural',
-'protocol' => 'Kural ',
+'protocol' => 'Kural',
 'proxy' => 'Vekil sunucu',
 'proxy access graphs' => 'Vekil sunucu erişim grafiği',
 'proxy admin password' => 'Önbellek yönetici parolası',