A frame entering a port may only leave through the ports ticked in its row.
+The cell of the port itself is always allowed.
+A LAG needs at least one member to be saved in the startup config; applying an empty group clears it.
diff --git a/httpd/httpd.c b/httpd/httpd.c index b31ec320..770eaa39 100644 --- a/httpd/httpd.c +++ b/httpd/httpd.c @@ -1026,6 +1026,8 @@ void httpd_appcall(void) l2_delete(short_parsed); } else if (is_word(q, "/mirror.json")) { send_mirror(); + } else if (is_word(q, "/isolation.json")) { + send_isolation(); } else if (is_word(q, "/mtu.json")) { send_mtu(); } else if (is_word(q, "/lag.json")) { diff --git a/httpd/page_impl.c b/httpd/page_impl.c index 6b108895..fe5ccced 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -863,6 +863,29 @@ void send_storm(void) } +void send_isolation(void) +{ + __xdata uint16_t allow; + + dbg_string("send_isolation called\n"); + slen = strtox(outbuf, HTTP_RESPONCE_JSON); + char_to_html('['); + for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { + slen += strtox(outbuf + slen, "{\"portNum\":"); + itoa_html(machine.log_to_phys_port[i]); + slen += strtox(outbuf + slen, ",\"allow\":\""); + allow = port_isolation_get(i); + byte_to_html(allow >> 8); + byte_to_html(allow & 0xff); + char_to_html('"'); + char_to_html('}'); + if (i < machine.max_port) + char_to_html(','); + } + char_to_html(']'); +} + + void send_mtu(void) { dbg_string("send_mtu called\n"); diff --git a/httpd/page_impl.h b/httpd/page_impl.h index b8df7af9..d6690dc6 100644 --- a/httpd/page_impl.h +++ b/httpd/page_impl.h @@ -18,6 +18,7 @@ void send_l2(uint16_t idx); void l2_delete(uint16_t idx); void send_mirror(void); void send_mtu(void); +void send_isolation(void); void send_config(void); void send_cmd_log(void); void send_lag(void); diff --git a/test/test_httpd_tx.c b/test/test_httpd_tx.c index f64cf5fc..c7ccf09c 100644 --- a/test/test_httpd_tx.c +++ b/test/test_httpd_tx.c @@ -140,6 +140,7 @@ void send_vlan(uint16_t vlan) { (void)vlan; } void send_basic_info(void) { } void send_bandwidth(void) { } void send_storm(void) { } +void send_isolation(void) { } void send_eee(void) { } void send_l2(uint16_t idx) { (void)idx; } void l2_delete(uint16_t idx) { (void)idx; }