Fc26 Switch Nsp [ PRO ✰ ]
I will implement the "FC26 Switch NSP" feature. This involves adding a data structure to represent a network switch, creating functions to initialize and configure it, and providing a way to interact with it (like adding ports or showing status).
// MAC Table Entry typedef struct uint8_t mac_addr[MAC_ADDR_LEN]; uint8_t port_id; bool valid; nsp_mac_entry_t; fc26 switch nsp
// Port configuration struct typedef struct uint8_t id; bool is_up; // Link status bool enabled; // Admin status uint64_t rx_packets; uint64_t tx_packets; nsp_port_t; I will implement the "FC26 Switch NSP" feature
nsp_status_t fc26_nsp_set_port_state(fc26_switch_t *sw, uint8_t port_id, bool enabled) if (sw == NULL // Link status bool enabled
// Return codes typedef enum NSP_OK = 0, NSP_ERR_INVALID_PORT, NSP_ERR_PORT_DOWN, NSP_ERR_TABLE_FULL, NSP_ERR_NOT_FOUND nsp_status_t;