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_config.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_CONFIG_H__
20#define __PJNATH_STUN_CONFIG_H__
21
27#include <pjnath/stun_msg.h>
28#include <pj/assert.h>
29#include <pj/errno.h>
30#include <pj/string.h>
31
32
34
35
36/* **************************************************************************/
47typedef struct pj_stun_config
48{
53
58
63
67 unsigned options;
68
73 unsigned rto_msec;
74
82
89
91
92
93
98 pj_pool_factory *factory,
99 unsigned options,
100 pj_ioqueue_t *ioqueue,
101 pj_timer_heap_t *timer_heap)
102{
103 pj_bzero(cfg, sizeof(*cfg));
104
105 cfg->pf = factory;
106 cfg->options = options;
107 cfg->ioqueue = ioqueue;
108 cfg->timer_heap = timer_heap;
112}
113
114
119{
120 PJ_ASSERT_RETURN(cfg->ioqueue && cfg->pf && cfg->timer_heap &&
121 cfg->rto_msec && cfg->res_cache_msec, PJ_EINVAL);
122 return PJ_SUCCESS;
123}
124
125
132
133
134#endif /* __PJNATH_STUN_CONFIG_H__ */
135
#define PJ_STUN_RES_CACHE_DURATION
Definition: config.h:107
#define PJ_STUN_RTO_VALUE
Definition: config.h:75
#define PJNATH_STUN_SOFTWARE_NAME
Definition: config.h:571
void pj_stun_config_init(pj_stun_config *cfg, pj_pool_factory *factory, unsigned options, pj_ioqueue_t *ioqueue, pj_timer_heap_t *timer_heap)
Definition: stun_config.h:97
pj_status_t pj_stun_config_check_valid(const pj_stun_config *cfg)
Definition: stun_config.h:118
struct pj_ioqueue_t pj_ioqueue_t
int pj_status_t
struct pj_timer_heap_t pj_timer_heap_t
PJ_SUCCESS
pj_str_t pj_str(char *str)
void pj_bzero(void *dst, pj_size_t size)
#define PJ_ASSERT_RETURN(expr, retval)
#define PJ_BEGIN_DECL
#define PJ_INLINE(type)
#define PJ_END_DECL
#define PJ_EINVAL
Definition: stun_config.h:48
pj_timer_heap_t * timer_heap
Definition: stun_config.h:62
pj_pool_factory * pf
Definition: stun_config.h:52
pj_ioqueue_t * ioqueue
Definition: stun_config.h:57
pj_str_t software_name
Definition: stun_config.h:88
unsigned res_cache_msec
Definition: stun_config.h:81
unsigned rto_msec
Definition: stun_config.h:73
unsigned options
Definition: stun_config.h:67
STUN message components.

 


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