mirror of
https://github.com/mfontanini/libtins
synced 2026-01-27 04:11: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:
@@ -103,11 +103,22 @@ void Dot11::add_tagged_option(TaggedOption opt, uint8_t len, const uint8_t *val)
|
||||
_options_size += opt_size;
|
||||
}
|
||||
|
||||
void Dot11::add_tagged_option(const dot11_option &opt) {
|
||||
_options.push_back(opt);
|
||||
#if TINS_IS_CXX11
|
||||
void Dot11::add_tagged_option(dot11_option &&opt) {
|
||||
internal_add_option(opt);
|
||||
_options.push_back(std::move(opt));
|
||||
}
|
||||
#endif
|
||||
|
||||
void Dot11::internal_add_option(const dot11_option &opt) {
|
||||
_options_size += opt.data_size() + sizeof(uint8_t) * 2;
|
||||
}
|
||||
|
||||
void Dot11::add_tagged_option(const dot11_option &opt) {
|
||||
internal_add_option(opt);
|
||||
_options.push_back(opt);
|
||||
}
|
||||
|
||||
const Dot11::dot11_option *Dot11::search_option(TaggedOption opt) const {
|
||||
for(std::list<dot11_option>::const_iterator it = _options.begin(); it != _options.end(); ++it)
|
||||
if(it->option() == (uint8_t)opt)
|
||||
|
||||
Reference in New Issue
Block a user