19 lines
406 B
C++
19 lines
406 B
C++
#pragma once
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <functional>
|
|
#include <span>
|
|
#include "span_writer.h"
|
|
|
|
struct net_state {
|
|
std::array<uint8_t, 6> mac;
|
|
std::array<uint8_t, 4> ip;
|
|
};
|
|
|
|
using net_handler = std::function<size_t(std::span<const uint8_t> payload, span_writer &out)>;
|
|
|
|
bool net_init();
|
|
const net_state& net_get_state();
|
|
void net_set_handler(net_handler handler);
|
|
void net_poll();
|