2
* (C) 2000 Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it>,
3
* inspired by previous work by Andy Doran
5
* Distributed freely under the terms of the GNU General Public License,
6
* version 2. See the file COPYING for licensing details
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.
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.
32
/************* CONFIGURATION ***************/
34
* define this if you want debugging
39
* Number of authentication attempts to perform in case of certain errors
41
#define BAD_DC_RETRIES_NUMBER 3
43
/************* END CONFIGURATION ***************/
45
#include <sys/types.h>
50
#ifdef __GNUC__ /* this is really a gcc-ism */
55
#define debug(X...) fprintf(stderr,"ntlm-auth[%d](%s:%d): ", getpid(), \
56
((__foo=strrchr(__FILE__,'/'))==NULL?__FILE__:__foo+1),\
60
#define debug(X...) /* */
63
#define debug(char *format, ...) {} /* Too lazy to write va_args stuff */
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);\
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
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);
85
int is_dc_ok(char *domain, char *domain_controller);
87
/* flags used for dc status */
91
typedef struct _dc dc;
100
#endif /* _NTLM_H_ */