~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/pjnath/include/pjnath/stun_config.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: stun_config.h 3553 2011-05-05 06:14:19Z nanang $ */
2
 
/*
3
 
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
 
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
 */
20
 
#ifndef __PJNATH_STUN_CONFIG_H__
21
 
#define __PJNATH_STUN_CONFIG_H__
22
 
 
23
 
/**
24
 
 * @file stun_config.h
25
 
 * @brief STUN endpoint.
26
 
 */
27
 
 
28
 
#include <pjnath/stun_msg.h>
29
 
#include <pj/assert.h>
30
 
#include <pj/errno.h>
31
 
#include <pj/string.h>
32
 
 
33
 
 
34
 
PJ_BEGIN_DECL
35
 
 
36
 
 
37
 
/* **************************************************************************/
38
 
/**
39
 
 * @defgroup PJNATH_STUN_CONFIG STUN Config
40
 
 * @brief STUN config
41
 
 * @ingroup PJNATH_STUN_BASE
42
 
 * @{
43
 
 */
44
 
 
45
 
/**
46
 
 * STUN configuration.
47
 
 */
48
 
typedef struct pj_stun_config
49
 
{
50
 
    /**
51
 
     * Pool factory to be used.
52
 
     */
53
 
    pj_pool_factory     *pf;
54
 
 
55
 
    /**
56
 
     * Ioqueue.
57
 
     */
58
 
    pj_ioqueue_t        *ioqueue;
59
 
 
60
 
    /**
61
 
     * Timer heap instance.
62
 
     */
63
 
    pj_timer_heap_t     *timer_heap;
64
 
 
65
 
    /**
66
 
     * Options.
67
 
     */
68
 
    unsigned             options;
69
 
 
70
 
    /**
71
 
     * The default initial STUN round-trip time estimation in msecs.
72
 
     * The value normally is PJ_STUN_RTO_VALUE.
73
 
     */
74
 
    unsigned             rto_msec;
75
 
 
76
 
    /**
77
 
     * The interval to cache outgoing  STUN response in the STUN session,
78
 
     * in miliseconds.
79
 
     *
80
 
     * Default 10000 (10 seconds).
81
 
     */
82
 
    unsigned             res_cache_msec;
83
 
 
84
 
} pj_stun_config;
85
 
 
86
 
 
87
 
 
88
 
/**
89
 
 * Initialize STUN config.
90
 
 */
91
 
PJ_INLINE(void) pj_stun_config_init(pj_stun_config *cfg,
92
 
                                    pj_pool_factory *factory,
93
 
                                    unsigned options,
94
 
                                    pj_ioqueue_t *ioqueue,
95
 
                                    pj_timer_heap_t *timer_heap)
96
 
{
97
 
    pj_bzero(cfg, sizeof(*cfg));
98
 
 
99
 
    cfg->pf = factory;
100
 
    cfg->options = options;
101
 
    cfg->ioqueue = ioqueue;
102
 
    cfg->timer_heap = timer_heap;
103
 
    cfg->rto_msec = PJ_STUN_RTO_VALUE;
104
 
    cfg->res_cache_msec = PJ_STUN_RES_CACHE_DURATION;
105
 
}
106
 
 
107
 
 
108
 
/**
109
 
 * Check that STUN config is valid.
110
 
 */
111
 
PJ_INLINE(pj_status_t) pj_stun_config_check_valid(const pj_stun_config *cfg)
112
 
{
113
 
    PJ_ASSERT_RETURN(cfg->ioqueue && cfg->pf && cfg->timer_heap &&
114
 
                     cfg->rto_msec && cfg->res_cache_msec, PJ_EINVAL);
115
 
    return PJ_SUCCESS;
116
 
}
117
 
 
118
 
 
119
 
/**
120
 
 * @}
121
 
 */
122
 
 
123
 
 
124
 
PJ_END_DECL
125
 
 
126
 
 
127
 
#endif  /* __PJNATH_STUN_CONFIG_H__ */