Strip non-MACRAW enums, unused macros, and set_socket_dest_mac

This commit is contained in:
Ian Gulliver
2026-04-10 21:42:20 +09:00
parent 394628b8da
commit 0d41f63533
3 changed files with 0 additions and 45 deletions

View File

@@ -13,55 +13,21 @@ enum class socket_id : uint8_t {};
enum class sock_error : int16_t {
busy = 0,
sock_num = -1,
sock_opt = -2,
sock_init = -3,
sock_closed = -4,
sock_mode = -5,
sock_flag = -6,
sock_status = -7,
arg = -10,
port_zero = -11,
ip_invalid = -12,
timeout = -13,
data_len = -14,
buffer = -15,
fatal_packlen = -1001,
};
enum class protocol : uint8_t {
tcp = 0x01,
udp = 0x02,
ipraw = 0x03,
macraw = 0x07,
tcp6 = 0x09,
udp6 = 0x0A,
ipraw6 = 0x0B,
tcp_dual = 0x0D,
udp_dual = 0x0E,
};
enum class sock_flag : uint8_t {
none = 0,
multi_enable = 1 << 7,
ether_own = 1 << 7,
broad_block = 1 << 6,
tcp_fpsh = 1 << 6,
tcp_nodelay = 1 << 5,
igmp_ver2 = 1 << 5,
solicit_block = 1 << 5,
ether_multi4b = 1 << 5,
uni_block = 1 << 4,
ether_multi6b = 1 << 4,
force_arp = 1 << 0,
dha_manual = 1 << 1,
io_nonblock = 1 << 3,
};
constexpr sock_flag operator|(sock_flag a, sock_flag b) {
return static_cast<sock_flag>(static_cast<uint8_t>(a) | static_cast<uint8_t>(b));
}
constexpr uint8_t operator&(sock_flag a, sock_flag b) {
return static_cast<uint8_t>(a) & static_cast<uint8_t>(b);
}
enum class sock_io_mode : uint8_t {
block = 0,
@@ -93,7 +59,6 @@ std::expected<uint16_t, sock_error> send(socket_id sn, std::span<const uint8_t>
std::expected<uint16_t, sock_error> recv(socket_id sn, std::span<uint8_t> buf);
std::expected<void, sock_error> set_socket_io_mode(socket_id sn, sock_io_mode mode);
void set_socket_dest_mac(socket_id sn, const std::array<uint8_t, 6>& mac);
uint16_t get_socket_recv_buf(socket_id sn);
} // namespace w6300