Permission
Permission
#include <icy/turn/permission.h>struct PermissionDefined in src/turn/include/icy/turn/permission.h:37
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.
List of all members
| Name | Kind | Owner |
|---|---|---|
ip | variable | Declared here |
key | variable | Declared here |
timeout | variable | Declared here |
Permission | function | Declared here |
Permission | function | Declared here |
refresh | function | Declared here |
operator== | function | Declared here |
matches | function | Declared here |
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 ipDefined in src/turn/include/icy/turn/permission.h:100
IPv4 address string of the permitted peer.
key
Key keyDefined in src/turn/include/icy/turn/permission.h:101
Binary IP key for allocation hot-path comparisons.
timeout
Timeout timeoutDefined in src/turn/include/icy/turn/permission.h:102
Countdown 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)Defined in src/turn/include/icy/turn/permission.h:106
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)Defined in src/turn/include/icy/turn/permission.h:116
Constructs a permission from a binary socket address.
Parameters
addressPeer IP address; port is ignored.
refresh
inline
inline void refresh()Defined in src/turn/include/icy/turn/permission.h:125
Resets the expiry timer, extending the permission lifetime by another 300 seconds.
operator==
const inline
inline bool operator==(std::string_view r) constDefined in src/turn/include/icy/turn/permission.h:130
Equality 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) constDefined in src/turn/include/icy/turn/permission.h:133
Binary IP comparison used on the TURN relay hot path.
