Home --> Documentations --> PJNATH Reference

stun_auth.h
Go to the documentation of this file.
1 /* $Id: stun_auth.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_AUTH_H__
21 #define __PJNATH_STUN_AUTH_H__
22 
28 #include <pjnath/stun_msg.h>
29 
30 
32 
33 
34 /* **************************************************************************/
45 typedef enum pj_stun_auth_type
46 {
51 
56 
61 
63 
64 
69 {
76 
84 
86 
87 
91 typedef enum pj_stun_passwd_type
92 {
97 
104 
106 
107 
114 typedef struct pj_stun_auth_cred
115 {
120 
124  union
125  {
131  struct
132  {
137 
142 
147 
154 
159 
160  } static_cred;
161 
166  struct
167  {
171  void *user_data;
172 
196  pj_pool_t *pool,
197  pj_str_t *realm,
198  pj_str_t *nonce);
199 
226  void *user_data,
227  pj_pool_t *pool,
228  pj_str_t *realm,
230  pj_str_t *nonce,
232  pj_str_t *data);
233 
258  void *user_data,
259  const pj_str_t *realm,
260  const pj_str_t *username,
261  pj_pool_t *pool,
263  pj_str_t *data);
264 
282  void *user_data,
283  const pj_str_t *realm,
284  const pj_str_t *username,
285  const pj_str_t *nonce);
286 
287  } dyn_cred;
288 
289  } data;
290 
292 
293 
299 typedef struct pj_stun_req_cred_info
300 {
306 
311 
316 
324 
326 
327 
335 PJ_DECL(void) pj_stun_auth_cred_dup(pj_pool_t *pool,
336  pj_stun_auth_cred *dst,
337  const pj_stun_auth_cred *src);
338 
346 PJ_DECL(void) pj_stun_req_cred_info_dup(pj_pool_t *pool,
348  const pj_stun_req_cred_info *src);
349 
350 
367 PJ_DECL(void) pj_stun_create_key(pj_pool_t *pool,
368  pj_str_t *key,
369  const pj_str_t *realm,
370  const pj_str_t *username,
371  pj_stun_passwd_type data_type,
372  const pj_str_t *data);
373 
403  unsigned pkt_len,
404  const pj_stun_msg *msg,
405  pj_stun_auth_cred *cred,
406  pj_pool_t *pool,
408  pj_stun_msg **p_response);
409 
410 
422 
423 
443  unsigned pkt_len,
444  const pj_stun_msg *msg,
445  const pj_str_t *key);
446 
447 
453 PJ_END_DECL
454 
455 
456 #endif /* __PJNATH_STUN_AUTH_H__ */
457 
STUN message components.
pj_status_t pj_stun_authenticate_response(const pj_uint8_t *pkt, unsigned pkt_len, const pj_stun_msg *msg, const pj_str_t *key)
pj_stun_auth_cred_type type
Definition: stun_auth.h:119
pj_stun_passwd_type
Definition: stun_auth.h:91
pj_str_t data
Definition: stun_auth.h:153
int pj_bool_t
pj_str_t nonce
Definition: stun_auth.h:315
Definition: stun_auth.h:114
Definition: stun_auth.h:50
struct pj_stun_auth_cred::@2::@3 static_cred
pj_stun_passwd_type data_type
Definition: stun_auth.h:146
void pj_stun_create_key(pj_pool_t *pool, pj_str_t *key, const pj_str_t *realm, const pj_str_t *username, pj_stun_passwd_type data_type, const pj_str_t *data)
pj_status_t(* get_cred)(const pj_stun_msg *msg, void *user_data, pj_pool_t *pool, pj_str_t *realm, pj_str_t *username, pj_str_t *nonce, pj_stun_passwd_type *data_type, pj_str_t *data)
Definition: stun_auth.h:225
void pj_stun_req_cred_info_dup(pj_pool_t *pool, pj_stun_req_cred_info *dst, const pj_stun_req_cred_info *src)
void * user_data
Definition: stun_auth.h:171
int pj_status_t
Definition: stun_auth.h:299
pj_str_t realm
Definition: stun_auth.h:136
pj_status_t(* get_password)(const pj_stun_msg *msg, void *user_data, const pj_str_t *realm, const pj_str_t *username, pj_pool_t *pool, pj_stun_passwd_type *data_type, pj_str_t *data)
Definition: stun_auth.h:257
Definition: stun_auth.h:75
pj_bool_t pj_stun_auth_valid_for_msg(const pj_stun_msg *msg)
pj_str_t info
Definition: stun_auth.h:60
pj_str_t realm
Definition: stun_auth.h:305
pj_str_t username
Definition: stun_auth.h:141
pj_str_t nonce
Definition: stun_auth.h:158
#define PJ_BEGIN_DECL
pj_str_t username
Definition: stun_auth.h:310
pj_stun_auth_type
Definition: stun_auth.h:45
unsigned char pj_uint8_t
pj_status_t pj_stun_authenticate_request(const pj_uint8_t *pkt, unsigned pkt_len, const pj_stun_msg *msg, pj_stun_auth_cred *cred, pj_pool_t *pool, pj_stun_req_cred_info *info, pj_stun_msg **p_response)
struct pj_stun_auth_cred::@2::@4 dyn_cred
Definition: stun_auth.h:103
pj_status_t(* get_auth)(void *user_data, pj_pool_t *pool, pj_str_t *realm, pj_str_t *nonce)
Definition: stun_auth.h:195
Definition: stun_auth.h:55
Definition: stun_auth.h:83
Definition: stun_msg.h:1141
Definition: stun_auth.h:96
void pj_stun_auth_cred_dup(pj_pool_t *pool, pj_stun_auth_cred *dst, const pj_stun_auth_cred *src)
pj_str_t auth_key
Definition: stun_auth.h:323
pj_stun_auth_cred_type
Definition: stun_auth.h:68
pj_bool_t(* verify_nonce)(const pj_stun_msg *msg, void *user_data, const pj_str_t *realm, const pj_str_t *username, const pj_str_t *nonce)
Definition: stun_auth.h:281

 


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