WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJNATH Reference

stun_sock.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJNATH_STUN_SOCK_H__
20#define __PJNATH_STUN_SOCK_H__
21
26#include <pjnath/stun_config.h>
27#include <pjlib-util/resolver.h>
28#include <pj/ioqueue.h>
29#include <pj/lock.h>
30#include <pj/sock.h>
31#include <pj/sock_qos.h>
32
33
35
36
62
68typedef enum pj_stun_sock_op
69{
74
79
85
90
91
93
94
99typedef struct pj_stun_sock_cb
100{
116 void *pkt,
117 unsigned pkt_len,
118 const pj_sockaddr_t *src_addr,
119 unsigned addr_len);
120
139 pj_ssize_t sent);
140
171 pj_status_t status);
172
174
175
180typedef struct pj_stun_sock_info
181{
186
191
198
203 unsigned alias_cnt;
204
209
211
212
218typedef struct pj_stun_sock_cfg
219{
227
233 unsigned max_pkt_size;
234
242 unsigned async_cnt;
243
253
262
270
279
288
296
306
316
318
319
320
324PJ_DECL(const char*) pj_stun_sock_op_name(pj_stun_sock_op op);
325
326
333
334
357 const char *name,
358 int af,
359 const pj_stun_sock_cb *cb,
360 const pj_stun_sock_cfg *cfg,
361 void *user_data,
362 pj_stun_sock **p_sock);
363
364
396 const pj_str_t *domain,
397 pj_uint16_t default_port,
398 pj_dns_resolver *resolver);
399
409
410
422 void *user_data);
423
432PJ_DECL(void*) pj_stun_sock_get_user_data(pj_stun_sock *stun_sock);
433
434
443
444
456 pj_stun_sock_info *info);
457
458
481 const void *pkt,
482 unsigned pkt_len,
483 unsigned flag,
484 const pj_sockaddr_t *dst_addr,
485 unsigned addr_len);
486
493
494
495#endif /* __PJNATH_STUN_SOCK_H__ */
496
#define PJ_ICE_ST_MAX_CAND
Definition: config.h:250
void * pj_stun_sock_get_user_data(pj_stun_sock *stun_sock)
pj_status_t pj_stun_sock_create(pj_stun_config *stun_cfg, const char *name, int af, const pj_stun_sock_cb *cb, const pj_stun_sock_cfg *cfg, void *user_data, pj_stun_sock **p_sock)
void pj_stun_sock_cfg_default(pj_stun_sock_cfg *cfg)
pj_status_t pj_stun_sock_set_user_data(pj_stun_sock *stun_sock, void *user_data)
pj_status_t pj_stun_sock_sendto(pj_stun_sock *stun_sock, pj_ioqueue_op_key_t *send_key, const void *pkt, unsigned pkt_len, unsigned flag, const pj_sockaddr_t *dst_addr, unsigned addr_len)
pj_status_t pj_stun_sock_start(pj_stun_sock *stun_sock, const pj_str_t *domain, pj_uint16_t default_port, pj_dns_resolver *resolver)
pj_grp_lock_t * pj_stun_sock_get_grp_lock(pj_stun_sock *stun_sock)
pj_status_t pj_stun_sock_get_info(pj_stun_sock *stun_sock, pj_stun_sock_info *info)
const char * pj_stun_sock_op_name(pj_stun_sock_op op)
pj_status_t pj_stun_sock_destroy(pj_stun_sock *sock)
pj_stun_sock_op
Definition: stun_sock.h:69
struct pj_stun_sock pj_stun_sock
Definition: stun_sock.h:61
@ PJ_STUN_SOCK_MAPPED_ADDR_CHANGE
Definition: stun_sock.h:89
@ PJ_STUN_SOCK_DNS_OP
Definition: stun_sock.h:73
@ PJ_STUN_SOCK_KEEP_ALIVE_OP
Definition: stun_sock.h:84
@ PJ_STUN_SOCK_BINDING_OP
Definition: stun_sock.h:78
long pj_ssize_t
int pj_bool_t
unsigned short pj_uint16_t
void pj_sockaddr_t
int pj_status_t
struct pj_grp_lock_t pj_grp_lock_t
struct pj_dns_resolver pj_dns_resolver
#define PJ_BEGIN_DECL
#define PJ_END_DECL
pj_qos_type
Definition: stun_config.h:48
Definition: stun_sock.h:100
pj_bool_t(* on_status)(pj_stun_sock *stun_sock, pj_stun_sock_op op, pj_status_t status)
Definition: stun_sock.h:169
pj_bool_t(* on_rx_data)(pj_stun_sock *stun_sock, void *pkt, unsigned pkt_len, const pj_sockaddr_t *src_addr, unsigned addr_len)
Definition: stun_sock.h:115
pj_bool_t(* on_data_sent)(pj_stun_sock *stun_sock, pj_ioqueue_op_key_t *send_key, pj_ssize_t sent)
Definition: stun_sock.h:137
Definition: stun_sock.h:219
unsigned so_rcvbuf_size
Definition: stun_sock.h:305
pj_sockaddr bound_addr
Definition: stun_sock.h:252
unsigned max_pkt_size
Definition: stun_sock.h:233
pj_uint16_t port_range
Definition: stun_sock.h:261
int ka_interval
Definition: stun_sock.h:269
unsigned async_cnt
Definition: stun_sock.h:242
pj_qos_params qos_params
Definition: stun_sock.h:287
pj_qos_type qos_type
Definition: stun_sock.h:278
pj_grp_lock_t * grp_lock
Definition: stun_sock.h:226
pj_bool_t qos_ignore_error
Definition: stun_sock.h:295
unsigned so_sndbuf_size
Definition: stun_sock.h:315
Definition: stun_sock.h:181
unsigned alias_cnt
Definition: stun_sock.h:203
pj_sockaddr srv_addr
Definition: stun_sock.h:190
pj_sockaddr aliases[PJ_ICE_ST_MAX_CAND]
Definition: stun_sock.h:208
pj_sockaddr mapped_addr
Definition: stun_sock.h:197
pj_sockaddr bound_addr
Definition: stun_sock.h:185
STUN endpoint.

 


PJNATH - Open Source NAT traversal helper library supporting STUN, TURN, and ICE
Copyright (C) 2006-2009 Teluu Inc.