Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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;
00074 int auc_size;
00075
00076 char const *auc_name;
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
00098 int (*auc_save_credentials)(auth_client_t *ca,
00099 char const *scheme,
00100 char const *realm,
00101 char const *user,
00102 char const *pass);
00103
00105 int (*auc_copy_credentials)(auth_client_t *dst,
00106 auth_client_t const *src);
00107 #endif
00108 };
00109
00111 #define AUTH_CLIENT_IS_EXTENDED(ca) \
00112 ((ca)->ca_auc && \
00113 (ca)->ca_auc->auc_plugin_size > \
00114 (int)offsetof(auth_client_plugin_t, auc_clear) \
00115 && (ca)->ca_auc->auc_clear != NULL)
00116
00120 #define AUTH_CLIENT_SAVE_CREDENTIALS(ca) \
00121 ((ca)->ca_auc && \
00122 (ca)->ca_auc->auc_plugin_size > \
00123 (int)offsetof(auth_client_plugin_t, auc_save_credentials) \
00124 ? (ca)->ca_auc->auc_save_credentials : NULL)
00125
00126 SOFIAPUBFUN int auth_client_save_credentials(auth_client_t *ac,
00127 char const *scheme,
00128 char const *realm,
00129 char const *user,
00130 char const *pass);
00131
00135 #define AUTH_CLIENT_COPY_CREDENTIALS(ca) \
00136 ((ca)->ca_auc && \
00137 (ca)->ca_auc->auc_plugin_size > \
00138 (int)offsetof(auth_client_plugin_t, auc_copy_credentials) \
00139 ? (ca)->ca_auc->auc_copy_credentials : NULL)
00140
00141 SOFIAPUBFUN int auth_client_copy_credentials(auth_client_t *ac,
00142 auth_client_t const *src);
00143
00144 SOFIA_END_DECLS
00145
00146 #endif