Home --> Documentations --> PJNATH Reference

stun_transaction.h
Go to the documentation of this file.
1 /* $Id: stun_transaction.h 4983 2015-02-13 11:34:26Z ming $ */
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_TRANSACTION_H__
21 #define __PJNATH_STUN_TRANSACTION_H__
22 
28 #include <pjnath/stun_msg.h>
29 #include <pjnath/stun_config.h>
30 #include <pj/lock.h>
31 
32 
34 
35 
36 /* **************************************************************************/
60 
64 typedef struct pj_stun_tsx_cb
65 {
80  pj_status_t status,
81  const pj_stun_msg *response,
82  const pj_sockaddr_t *src_addr,
83  unsigned src_addr_len);
84 
99  const void *stun_pkt,
100  pj_size_t pkt_size);
101 
114 
116 
117 
118 
137  pj_pool_t *pool,
138  pj_grp_lock_t *grp_lock,
139  const pj_stun_tsx_cb *cb,
140  pj_stun_client_tsx **p_tsx);
141 
159 PJ_DECL(pj_status_t)
161  const pj_time_val *delay);
162 
163 
173 
174 
184 
185 
194 
195 
208  void *data);
209 
210 
220 
221 
240  pj_bool_t retransmit,
241  void *pkt,
242  unsigned pkt_len);
243 
259  pj_bool_t mod_count);
260 
261 
278  const pj_stun_msg *msg,
279  const pj_sockaddr_t*src_addr,
280  unsigned src_addr_len);
281 
282 
288 PJ_END_DECL
289 
290 
291 #endif /* __PJNATH_STUN_TRANSACTION_H__ */
292 
STUN message components.
int pj_bool_t
int pj_status_t
pj_status_t(* on_send_msg)(pj_stun_client_tsx *tsx, const void *stun_pkt, pj_size_t pkt_size)
Definition: stun_transaction.h:98
pj_status_t pj_stun_client_tsx_create(pj_stun_config *cfg, pj_pool_t *pool, pj_grp_lock_t *grp_lock, const pj_stun_tsx_cb *cb, pj_stun_client_tsx **p_tsx)
pj_status_t pj_stun_client_tsx_stop(pj_stun_client_tsx *tsx)
pj_status_t pj_stun_client_tsx_on_rx_msg(pj_stun_client_tsx *tsx, const pj_stun_msg *msg, const pj_sockaddr_t *src_addr, unsigned src_addr_len)
Definition: stun_config.h:48
void pj_sockaddr_t
pj_status_t pj_stun_client_tsx_set_data(pj_stun_client_tsx *tsx, void *data)
struct pj_grp_lock_t pj_grp_lock_t
void(* on_destroy)(pj_stun_client_tsx *tsx)
Definition: stun_transaction.h:113
#define PJ_BEGIN_DECL
void * pj_stun_client_tsx_get_data(pj_stun_client_tsx *tsx)
pj_status_t pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx, pj_bool_t retransmit, void *pkt, unsigned pkt_len)
struct pj_stun_client_tsx pj_stun_client_tsx
Definition: stun_transaction.h:59
STUN endpoint.
Definition: stun_msg.h:1141
pj_status_t pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx, pj_bool_t mod_count)
pj_status_t pj_stun_client_tsx_destroy(pj_stun_client_tsx *tsx)
Definition: stun_transaction.h:64
pj_status_t pj_stun_client_tsx_schedule_destroy(pj_stun_client_tsx *tsx, const pj_time_val *delay)
void(* on_complete)(pj_stun_client_tsx *tsx, pj_status_t status, const pj_stun_msg *response, const pj_sockaddr_t *src_addr, unsigned src_addr_len)
Definition: stun_transaction.h:79
size_t pj_size_t
pj_bool_t pj_stun_client_tsx_is_complete(pj_stun_client_tsx *tsx)

 


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