~squid/squid/sbuf-use

« back to all changes in this revision

Viewing changes to helpers/ntlm_auth/SMB/ntlm.h

  • Committer: hno
  • Date: 2001-01-08 06:32:04 UTC
  • Revision ID: cvs-1:hno-20010108063204-w6a8e1zz6eprqnp8
Major rewrite of proxy authentication to support other schemes than
Basic (auth_rewrite branch on SourceForge).
Contributors:
   Andy Doran
   Robert Collins
   Chemolli Francesco
   Henrik Nordstrom

For details about the new API's, see Programmers Guide.

As part of this change everything from auth_modules has been moved to
src/auth/basic/helpers

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>,
 
3
 *        inspired by previous work by Andy Doran
 
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
#define DEBUG
 
37
 
 
38
/*
 
39
 * Number of authentication attempts to perform in case of certain errors
 
40
 */
 
41
#define BAD_DC_RETRIES_NUMBER 3
 
42
 
 
43
/************* END CONFIGURATION ***************/
 
44
 
 
45
#include <sys/types.h>
 
46
 
 
47
 
 
48
/* Debugging stuff */
 
49
 
 
50
#ifdef __GNUC__                 /* this is really a gcc-ism */
 
51
#ifdef DEBUG
 
52
#include <stdio.h>
 
53
#include <unistd.h>
 
54
static char *__foo;
 
55
#define debug(X...) fprintf(stderr,"ntlm-auth[%d](%s:%d): ", getpid(), \
 
56
                    ((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
 
57
                    __LINE__);\
 
58
                    fprintf(stderr,X)
 
59
#else /* DEBUG */
 
60
#define debug(X...)             /* */
 
61
#endif /* DEBUG */
 
62
#else /* __GNUC__ */
 
63
#define debug(char *format, ...) {}     /* Too lazy to write va_args stuff */
 
64
#endif
 
65
 
 
66
 
 
67
/* A couple of harmless helper macros */
 
68
#define SEND(X) debug("sending '%s' to squid\n",X); printf(X); printf("\n");
 
69
#define SEND2(X,Y...) debug("sending '" X "' to squid\n",Y); printf(X,Y);\
 
70
         printf("\n");
 
71
 
 
72
extern int ntlm_errno;
 
73
#define NTLM_NO_ERROR 0
 
74
#define NTLM_SERVER_ERROR 1
 
75
#define NTLM_PROTOCOL_ERROR 2
 
76
#define NTLM_LOGON_ERROR 3
 
77
#define NTLM_BAD_PROTOCOL -1
 
78
#define NTLM_NOT_CONNECTED 10
 
79
 
 
80
 
 
81
const char *make_challenge(char *domain, char *controller);
 
82
extern char *ntlm_check_auth(ntlm_authenticate * auth, int auth_length);
 
83
void dc_disconnect(void);
 
84
int connectedp(void);
 
85
int is_dc_ok(char *domain, char *domain_controller);
 
86
 
 
87
/* flags used for dc status */
 
88
#define DC_OK 0x0
 
89
#define DC_DEAD 0x1
 
90
 
 
91
typedef struct _dc dc;
 
92
struct _dc {
 
93
    char *domain;
 
94
    char *controller;
 
95
    unsigned char status;
 
96
    dc *next;
 
97
};
 
98
 
 
99
 
 
100
#endif /* _NTLM_H_ */