Overflow detection, span-based signatures, flatten control flow
This commit is contained in:
@@ -4,13 +4,14 @@
|
||||
#include <functional>
|
||||
#include <span>
|
||||
#include "span_writer.h"
|
||||
#include "msgpack.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)>;
|
||||
using net_handler = std::function<msgpack::result<size_t>(std::span<const uint8_t> payload, span_writer &out)>;
|
||||
|
||||
bool net_init();
|
||||
const net_state& net_get_state();
|
||||
|
||||
Reference in New Issue
Block a user