Implementing basic LLDP server, should send port_id message

to each port once every 30 seconds.
* Additionally fixes the on-ward passing of LLDP frames through
the switch

The ports on the case are marked 1-8 so this should reflect that
rather than being 0-based

We can send the hostname as well, this can be dynamically allocated

Let's send the model as the system description as well
This commit is contained in:
Rob Emery committed 2026-10-10 09:49:24 +01:00
1 parent ff57084799
commit 1ebee4d6e9
6 files changed
+241

No files matched your search

+10
View File
@@ -16,6 +16,7 @@
#include "rtl837x_stp.h"
#include "rtl837x_igmp.h"
#include "rtl837x_bandwidth.h"
#include "rtl837x_lldp.h"
#include "rtl837x_storm.h"
#include "sfp.h"
#include "dhcp.h"
@@ -32,6 +33,7 @@
extern __code const struct machine machine;
extern __xdata bool stp_enabled;
extern __code const uint8_t log_to_phys_port[9];
extern __xdata uint8_t lldp_enabled;
extern volatile __xdata uint32_t ticks;
extern volatile __xdata uint8_t sfr_data[4];
@@ -2024,6 +2026,14 @@ void cmd_parser(void) __banked
parse_ingress();
} else if (cmd_compare(0, "session")) {
parse_session();
} else if (cmd_compare(0, "lldp")) {
if (cmd_compare(1, "on")) {
print_string("LLDP enabled\n");
lldp_enabled = 1;
} else {
print_string("LLDP disabled\n");
lldp_enabled = 0;
}
}
else {
cmd_error("Unknown command\n");