Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed variables in ns_turn_session.h and to bool #1427

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/ns_turn_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ int old_stun_is_command_message_str(const uint8_t *buf, size_t blen, uint32_t *c
return 0;
}

int stun_is_command_message_full_check_str(const uint8_t *buf, size_t blen, int must_check_fingerprint,
int *fingerprint_present) {
int stun_is_command_message_full_check_str(const uint8_t *buf, size_t blen, bool must_check_fingerprint,
bool *fingerprint_present) {
if (!stun_is_command_message_str(buf, blen)) {
return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions src/client/ns_turn_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "ns_turn_ioaddr.h"
#include "ns_turn_msg_defs.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -110,8 +111,8 @@ int stun_init_channel_message_str(uint16_t chnumber, uint8_t *buf, size_t *len,

int stun_is_command_message_str(const uint8_t *buf, size_t blen);
int old_stun_is_command_message_str(const uint8_t *buf, size_t blen, uint32_t *cookie);
int stun_is_command_message_full_check_str(const uint8_t *buf, size_t blen, int must_check_fingerprint,
int *fingerprint_present);
int stun_is_command_message_full_check_str(const uint8_t *buf, size_t blen, bool must_check_fingerprint,
bool *fingerprint_present);
int stun_is_command_message_offset_str(const uint8_t *buf, size_t blen, int offset);
int stun_is_request_str(const uint8_t *buf, size_t len);
int stun_is_success_response_str(const uint8_t *buf, size_t len);
Expand Down
19 changes: 10 additions & 9 deletions src/server/ns_turn_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "ns_turn_ioalib.h"
#include "ns_turn_maps.h"
#include "ns_turn_utils.h"
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -72,17 +73,17 @@ struct _ts_ur_super_session {
ioa_socket_handle client_socket;
allocation alloc;
ioa_timer_handle to_be_allocated_timeout_ev;
int enforce_fingerprints;
int is_tcp_relay;
int to_be_closed;
bool enforce_fingerprints;
bool is_tcp_relay;
bool to_be_closed;
/* Auth */
uint8_t nonce[NONCE_MAX_SIZE];
turn_time_t nonce_expiration_time;
uint8_t username[STUN_MAX_USERNAME_SIZE + 1];
hmackey_t hmackey;
int hmackey_set;
bool hmackey_set;
password_t pwd;
int quota_used;
bool quota_used;
int oauth;
turn_time_t max_session_time_auth;
/* Realm */
Expand Down Expand Up @@ -113,7 +114,7 @@ struct _ts_ur_super_session {
size_t peer_sent_rate;
size_t peer_total_rate;
/* Mobile */
int is_mobile;
bool is_mobile;
mobile_id_t mobile_id;
mobile_id_t old_mobile_id;
char s_mobile_id[33];
Expand All @@ -133,7 +134,7 @@ typedef struct _addr_data {

struct turn_session_info {
turnsession_id id;
int valid;
bool valid;
turn_time_t start_time;
turn_time_t expiration_time;
SOCKET_TYPE client_protocol;
Expand All @@ -145,7 +146,7 @@ struct turn_session_info {
addr_data relay_addr_data_ipv4;
addr_data relay_addr_data_ipv6;
uint8_t username[STUN_MAX_USERNAME_SIZE + 1];
int enforce_fingerprints;
bool enforce_fingerprints;
/* Stats */
uint64_t received_packets;
uint64_t sent_packets;
Expand All @@ -162,7 +163,7 @@ struct turn_session_info {
uint32_t peer_sent_rate;
uint32_t peer_total_rate;
/* Mobile */
int is_mobile;
bool is_mobile;
/* Peers */
addr_data main_peers_data[TURN_MAIN_PEERS_ARRAY_SIZE];
size_t main_peers_size;
Expand Down