Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PJNATH_STUN_TRANSACTION_H__
00021 #define __PJNATH_STUN_TRANSACTION_H__
00022
00028 #include <pjnath/stun_msg.h>
00029 #include <pjnath/stun_config.h>
00030
00031
00032 PJ_BEGIN_DECL
00033
00034
00035
00058 typedef struct pj_stun_client_tsx pj_stun_client_tsx;
00059
00063 typedef struct pj_stun_tsx_cb
00064 {
00078 void (*on_complete)(pj_stun_client_tsx *tsx,
00079 pj_status_t status,
00080 const pj_stun_msg *response,
00081 const pj_sockaddr_t *src_addr,
00082 unsigned src_addr_len);
00083
00097 pj_status_t (*on_send_msg)(pj_stun_client_tsx *tsx,
00098 const void *stun_pkt,
00099 pj_size_t pkt_size);
00100
00112 void (*on_destroy)(pj_stun_client_tsx *tsx);
00113
00114 } pj_stun_tsx_cb;
00115
00116
00117
00134 PJ_DECL(pj_status_t) pj_stun_client_tsx_create( pj_stun_config *cfg,
00135 pj_pool_t *pool,
00136 const pj_stun_tsx_cb *cb,
00137 pj_stun_client_tsx **p_tsx);
00138
00156 PJ_DECL(pj_status_t)
00157 pj_stun_client_tsx_schedule_destroy(pj_stun_client_tsx *tsx,
00158 const pj_time_val *delay);
00159
00160
00170 PJ_DECL(pj_status_t) pj_stun_client_tsx_destroy(pj_stun_client_tsx *tsx);
00171
00172
00180 PJ_DECL(pj_bool_t) pj_stun_client_tsx_is_complete(pj_stun_client_tsx *tsx);
00181
00182
00194 PJ_DECL(pj_status_t) pj_stun_client_tsx_set_data(pj_stun_client_tsx *tsx,
00195 void *data);
00196
00197
00206 PJ_DECL(void*) pj_stun_client_tsx_get_data(pj_stun_client_tsx *tsx);
00207
00208
00226 PJ_DECL(pj_status_t) pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx,
00227 pj_bool_t retransmit,
00228 void *pkt,
00229 unsigned pkt_len);
00230
00245 PJ_DECL(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx,
00246 pj_bool_t mod_count);
00247
00248
00264 PJ_DECL(pj_status_t) pj_stun_client_tsx_on_rx_msg(pj_stun_client_tsx *tsx,
00265 const pj_stun_msg *msg,
00266 const pj_sockaddr_t*src_addr,
00267 unsigned src_addr_len);
00268
00269
00275 PJ_END_DECL
00276
00277
00278 #endif
00279