ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_layer3_switch.h
Go to the documentation of this file.
1
24
25#pragma once
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include <stdint.h>
32
33#include "ra8_err.h"
34
39typedef struct {
40 uint8_t port_count;
41 uint16_t mtu_bytes;
42 uint8_t promiscuous;
44
49typedef struct {
50 uint32_t dst_ip;
51 uint32_t mask;
52 uint8_t egress_port;
54
75
94
112[[nodiscard]] ra8_err_t ra8_layer3_switch_route_delete(uint32_t dst_ip, uint32_t mask);
113
131[[nodiscard]] ra8_err_t ra8_layer3_switch_status_get(uint8_t* out_open, uint8_t* out_promisc);
132
148[[nodiscard]] ra8_err_t ra8_layer3_switch_close(void);
149
150#ifdef __cplusplus
151}
152#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_layer3_switch_close(void)
Close the Layer-3 switch driver.
ra8_err_t ra8_layer3_switch_open(const ra8_layer3_switch_cfg_t *cfg)
Open the Layer-3 switch driver.
ra8_err_t ra8_layer3_switch_route_add(const ra8_layer3_switch_route_t *route)
Add a route to the forwarding table.
ra8_err_t ra8_layer3_switch_status_get(uint8_t *out_open, uint8_t *out_promisc)
Snapshot the open / promiscuous flags.
ra8_err_t ra8_layer3_switch_route_delete(uint32_t dst_ip, uint32_t mask)
Remove a route from the forwarding table.
Configuration descriptor for ra8_layer3_switch_open.
uint16_t mtu_bytes
Maximum transfer unit per port.
uint8_t promiscuous
Non-zero to put switch in promisc.
uint8_t port_count
Number of physical ports.
A single forwarding-table entry.
uint32_t dst_ip
Destination IPv4 (network order).
uint8_t egress_port
Egress port index.
uint32_t mask
Subnet mask.