net::/ipv4:: namespace, mac/addr filter framework with default filters, dlog on registry overflow
This commit is contained in:
@@ -35,10 +35,10 @@ bool is_member_mac(const eth::mac_addr& mac) {
|
||||
}
|
||||
|
||||
static void send_report(const ipv4::ip4_addr& group) {
|
||||
const auto& ns = net_get_state();
|
||||
const auto& ns = net::get_state();
|
||||
prepend_buffer<4096> buf;
|
||||
prepend_report(buf, ns.mac, ns.ip, group);
|
||||
net_send_raw(buf.span());
|
||||
net::send_raw(buf.span());
|
||||
}
|
||||
|
||||
void join(const ipv4::ip4_addr& group) {
|
||||
@@ -82,6 +82,8 @@ void handle(std::span<const uint8_t> frame, span_writer& tx) {
|
||||
__attribute__((constructor))
|
||||
static void register_protocol() {
|
||||
ipv4::register_protocol(2, handle);
|
||||
net::register_mac_filter(is_member_mac);
|
||||
ipv4::register_addr_filter(is_member);
|
||||
}
|
||||
|
||||
bool parse_report(std::span<const uint8_t> frame, ipv4::ip4_addr& group) {
|
||||
|
||||
Reference in New Issue
Block a user