mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
* stp: select the root port by cost and block redundant links * stp: move the protocol to BANK4 and keep the command line in BANK2 * stp: implement the RSTP state machines of 802.1D-2004 clause 17 * stp: counters, more settings and a fuller Spanning Tree page * stp: make a link aggregation group one port of the RSTP tree * web: serve the Spanning Tree JSON from BANK4 as well Kept in BANK1, the larger Spanning Tree page would leave under 1 kB there for the rest of the web server and every page still to come, so send_stp() and send_stp_counters() move to httpd/page_stp.c in BANK4 with the protocol, as banked calls, with their own copies of the few output helpers and of the JSON header, so nothing in BANK4 calls into BANK1 directly or hands it a pointer into its code space. BANK4 takes the free flash between BANK3 and the web files. KP_9000_6XHML_X2: BANK1 44336, BANK2 36969, BANK3 11942, BANK4 20965 bytes of 49152.
47 lines
1011 B
C
47 lines
1011 B
C
#ifndef __PAGE_IMPL_H__
|
|
#define __PAGE_IMPL_H__
|
|
|
|
#include <stdbool.h>
|
|
|
|
extern __code const uint8_t * __code const HTTP_RESPONCE_TXT;
|
|
|
|
void itoa16_html(uint16_t v);
|
|
|
|
bool send_counters(uint8_t phys_port);
|
|
void send_status(void);
|
|
void send_vlan(uint16_t vlan);
|
|
void send_basic_info(void);
|
|
void send_bandwidth(void);
|
|
void send_storm(void);
|
|
void send_eee(void);
|
|
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);
|
|
void send_stp(void) __banked;
|
|
void send_lldp(void);
|
|
void send_lacp(void);
|
|
void send_stp_counters(void) __banked;
|
|
void send_vlanlist(void);
|
|
|
|
/* Convert only the lower nibble to ascii HEX char.
|
|
For convenience the upper nibble is masked out.
|
|
*/
|
|
inline char itohex(uint8_t val) {
|
|
// Ignore upper nibble for convenience.
|
|
val &= 0x0f;
|
|
val -= 10;
|
|
|
|
// 10 or above
|
|
if ((int8_t)val >= 0)
|
|
val += ('a' - '0' - 10);
|
|
|
|
return val + ('0' + 10);
|
|
}
|
|
|
|
#endif
|