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:
@@ -227,7 +227,18 @@ bool ICMPv6::has_options() const {
|
||||
}
|
||||
|
||||
void ICMPv6::add_option(const icmpv6_option &option) {
|
||||
internal_add_option(option);
|
||||
_options.push_back(option);
|
||||
}
|
||||
|
||||
#if TINS_IS_CXX11
|
||||
void ICMPv6::add_option(icmpv6_option &&option) {
|
||||
internal_add_option(option);
|
||||
_options.push_back(std::move(option));
|
||||
}
|
||||
#endif
|
||||
|
||||
void ICMPv6::internal_add_option(const icmpv6_option &option) {
|
||||
_options_size += option.data_size() + sizeof(uint8_t) * 2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user