iptsec 1.12.11devel
Loading...
Searching...
No Matches
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
43#endif
44
45#ifndef MSG_HEADER_H
47#endif
48
49SOFIA_BEGIN_DECLS
50
51/* ====================================================================== */
52
53struct 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
71struct 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
98 int (*auc_save_credentials)(auth_client_t *ca,
99 char const *scheme,
100 char const *realm,
101 char const *user,
102 char const *pass);
103
105 int (*auc_copy_credentials)(auth_client_t *dst,
106 auth_client_t const *src);
107#endif
108};
109
111#define AUTH_CLIENT_IS_EXTENDED(ca) \
112 ((ca)->ca_auc && \
113 (ca)->ca_auc->auc_plugin_size > \
114 (int)offsetof(auth_client_plugin_t, auc_clear) \
115 && (ca)->ca_auc->auc_clear != NULL)
116
120#define AUTH_CLIENT_SAVE_CREDENTIALS(ca) \
121 ((ca)->ca_auc && \
122 (ca)->ca_auc->auc_plugin_size > \
123 (int)offsetof(auth_client_plugin_t, auc_save_credentials) \
124 ? (ca)->ca_auc->auc_save_credentials : NULL)
125
127 char const *scheme,
128 char const *realm,
129 char const *user,
130 char const *pass);
131
135#define AUTH_CLIENT_COPY_CREDENTIALS(ca) \
136 ((ca)->ca_auc && \
137 (ca)->ca_auc->auc_plugin_size > \
138 (int)offsetof(auth_client_plugin_t, auc_copy_credentials) \
139 ? (ca)->ca_auc->auc_copy_credentials : NULL)
140
142 auth_client_t const *src);
143
144SOFIA_END_DECLS
145
146#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 auth_client_save_credentials(auth_client_t *ac, char const *scheme, char const *realm, char const *user, char const *pass)
Save authentication data to an authenticator.
Definition auth_client.c:447
int auth_client_copy_credentials(auth_client_t *ac, auth_client_t const *src)
Copy authentication data from a matching client in src to d.
Definition auth_client.c:545
struct msg_hclass_s const msg_hclass_t
MSG_HDR_T msg_header_t
SU_HOME_T su_home_t
#define SOFIAPUBFUN

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