Loading...
Searching...
No Matches
auth_client_plugin.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef AUTH_CLIENT_PLUGIN_H
#define AUTH_CLIENT_PLUGIN_H
#ifndef AUTH_CLIENT_H
#include "sofia-sip/auth_client.h"
#endif
#ifndef MSG_HEADER_H
#include <sofia-sip/msg_header.h>
#endif
SOFIA_BEGIN_DECLS
/* ====================================================================== */
struct auth_client_s {
su_home_t ca_home[1];
auth_client_plugin_t const *ca_auc;
auth_client_t *ca_next;
char const *ca_scheme;
char const *ca_realm;
char *ca_user;
char *ca_pass;
msg_hclass_t *ca_credential_class;
#if SOFIA_EXTEND_AUTH_CLIENT
int ca_clear;
#endif
};
struct auth_client_plugin
{
int auc_plugin_size; /* Size of this structure */
int auc_size; /* Size of the client structure */
char const *auc_name; /* Name of the autentication scheme */
int (*auc_challenge)(auth_client_t *ca,
msg_auth_t const *ch);
int (*auc_authorize)(auth_client_t *ca,
su_home_t *h,
char const *method,
url_t const *url,
msg_payload_t const *body,
msg_header_t **return_headers);
int (*auc_info)(auth_client_t *ca, msg_auth_info_t const *ai);
#if SOFIA_EXTEND_AUTH_CLIENT
int (*auc_clear)(auth_client_t *ca);
int (*auc_save_credentials)(auth_client_t *ca,
char const *scheme,
char const *realm,
char const *user,
char const *pass);
int (*auc_copy_credentials)(auth_client_t *dst,
auth_client_t const *src);
#endif
};
#define AUTH_CLIENT_IS_EXTENDED(ca) \
((ca)->ca_auc && \
(ca)->ca_auc->auc_plugin_size > \
(int)offsetof(auth_client_plugin_t, auc_clear) \
&& (ca)->ca_auc->auc_clear != NULL)
#define AUTH_CLIENT_SAVE_CREDENTIALS(ca) \
((ca)->ca_auc && \
(ca)->ca_auc->auc_plugin_size > \
(int)offsetof(auth_client_plugin_t, auc_save_credentials) \
? (ca)->ca_auc->auc_save_credentials : NULL)
SOFIAPUBFUN int auth_client_save_credentials(auth_client_t *ac,
char const *scheme,
char const *realm,
char const *user,
char const *pass);
#define AUTH_CLIENT_COPY_CREDENTIALS(ca) \
((ca)->ca_auc && \
(ca)->ca_auc->auc_plugin_size > \
(int)offsetof(auth_client_plugin_t, auc_copy_credentials) \
? (ca)->ca_auc->auc_copy_credentials : NULL)
SOFIAPUBFUN int auth_client_copy_credentials(auth_client_t *ac,
auth_client_t const *src);
SOFIA_END_DECLS
#endif /* !defined AUTH_CLIENT_PLUGIN_H */
auth_client.h
Client-side authenticator library.
auth_client_t
struct auth_client_s auth_client_t
Authenticator object.
Definition auth_client.h:49
auth_client_save_credentials
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
auth_client_copy_credentials
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
msg_payload_t
struct msg_payload_s msg_payload_t
msg_header.h
msg_hclass_t
struct msg_hclass_s const msg_hclass_t
msg_header_t
MSG_HDR_T msg_header_t
su_home_t
SU_HOME_T su_home_t
SOFIAPUBFUN
#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.