]> git.ipfire.org Git - thirdparty/squid.git/blob - helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.h
Merge from trunk
[thirdparty/squid.git] / helpers / ntlm_auth / smb_lm / ntlm_smb_lm_auth.h
1 /*
2 * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>,
3 * inspired by previous work by Andrew Doran <ad@interlude.eu.org>
4 *
5 * Distributed freely under the terms of the GNU General Public License,
6 * version 2. See the file COPYING for licensing details
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
16 */
17
18 #ifndef _NTLM_H_
19 #define _NTLM_H_
20
21 #include "config.h"
22 #include "ntlmauth.h"
23
24 /* for time_t */
25 #if HAVE_TIME_H
26 #include <time.h>
27 #endif
28 #if HAVE_SYS_TIME_H
29 #include <sys/time.h>
30 #endif
31
32 /************* CONFIGURATION ***************/
33 /*
34 * define this if you want debugging
35 */
36 #ifndef DEBUG
37 #define DEBUG
38 #endif
39
40 #define DEAD_DC_RETRY_INTERVAL 30
41
42 /************* END CONFIGURATION ***************/
43
44
45 /* A couple of harmless helper macros */
46 #define SEND(X) debug("sending '%s' to squid\n",X); printf(X "\n");
47 #ifdef __GNUC__
48 #define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X "\n",Y);
49 #else
50 /* no gcc, no debugging. varargs macros are a gcc extension */
51 #define SEND2 printf
52 #endif
53
54 extern int ntlm_errno;
55 #define NTLM_NO_ERROR 0
56 #define NTLM_SERVER_ERROR 1
57 #define NTLM_PROTOCOL_ERROR 2
58 #define NTLM_LOGON_ERROR 3
59 #define NTLM_UNTRUSTED_DOMAIN 4
60 #define NTLM_BAD_PROTOCOL -1
61 #define NTLM_NOT_CONNECTED 10
62
63
64 const char *make_challenge(char *domain, char *controller);
65 extern char *ntlm_check_auth(ntlm_authenticate * auth, int auth_length);
66 extern char *fetch_credentials(ntlm_authenticate * auth, int auth_length);
67 void dc_disconnect(void);
68 int connectedp(void);
69 int is_dc_ok(char *domain, char *domain_controller);
70
71 typedef struct _dc dc;
72 struct _dc {
73 char *domain;
74 char *controller;
75 time_t dead; /* 0 if it's alive, otherwise time of death */
76 dc *next;
77 };
78
79
80 #endif /* _NTLM_H_ */