mirror of
https://github.com/mfontanini/libtins
synced 2026-01-29 04:54:28 +01:00
Added method in TCP and IP that emplaces an option.
This commit is contained in:
14
include/ip.h
14
include/ip.h
@@ -426,6 +426,20 @@ namespace Tins {
|
||||
internal_add_option(opt);
|
||||
_ip_options.push_back(std::move(opt));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Adds an IP option.
|
||||
*
|
||||
* The option is constructed from the provided parameters.
|
||||
*
|
||||
* \param args The arguments to be used in the option's
|
||||
* constructor.
|
||||
*/
|
||||
template<typename... Args>
|
||||
void add_option(Args&&... args) {
|
||||
_ip_options.emplace_back(std::forward<Args>(args)...);
|
||||
internal_add_option(_ip_options.back());
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -409,6 +409,20 @@ namespace Tins {
|
||||
internal_add_option(opt);
|
||||
_options.push_back(std::move(opt));
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Adds a TCP option using the provided arguments.
|
||||
*
|
||||
* The option is constructed from the provided parameters.
|
||||
*
|
||||
* \param args The arguments to be used in the option's
|
||||
* constructor.
|
||||
*/
|
||||
template<typename... Args>
|
||||
void add_option(Args&&... args) {
|
||||
_options.emplace_back(std::forward<Args>(args)...);
|
||||
internal_add_option(_options.back());
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user