mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-02-20 07:13:49 -07:00
Common/Network: Allow passing std::span to DHCPPacket::AddOption.
This commit is contained in:
parent
f509199b03
commit
9bc96893fb
@ -278,7 +278,7 @@ DHCPPacket::DHCPPacket(const std::vector<u8>& data)
|
||||
}
|
||||
}
|
||||
|
||||
void DHCPPacket::AddOption(u8 fnc, const std::vector<u8>& params)
|
||||
void DHCPPacket::AddOption(u8 fnc, std::span<const u8> params)
|
||||
{
|
||||
if (params.size() > 255)
|
||||
return;
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
@ -180,7 +181,15 @@ struct DHCPPacket
|
||||
{
|
||||
DHCPPacket();
|
||||
DHCPPacket(const std::vector<u8>& data);
|
||||
void AddOption(u8 fnc, const std::vector<u8>& params);
|
||||
|
||||
void AddOption(u8 fnc, std::span<const u8> params);
|
||||
|
||||
template <std::size_t N>
|
||||
void AddOption(u8 fnc, const u8 (&data)[N])
|
||||
{
|
||||
AddOption(fnc, std::span(data));
|
||||
}
|
||||
|
||||
std::vector<u8> Build() const;
|
||||
|
||||
DHCPBody body;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user