iptsec  1.13.17
auth_client_plugin.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef AUTH_CLIENT_PLUGIN_H
27 #define AUTH_CLIENT_PLUGIN_H
28 
41 #ifndef AUTH_CLIENT_H
42 #include "sofia-sip/auth_client.h"
43 #endif
44 
45 #ifndef MSG_HEADER_H
46 #include <sofia-sip/msg_header.h>
47 #endif
48 
49 SOFIA_BEGIN_DECLS
50 
51 /* ====================================================================== */
52 
53 struct auth_client_s {
54  su_home_t ca_home[1];
55  auth_client_plugin_t const *ca_auc;
56 
57  auth_client_t *ca_next;
58 
59  char const *ca_scheme;
60  char const *ca_realm;
61  char *ca_user;
62  char *ca_pass;
63 
64  msg_hclass_t *ca_credential_class;
65 
66 #if SOFIA_EXTEND_AUTH_CLIENT
67  int ca_clear;
68 #endif
69 };
70 
71 struct auth_client_plugin
72 {
73  int auc_plugin_size; /* Size of this structure */
74  int auc_size; /* Size of the client structure */
75 
76  char const *auc_name; /* Name of the autentication scheme */
77 
79  int (*auc_challenge)(auth_client_t *ca,
80  msg_auth_t const *ch);
81 
83  int (*auc_authorize)(auth_client_t *ca,
84  su_home_t *h,
85  char const *method,
86  url_t const *url,
87  msg_payload_t const *body,
88  msg_header_t **return_headers);
89 
91  int (*auc_info)(auth_client_t *ca, msg_auth_info_t const *ai);
92 
93 #if SOFIA_EXTEND_AUTH_CLIENT
95  int (*auc_clear)(auth_client_t *ca);
96 #endif
97 };
98 
100 #define AUTH_CLIENT_IS_EXTENDED(ca) \
101  ((ca)->ca_auc && \
102  (ca)->ca_auc->auc_plugin_size > \
103  (int)offsetof(auth_client_plugin_t, auc_clear) \
104  && (ca)->ca_auc->auc_clear != NULL)
105 
106 SOFIA_END_DECLS
107 
108 #endif /* !defined AUTH_CLIENT_PLUGIN_H */
Client-side authenticator library.
struct auth_client_s auth_client_t
Authenticator object.
Definition: auth_client.h:49
int auc_challenge(auth_client_t **auc, su_home_t *home, msg_auth_t const *auth, msg_hclass_t *crcl)
Initialize authenticators.
Definition: auth_client.c:102
int auc_info(auth_client_t **auc_list, msg_auth_info_t const *ai, msg_hclass_t *credential_class)
Store authentication info to authenticators.
Definition: auth_client.c:235
struct msg_hclass_s const msg_hclass_t
MSG_HDR_T msg_header_t
SU_HOME_T su_home_t

Sofia-SIP 1.13.17 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.