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

@@ -17,4 +17,12 @@ struct __attribute__((packed)) header {
};
static_assert(sizeof(header) == 14);
template <typename Buf>
void prepend(Buf& buf, const mac_addr& dst, const mac_addr& src, uint16_t ethertype) {
auto* h = buf.template prepend<header>();
h->dst = dst;
h->src = src;
h->ethertype = ethertype;
}
} // namespace eth