Drop send_raw parameter threading: arp/icmp/igmp/ipv4 call net_send_raw directly

This commit is contained in:
Ian Gulliver
2026-04-17 14:35:10 -07:00
parent cdc113285a
commit e2daf04bed
10 changed files with 30 additions and 45 deletions

View File

@@ -1,4 +1,5 @@
#include "arp.h"
#include "net.h"
#include "parse_buffer.h"
#include "prepend_buffer.h"
@@ -10,8 +11,7 @@ static constexpr uint16_t ARP_OP_REQUEST = __builtin_bswap16(1);
static constexpr uint16_t ARP_OP_REPLY = __builtin_bswap16(2);
void handle(std::span<const uint8_t> frame, span_writer& tx,
eth::mac_addr our_mac, ipv4::ip4_addr our_ip,
std::function<void(std::span<const uint8_t>)> send_raw) {
eth::mac_addr our_mac, ipv4::ip4_addr our_ip) {
parse_buffer pb(frame);
pb.consume<eth::header>();
auto* arp_hdr = pb.consume<header>();
@@ -36,7 +36,7 @@ void handle(std::span<const uint8_t> frame, span_writer& tx,
reply->tpa = arp_hdr->spa;
eth::prepend(buf, arp_hdr->sha, our_mac, eth::ETH_ARP);
send_raw(buf.span());
net_send_raw(buf.span());
}
} // namespace arp