blob: de582c78d22eee4346def12d9b1d9c3399cc594f [file] [log] [blame]
Benny Prijonofb9d9872007-03-21 22:05:58 +00001/* $Id$ */
2/*
Benny Prijono844653c2008-12-23 17:27:53 +00003 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
Benny Prijonofb9d9872007-03-21 22:05:58 +00005 *
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#include <pjlib.h>
21#include <pjlib-util.h>
22#include <pjnath.h>
23
Benny Prijonoe2d0acb2007-09-18 19:33:33 +000024#define INCLUDE_STUN_TEST 1
Benny Prijonofb9d9872007-03-21 22:05:58 +000025#define INCLUDE_ICE_TEST 1
Benny Prijonoff1df042008-06-06 14:47:10 +000026#define INCLUDE_STUN_SOCK_TEST 1
27#define INCLUDE_TURN_SOCK_TEST 1
Benny Prijonofb9d9872007-03-21 22:05:58 +000028
Benny Prijonoa5d214f2008-03-19 23:00:30 +000029int stun_test(void);
30int sess_auth_test(void);
Benny Prijonoff1df042008-06-06 14:47:10 +000031int stun_sock_test(void);
32int turn_sock_test(void);
Benny Prijonoa5d214f2008-03-19 23:00:30 +000033int ice_test(void);
34int test_main(void);
Benny Prijonofb9d9872007-03-21 22:05:58 +000035
36extern void app_perror(const char *title, pj_status_t rc);
37extern pj_pool_factory *mem;
38
Benny Prijonoff1df042008-06-06 14:47:10 +000039////////////////////////////////////
40/*
41 * Utilities
42 */
43pj_status_t create_stun_config(pj_pool_t *pool, pj_stun_config *stun_cfg);
44void destroy_stun_config(pj_stun_config *stun_cfg);
45
46void poll_events(pj_stun_config *stun_cfg, unsigned msec,
47 pj_bool_t first_event_only);
48
49typedef struct pjlib_state
50{
51 unsigned timer_cnt; /* Number of timer entries */
52 unsigned pool_used_cnt; /* Number of app pools */
53} pjlib_state;
54
55
56void capture_pjlib_state(pj_stun_config *cfg, struct pjlib_state *st);
57int check_pjlib_state(pj_stun_config *cfg,
58 const struct pjlib_state *initial_st);
59
60
61#define ERR_MEMORY_LEAK 1
62#define ERR_TIMER_LEAK 2
63