iptsec 1.12.10
|
00001 /* 00002 * This file is part of the Sofia-SIP package 00003 * 00004 * Copyright (C) 2005 Nokia Corporation. 00005 * 00006 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00021 * 02110-1301 USA 00022 * 00023 */ 00024 00025 #ifndef AUTH_CLIENT_PLUGIN_H 00026 00027 #define AUTH_CLIENT_PLUGIN_H 00028 00041 #ifndef AUTH_CLIENT_H 00042 #include "sofia-sip/auth_client.h" 00043 #endif 00044 00045 #ifndef MSG_HEADER_H 00046 #include <sofia-sip/msg_header.h> 00047 #endif 00048 00049 SOFIA_BEGIN_DECLS 00050 00051 /* ====================================================================== */ 00052 00053 struct auth_client_s { 00054 su_home_t ca_home[1]; 00055 auth_client_plugin_t const *ca_auc; 00056 00057 auth_client_t *ca_next; 00058 00059 char const *ca_scheme; 00060 char const *ca_realm; 00061 char *ca_user; 00062 char *ca_pass; 00063 00064 msg_hclass_t *ca_credential_class; 00065 00066 #if SOFIA_EXTEND_AUTH_CLIENT 00067 int ca_clear; 00068 #endif 00069 }; 00070 00071 struct auth_client_plugin 00072 { 00073 int auc_plugin_size; /* Size of this structure */ 00074 int auc_size; /* Size of the client structure */ 00075 00076 char const *auc_name; /* Name of the autentication scheme */ 00077 00079 int (*auc_challenge)(auth_client_t *ca, 00080 msg_auth_t const *ch); 00081 00083 int (*auc_authorize)(auth_client_t *ca, 00084 su_home_t *h, 00085 char const *method, 00086 url_t const *url, 00087 msg_payload_t const *body, 00088 msg_header_t **return_headers); 00089 00091 int (*auc_info)(auth_client_t *ca, msg_auth_info_t const *ai); 00092 00093 #if SOFIA_EXTEND_AUTH_CLIENT 00094 00095 int (*auc_clear)(auth_client_t *ca); 00096 #endif 00097 }; 00098 00100 #define AUTH_CLIENT_IS_EXTENDED(ca) \ 00101 ((ca)->ca_auc->auc_plugin_size > \ 00102 (int)offsetof(auth_client_plugin_t, auc_clear) \ 00103 && (ca)->ca_auc->auc_clear != NULL) 00104 00105 SOFIA_END_DECLS 00106 00107 #endif /* !defined AUTH_CLIENT_PLUGIN_H */