1 /**
2  * HTTP Authentication
3  *
4  * Copyright (C) 2002-2014 by
5  * Jeffrey Fulmer - <jeff@joedog.org>, et al.
6  * This file is distributed as part of Siege
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  *--
22  */
23 #ifndef __AUTH_H
24 #define __AUTH_H
25 
26 #include <creds.h>
27 #include <url.h>
28 #include <joedog/boolean.h>
29 
30 typedef struct AUTH_T *AUTH;
31 extern  size_t AUTHSIZE;
32 
33 typedef struct DIGEST_CRED DCRED;
34 typedef struct DIGEST_CHLG DCHLG;
35 typedef enum { BASIC, DIGEST, NTLM } TYPE;
36 
37 AUTH    new_auth();
38 AUTH    auth_destroy(AUTH this);
39 void    auth_add(AUTH this, CREDS creds);
40 void    auth_display(AUTH this, SCHEME scheme);
41 char *  auth_get_basic_header(AUTH this, SCHEME scheme);
42 BOOLEAN auth_set_basic_header(AUTH this, SCHEME scheme, char *realm);
43 char *  auth_get_ntlm_header(AUTH this, SCHEME scheme);
44 BOOLEAN auth_set_ntlm_header(AUTH this, SCHEME scheme, char *header, char *realm);
45 char *  auth_get_digest_header(AUTH this, SCHEME scheme, DCHLG *chlg, DCRED *cred, const char *meth, const char *uri);
46 BOOLEAN auth_set_digest_header(AUTH this, DCHLG **ch, DCRED **cr, unsigned int *rand, char *realm, char *str);
47 BOOLEAN auth_get_proxy_required(AUTH this);
48 void    auth_set_proxy_required(AUTH this, BOOLEAN required);
49 char *  auth_get_proxy_host(AUTH this);
50 void    auth_set_proxy_host(AUTH this, char *host);
51 int     auth_get_proxy_port(AUTH this);
52 void    auth_set_proxy_port(AUTH this, int port);
53 char *  auth_get_ftp_username(AUTH this, char *realm);
54 char *  auth_get_ftp_password(AUTH this, char *realm);
55 
56 
57 #endif/*__AUTH_H*/
58