TURN REST API client.
More...
#include <stdint.h>
#include <glib.h>
Go to the source code of this file.
Functions |
gint64 | janus_get_monotonic_time (void) |
| Helper to retrieve the system monotonic time, as Glib's g_get_monotonic_time may not be available (only since 2.28)
|
char * | janus_string_replace (char *message, const char *old_string, const char *new_string) G_GNUC_WARN_UNUSED_RESULT |
| Helper to replace strings.
|
gboolean | janus_is_true (const char *value) |
| Helper to parse yes/no|true/false configuration values.
|
gboolean | janus_strcmp_const_time (const void *str1, const void *str2) |
| Helper to compare strings in constant time.
|
int | janus_mkdir (const char *dir, mode_t mode) |
| Helper to create a new directory, and recursively create parent directories if needed.
|
int | janus_get_opus_pt (const char *sdp) |
| Ugly and dirty helper to quickly get the Opus payload type in an SDP.
|
int | janus_get_vp8_pt (const char *sdp) |
| Ugly and dirty helper to quickly get the VP8 payload type in an SDP.
|
gboolean | janus_is_ip_valid (const char *ip, int *family) |
| Check if the given IP address is valid: family is set to the address family if the IP is valid.
|
Detailed Description
TURN REST API client.
Utilities and helpers (headers)
TURN REST API client (headers)
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- GNU General Public License v3
Implementation of the draft-uberti-rtcweb-turn-rest-00
draft, that is a REST API that can be used to access TURN services, more specifically credentials to use. Currently implemented in both rfc5766-turn-server and coturn, and so should be generic enough to be usable here.
- Note
- This implementation depends on
libcurl
and is optional.
Core
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- GNU General Public License v3
Implementations of a few methods that may be of use here and there in the code.
Core
Typedef Documentation
Function Documentation
void janus_flags_clear |
( |
janus_flags * |
flags, |
|
|
uint32_t |
flag |
|
) |
| |
Janus flags clear method.
- Parameters
-
[in] | flags | The janus_flags instance to update |
[in] | flag | The flag to clear |
gboolean janus_flags_is_set |
( |
janus_flags * |
flags, |
|
|
uint32_t |
flag |
|
) |
| |
Janus flags check method.
- Parameters
-
[in] | flags | The janus_flags instance to check |
[in] | flag | The flag to check |
- Returns
- true if the flag is set, false otherwise
Janus flags reset method.
- Parameters
-
[in] | flags | The janus_flags instance to reset |
void janus_flags_set |
( |
janus_flags * |
flags, |
|
|
uint32_t |
flag |
|
) |
| |
Janus flags set method.
- Parameters
-
[in] | flags | The janus_flags instance to update |
[in] | flag | The flag to set |
gint64 janus_get_monotonic_time |
( |
void |
| ) |
|
Helper to retrieve the system monotonic time, as Glib's g_get_monotonic_time may not be available (only since 2.28)
- Returns
- The system monotonic time
int janus_get_opus_pt |
( |
const char * |
sdp | ) |
|
Ugly and dirty helper to quickly get the Opus payload type in an SDP.
- Parameters
-
- Returns
- The Opus payload type, if found, -1 otherwise
int janus_get_vp8_pt |
( |
const char * |
sdp | ) |
|
Ugly and dirty helper to quickly get the VP8 payload type in an SDP.
- Parameters
-
- Returns
- The VP8 payload type, if found, -1 otherwise
gboolean janus_is_ip_valid |
( |
const char * |
ip, |
|
|
int * |
family |
|
) |
| |
Check if the given IP address is valid: family is set to the address family if the IP is valid.
- Parameters
-
| ip | The IP address to check |
[in,out] | family | The address family of the address, set by the method if valid |
- Returns
- true if the address is valid, false otherwise
gboolean janus_is_true |
( |
const char * |
value | ) |
|
Helper to parse yes/no|true/false configuration values.
- Parameters
-
value | The configuration value to parse |
- Returns
- true if the value contains a "yes", "YES", "true", TRUE", "1", false otherwise
int janus_mkdir |
( |
const char * |
dir, |
|
|
mode_t |
mode |
|
) |
| |
Helper to create a new directory, and recursively create parent directories if needed.
- Parameters
-
dir | Path to the new folder to create |
mode | File permissions for the new directory file |
- Returns
- An integer like the regular mkdir does
- Note
- A failure may indicate that creating any of the subdirectories failed: some may still have been created
gboolean janus_strcmp_const_time |
( |
const void * |
str1, |
|
|
const void * |
str2 |
|
) |
| |
Helper to compare strings in constant time.
- Parameters
-
str1 | The first string to compare |
str2 | The second string to compare |
- Returns
- true if the strings are the same, false otherwise
char* janus_string_replace |
( |
char * |
message, |
|
|
const char * |
old_string, |
|
|
const char * |
new_string |
|
) |
| |
Helper to replace strings.
- Parameters
-
message | The string that contains the text to replace, which may be freed if it is too short |
old_string | The old text to replace |
new_string | The new text |
- Returns
- A pointer to the updated text string (re-allocated or just updated)