WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJNATH Reference

stun_auth.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJNATH_STUN_AUTH_H__
20#define __PJNATH_STUN_AUTH_H__
21
27#include <pjnath/stun_msg.h>
28
29
31
32
33/* **************************************************************************/
45{
50
55
60
62
63
68{
75
83
85
86
91{
96
103
105
106
113typedef struct pj_stun_auth_cred
114{
119
123 union
124 {
130 struct
131 {
136
141
146
153
158
160
165 struct
166 {
171
195 pj_pool_t *pool,
197 pj_str_t *nonce);
198
225 void *user_data,
226 pj_pool_t *pool,
231 pj_str_t *data);
232
257 void *user_data,
258 const pj_str_t *realm,
259 const pj_str_t *username,
260 pj_pool_t *pool,
262 pj_str_t *data);
263
281 void *user_data,
282 const pj_str_t *realm,
283 const pj_str_t *username,
284 const pj_str_t *nonce);
285
287
289
291
292
299{
305
310
315
323
325
326
336 const pj_stun_auth_cred *src);
337
347 const pj_stun_req_cred_info *src);
348
349
366PJ_DECL(void) pj_stun_create_key(pj_pool_t *pool,
367 pj_str_t *key,
368 const pj_str_t *realm,
369 const pj_str_t *username,
370 pj_stun_passwd_type data_type,
371 const pj_str_t *data);
372
402 unsigned pkt_len,
403 const pj_stun_msg *msg,
404 pj_stun_auth_cred *cred,
405 pj_pool_t *pool,
407 pj_stun_msg **p_response);
408
409
421
422
442 unsigned pkt_len,
443 const pj_stun_msg *msg,
444 const pj_str_t *key);
445
446
453
454
455#endif /* __PJNATH_STUN_AUTH_H__ */
456
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
Definition: stun_auth.h:68
pj_stun_auth_type
Definition: stun_auth.h:45
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 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)
pj_stun_passwd_type
Definition: stun_auth.h:91
void pj_stun_auth_cred_dup(pj_pool_t *pool, pj_stun_auth_cred *dst, const pj_stun_auth_cred *src)
void pj_stun_req_cred_info_dup(pj_pool_t *pool, pj_stun_req_cred_info *dst, const pj_stun_req_cred_info *src)
pj_bool_t pj_stun_auth_valid_for_msg(const pj_stun_msg *msg)
@ PJ_STUN_AUTH_CRED_STATIC
Definition: stun_auth.h:74
@ PJ_STUN_AUTH_CRED_DYNAMIC
Definition: stun_auth.h:82
@ PJ_STUN_AUTH_NONE
Definition: stun_auth.h:49
@ PJ_STUN_AUTH_SHORT_TERM
Definition: stun_auth.h:54
@ PJ_STUN_AUTH_LONG_TERM
Definition: stun_auth.h:59
@ PJ_STUN_PASSWD_HASHED
Definition: stun_auth.h:102
@ PJ_STUN_PASSWD_PLAIN
Definition: stun_auth.h:95
unsigned char pj_uint8_t
int pj_bool_t
int pj_status_t
#define PJ_BEGIN_DECL
#define PJ_END_DECL
Definition: stun_auth.h:114
pj_str_t username
Definition: stun_auth.h:140
struct pj_stun_auth_cred::@2::@4 dyn_cred
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:280
pj_stun_passwd_type data_type
Definition: stun_auth.h:145
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:256
void * user_data
Definition: stun_auth.h:170
pj_stun_auth_cred_type type
Definition: stun_auth.h:118
struct pj_stun_auth_cred::@2::@3 static_cred
pj_str_t data
Definition: stun_auth.h:152
pj_str_t nonce
Definition: stun_auth.h:157
pj_status_t(* get_auth)(void *user_data, pj_pool_t *pool, pj_str_t *realm, pj_str_t *nonce)
Definition: stun_auth.h:194
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:224
pj_str_t realm
Definition: stun_auth.h:135
Definition: stun_msg.h:1172
Definition: stun_auth.h:299
pj_str_t username
Definition: stun_auth.h:309
pj_str_t realm
Definition: stun_auth.h:304
pj_str_t auth_key
Definition: stun_auth.h:322
pj_str_t nonce
Definition: stun_auth.h:314
STUN message components.

 


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