Add IGMP, prepend_buffer/parse_buffer, split UDP header, discovery tests, test all

This commit is contained in:
Ian Gulliver
2026-04-11 09:04:55 +09:00
parent e486f6501a
commit a6225faa2b
17 changed files with 582 additions and 183 deletions

View File

@@ -7,8 +7,7 @@
namespace arp {
struct __attribute__((packed)) packet {
eth::header eth;
struct __attribute__((packed)) header {
uint16_t htype;
uint16_t ptype;
uint8_t hlen;
@@ -19,7 +18,7 @@ struct __attribute__((packed)) packet {
eth::mac_addr tha;
ipv4::ip4_addr tpa;
};
static_assert(sizeof(packet) == 42);
static_assert(sizeof(header) == 28);
void handle(std::span<const uint8_t> frame, span_writer& tx,
eth::mac_addr our_mac, ipv4::ip4_addr our_ip,