Permission
Permission
#include <icy/turn/permission.h>A single TURN permission entry associating a peer IP with a 5-minute expiry timer. Per RFC 5766 section 8, permissions last exactly 300 seconds and must be refreshed via a new CreatePermission request before they expire.
Public Attributes
| Return | Name | Description |
|---|---|---|
std::string | ip | IPv4 address string of the permitted peer. |
Key | key | Binary IP key for allocation hot-path comparisons. |
Timeout | timeout | Countdown timer; expires after PERMISSION_LIFETIME milliseconds. |
ip
std::string ipIPv4 address string of the permitted peer.
key
Key keyBinary IP key for allocation hot-path comparisons.
timeout
Timeout timeoutCountdown timer; expires after PERMISSION_LIFETIME milliseconds.
Public Methods
| Return | Name | Description |
|---|---|---|
Permission inline | Constructs a permission for ip and immediately starts the expiry timer. | |
Permission inline | Constructs a permission from a binary socket address. | |
void | refresh inline | Resets the expiry timer, extending the permission lifetime by another 300 seconds. |
bool | operator== const inline | Equality comparison against an IP string. |
bool | matches const inline | Binary IP comparison used on the TURN relay hot path. |
Permission
inline
inline Permission(const std::string & ip)Constructs a permission for ip and immediately starts the expiry timer.
Parameters
ipIPv4 address string of the permitted peer.
Permission
inline
inline Permission(const net::Address & address)Constructs a permission from a binary socket address.
Parameters
addressPeer IP address; port is ignored.
refresh
inline
inline void refresh()Resets the expiry timer, extending the permission lifetime by another 300 seconds.
operator==
const inline
inline bool operator==(std::string_view r) constEquality comparison against an IP string.
Parameters
rIPv4 address string to compare against.
Returns
true if this permission's IP matches r.
matches
const inline
inline bool matches(const net::Address & address) constBinary IP comparison used on the TURN relay hot path.
