mirror of
https://github.com/mfontanini/libtins
synced 2026-01-25 11:41:35 +01:00
Added an overload of add_option that takes an rvalue-ref in IP, TCP, DHCP, ICMPv6 and Dot11.
This commit is contained in:
11
src/dhcp.cpp
11
src/dhcp.cpp
@@ -75,7 +75,18 @@ DHCP::DHCP(const uint8_t *buffer, uint32_t total_sz)
|
||||
}
|
||||
|
||||
void DHCP::add_option(const dhcp_option &option) {
|
||||
internal_add_option(option);
|
||||
_options.push_back(option);
|
||||
}
|
||||
|
||||
#if TINS_IS_CXX11
|
||||
void DHCP::add_option(dhcp_option &&option) {
|
||||
internal_add_option(option);
|
||||
_options.push_back(std::move(option));
|
||||
}
|
||||
#endif
|
||||
|
||||
void DHCP::internal_add_option(const dhcp_option &option) {
|
||||
_size += option.data_size() + (sizeof(uint8_t) << 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user