blob: 6b425d2db4a063e84da88aaefec1a331d314b144 [file] [log] [blame]
James Kuszmaul82f6c042021-01-17 11:30:16 -08001/**
2 * @file re_turn.h Interface to TURN implementation
3 *
4 * Copyright (C) 2010 Creytiv.com
5 */
6
7
8/** TURN Protocol values */
9enum {
10 TURN_DEFAULT_LIFETIME = 600, /**< Default lifetime is 10 minutes */
11 TURN_MAX_LIFETIME = 3600 /**< Maximum lifetime is 1 hour */
12};
13
14typedef void(turnc_h)(int err, uint16_t scode, const char *reason,
15 const struct sa *relay_addr,
16 const struct sa *mapped_addr,
17 const struct stun_msg *msg,
18 void *arg);
19typedef void(turnc_perm_h)(void *arg);
20typedef void(turnc_chan_h)(void *arg);
21
22struct turnc;
23
24int turnc_alloc(struct turnc **turncp, const struct stun_conf *conf, int proto,
25 void *sock, int layer, const struct sa *srv,
26 const char *username, const char *password,
27 uint32_t lifetime, turnc_h *th, void *arg);
28int turnc_send(struct turnc *turnc, const struct sa *dst, struct mbuf *mb);
29int turnc_recv(struct turnc *turnc, struct sa *src, struct mbuf *mb);
30int turnc_add_perm(struct turnc *turnc, const struct sa *peer,
31 turnc_perm_h *ph, void *arg);
32int turnc_add_chan(struct turnc *turnc, const struct sa *peer,
33 turnc_chan_h *ch, void *arg);