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.com>
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_H
26 /** Defined when <sofia-sip/auth_client.h> has been included. */
27 #define AUTH_CLIENT_H
28 
29 /**@file sofia-sip/auth_client.h
30  *
31  * @brief Client-side authenticator library.
32  *
33  * @author Pekka Pessi <Pekka.Pessi@nokia.com>
34  *
35  * @date Created: Wed Feb 14 17:09:44 2001 ppessi
36  */
37 
38 #ifndef MSG_TYPES_H
39 #include <sofia-sip/msg_types.h>
40 #endif
41 
42 #ifndef URL_H
43 #include <sofia-sip/url.h>
44 #endif
45 
46 SOFIA_BEGIN_DECLS
47 
48 /** Authenticator object. */
49 typedef struct auth_client_s auth_client_t;
50 
51 SOFIAPUBFUN
52 int auc_challenge(auth_client_t **auc, su_home_t *home,
53 		  msg_auth_t const *auth,
54 		  msg_hclass_t *crcl);
55 
56 SOFIAPUBFUN
57 int auc_credentials(auth_client_t **auc, su_home_t *home, char const *data);
58 
59 SOFIAPUBFUN
60 int auc_info(auth_client_t **auc_list,
61 	     msg_auth_info_t const *ai,
62 	     msg_hclass_t *credential_class);
63 
64 SOFIAPUBFUN
65 int auc_all_credentials(auth_client_t **auc_list,
66 			char const *scheme,
67 			char const *realm,
68 			char const *user,
69 			char const *pass);
70 
71 SOFIAPUBFUN
72 int auc_clear_credentials(auth_client_t **auc_list,
73 			  char const *scheme,
74 			  char const *realm);
75 
76 SOFIAPUBFUN
77 int auc_copy_credentials(auth_client_t **dst, auth_client_t const *src);
78 
79 SOFIAPUBFUN
80 int auc_has_authorization(auth_client_t **auc_list);
81 
82 SOFIAPUBFUN
83 int auc_authorization(auth_client_t **auc_list, msg_t *msg, msg_pub_t *pub,
84 		      char const *method,
85 		      url_t const *url,
86 		      msg_payload_t const *body);
87 
88 SOFIAPUBFUN
89 int auc_authorization_headers(auth_client_t **auc_list,
90 			      su_home_t *home,
91 			      char const *method,
92 			      url_t const *url,
93 			      msg_payload_t const *body,
94 			      msg_header_t **return_headers);
95 
96 struct sip_s;
97 
98 SOFIAPUBFUN
99 int auc_authorize(auth_client_t **auc, msg_t *msg, struct sip_s *sip);
100 
101 typedef struct auth_client_plugin auth_client_plugin_t;
102 
103 SOFIAPUBFUN
104 int auc_register_plugin(auth_client_plugin_t const *plugin);
105 
106 SOFIA_END_DECLS
107 
108 #endif
109