Shared Catalog
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <modulus/types.hpp>
|
||||
|
||||
|
||||
struct ip_addr_t {
|
||||
std::uint32_t addr{};
|
||||
};
|
||||
|
||||
constexpr auto IPADDR_TYPE_V4 = std::uint8_t{0};
|
||||
|
||||
auto ipaddr_aton(std::char_t const *text, ip_addr_t *address) -> std::int32_t;
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <modulus/types.hpp>
|
||||
|
||||
|
||||
struct pbuf {
|
||||
pbuf *next{};
|
||||
void const *payload{};
|
||||
std::uint16_t tot_len{};
|
||||
std::uint16_t len{};
|
||||
std::bool_t freed{};
|
||||
};
|
||||
|
||||
auto pbuf_copy_partial(pbuf const *buffer, void *destination, std::uint16_t length, std::uint16_t offset) -> std::uint16_t;
|
||||
auto pbuf_free(pbuf *buffer) -> std::uint8_t;
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <lwip/ip_addr.h>
|
||||
#include <lwip/pbuf.h>
|
||||
|
||||
constexpr auto ERR_OK = std::int8_t{0};
|
||||
constexpr auto ERR_MEM = std::int8_t{-1};
|
||||
constexpr auto ERR_ABRT = std::int8_t{-13};
|
||||
constexpr auto ERR_RST = std::int8_t{-14};
|
||||
constexpr auto TCP_WRITE_FLAG_COPY = std::uint8_t{1};
|
||||
|
||||
struct tcp_pcb {
|
||||
void *argument{};
|
||||
std::int8_t (*receive)(void *, tcp_pcb *, pbuf *, std::int8_t){};
|
||||
std::int8_t (*sent)(void *, tcp_pcb *, std::uint16_t){};
|
||||
std::int8_t (*poll)(void *, tcp_pcb *){};
|
||||
void (*error)(void *, std::int8_t){};
|
||||
std::int8_t (*connected)(void *, tcp_pcb *, std::int8_t){};
|
||||
std::bool_t alive{};
|
||||
};
|
||||
|
||||
auto tcp_new_ip_type(std::uint8_t type) -> tcp_pcb *;
|
||||
auto tcp_arg(tcp_pcb *pcb, void *argument) -> void;
|
||||
auto tcp_recv(tcp_pcb *pcb, std::int8_t (*callback)(void *, tcp_pcb *, pbuf *, std::int8_t)) -> void;
|
||||
auto tcp_sent(tcp_pcb *pcb, std::int8_t (*callback)(void *, tcp_pcb *, std::uint16_t)) -> void;
|
||||
auto tcp_poll(tcp_pcb *pcb, std::int8_t (*callback)(void *, tcp_pcb *), std::uint8_t interval) -> void;
|
||||
auto tcp_err(tcp_pcb *pcb, void (*callback)(void *, std::int8_t)) -> void;
|
||||
auto tcp_connect(tcp_pcb *pcb, ip_addr_t const *address, std::uint16_t port, std::int8_t (*callback)(void *, tcp_pcb *, std::int8_t)) -> std::int8_t;
|
||||
auto tcp_write(tcp_pcb *pcb, void const *data, std::uint16_t size, std::uint8_t flags) -> std::int8_t;
|
||||
auto tcp_output(tcp_pcb *pcb) -> std::int8_t;
|
||||
auto tcp_recved(tcp_pcb *pcb, std::uint16_t size) -> void;
|
||||
auto tcp_close(tcp_pcb *pcb) -> std::int8_t;
|
||||
auto tcp_abort(tcp_pcb *pcb) -> void;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
auto cyw43_arch_lwip_begin() -> void;
|
||||
auto cyw43_arch_lwip_end() -> void;
|
||||
Reference in New Issue
Block a user