James Kuszmaul | 82f6c04 | 2021-01-17 11:30:16 -0800 | [diff] [blame^] | 1 | /** |
| 2 | * @file re_turn.h Interface to TURN implementation |
| 3 | * |
| 4 | * Copyright (C) 2010 Creytiv.com |
| 5 | */ |
| 6 | |
| 7 | |
| 8 | /** TURN Protocol values */ |
| 9 | enum { |
| 10 | TURN_DEFAULT_LIFETIME = 600, /**< Default lifetime is 10 minutes */ |
| 11 | TURN_MAX_LIFETIME = 3600 /**< Maximum lifetime is 1 hour */ |
| 12 | }; |
| 13 | |
| 14 | typedef 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); |
| 19 | typedef void(turnc_perm_h)(void *arg); |
| 20 | typedef void(turnc_chan_h)(void *arg); |
| 21 | |
| 22 | struct turnc; |
| 23 | |
| 24 | int 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); |
| 28 | int turnc_send(struct turnc *turnc, const struct sa *dst, struct mbuf *mb); |
| 29 | int turnc_recv(struct turnc *turnc, struct sa *src, struct mbuf *mb); |
| 30 | int turnc_add_perm(struct turnc *turnc, const struct sa *peer, |
| 31 | turnc_perm_h *ph, void *arg); |
| 32 | int turnc_add_chan(struct turnc *turnc, const struct sa *peer, |
| 33 | turnc_chan_h *ch, void *arg); |