summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd')
-rw-r--r--applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd22
1 files changed, 22 insertions, 0 deletions
diff --git a/applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd b/applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd
new file mode 100644
index 0000000000..a35376f871
--- /dev/null
+++ b/applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd
@@ -0,0 +1,22 @@
+'use strict';
+
+import { popen } from 'fs';
+
+function lldpcli_json(section) {
+ return json(popen(`lldpcli -f json0 show ${section}`, 'r'));
+}
+
+return {
+ lldpd: {
+ getStatus: {
+ call: function() {
+ return {
+ statistics: lldpcli_json("statistics"),
+ neighbors: lldpcli_json("neighbors details"),
+ interfaces: lldpcli_json("interfaces"),
+ chassis: lldpcli_json("chassis")
+ };
+ }
+ }
+ }
+};