Drop send_raw parameter threading: arp/icmp/igmp/ipv4 call net_send_raw directly
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#include "icmp.h"
|
||||
#include <cstring>
|
||||
#include "ipv4.h"
|
||||
#include "net.h"
|
||||
#include "parse_buffer.h"
|
||||
#include "prepend_buffer.h"
|
||||
|
||||
namespace icmp {
|
||||
|
||||
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);
|
||||
auto* eth_hdr = pb.consume<eth::header>();
|
||||
auto* ip = pb.consume<ipv4::header>();
|
||||
@@ -34,7 +34,7 @@ void handle(std::span<const uint8_t> frame, span_writer& tx,
|
||||
reply->checksum = ipv4::checksum(reply, icmp_len);
|
||||
|
||||
ipv4::prepend(buf, eth_hdr->src, our_mac, our_ip, ip->src, 1, icmp_len);
|
||||
send_raw(buf.span());
|
||||
net_send_raw(buf.span());
|
||||
}
|
||||
|
||||
bool parse_echo_reply(std::span<const uint8_t> frame, ipv4::ip4_addr& src_ip, uint16_t expected_id) {
|
||||
|
||||
Reference in New Issue
Block a user