Skip to content

Commit

Permalink
luci-app-lldpd: RPCd backend change from Lua to ucode
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Küthe <m.k@mk16.de>
  • Loading branch information
marek22k committed Jul 30, 2023
1 parent c8d2262 commit 3cadcb9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 94 deletions.
2 changes: 1 addition & 1 deletion applications/luci-app-lldpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI support for LLDP daemon
LUCI_DEPENDS:=+lldpd +luci-lua-runtime
LUCI_DEPENDS:=+lldpd +rpcd-mod-ucode

PKG_LICENSE:=MIT

Expand Down
93 changes: 0 additions & 93 deletions applications/luci-app-lldpd/root/usr/libexec/rpcd/lldpd

This file was deleted.

22 changes: 22 additions & 0 deletions applications/luci-app-lldpd/root/usr/share/rpcd/ucode/lldpd
Original file line number Diff line number Diff line change
@@ -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")
};
}
}
}
};

0 comments on commit 3cadcb9

Please sign in to comment.