Drop send_raw parameter threading: arp/icmp/igmp/ipv4 call net_send_raw directly
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
#include <span>
|
||||
#include "eth.h"
|
||||
#include "ipv4.h"
|
||||
@@ -21,7 +20,6 @@ struct __attribute__((packed)) header {
|
||||
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,
|
||||
std::function<void(std::span<const uint8_t>)> send_raw);
|
||||
eth::mac_addr our_mac, ipv4::ip4_addr our_ip);
|
||||
|
||||
} // namespace arp
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <span>
|
||||
#include "eth.h"
|
||||
#include "ipv4.h"
|
||||
@@ -18,8 +17,7 @@ struct __attribute__((packed)) echo {
|
||||
static_assert(sizeof(echo) == 8);
|
||||
|
||||
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);
|
||||
|
||||
template <typename Buf>
|
||||
void prepend_echo_request(Buf& buf,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <span>
|
||||
#include "eth.h"
|
||||
#include "ipv4.h"
|
||||
@@ -24,15 +23,12 @@ bool is_member(const ipv4::ip4_addr& ip);
|
||||
bool is_member_mac(const eth::mac_addr& mac);
|
||||
|
||||
void join(const ipv4::ip4_addr& group,
|
||||
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);
|
||||
|
||||
void send_all_reports(eth::mac_addr our_mac, ipv4::ip4_addr our_ip,
|
||||
std::function<void(std::span<const uint8_t>)> send_raw);
|
||||
void send_all_reports(eth::mac_addr our_mac, ipv4::ip4_addr our_ip);
|
||||
|
||||
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);
|
||||
|
||||
template <typename Buf>
|
||||
void prepend_report(Buf& buf, const eth::mac_addr& src_mac, ipv4::ip4_addr src_ip,
|
||||
|
||||
@@ -58,7 +58,6 @@ void prepend(Buf& buf, const eth::mac_addr& dst_mac, const eth::mac_addr& src_ma
|
||||
|
||||
void handle(std::span<const uint8_t> frame, span_writer& tx,
|
||||
eth::mac_addr our_mac, ip4_addr our_ip, ip4_addr subnet_broadcast,
|
||||
std::function<void(std::span<const uint8_t>)> send_raw,
|
||||
std::function<void(std::span<const uint8_t>, span_writer&)> handle_udp);
|
||||
|
||||
} // namespace ipv4
|
||||
|
||||
Reference in New Issue
Block a user