1
0
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:
Matias Fontanini
2013-03-24 00:08:53 -03:00
parent 584fe81f04
commit d7dd1e131f
12 changed files with 386 additions and 113 deletions

View File

@@ -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;
}