Browse code

Unnecessary file removed

Nils Ohlmeier authored on 27/08/2003 14:38:40
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,483 +0,0 @@
1
-/*
2
- * $Id$
3
- *
4
- * Copyright (C) 1995,1996,1997,1998 Lars Fenneberg
5
- *
6
- * Copyright 1992 Livingston Enterprises, Inc.
7
- *
8
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
9
- * and Merit Network, Inc. All Rights Reserved
10
- *
11
- * See the file COPYRIGHT for the respective terms and conditions. 
12
- * If the file is missing contact me at lf@elemental.net 
13
- * and I'll send you a copy.
14
- *
15
- */
16
-
17
-#ifndef RADIUSCLIENT_H
18
-#define RADIUSCLIENT_H
19
-
20
-#include	<sys/types.h>
21
-#include	<stdio.h>
22
-#include	<time.h>
23
-
24
-#undef __BEGIN_DECLS
25
-#undef __END_DECLS
26
-#ifdef __cplusplus
27
-# define __BEGIN_DECLS extern "C" {
28
-# define __END_DECLS }
29
-#else
30
-# define __BEGIN_DECLS /* empty */
31
-# define __END_DECLS /* empty */
32
-#endif
33
-
34
-#undef __P
35
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
36
-# define __P(protos) protos
37
-#else
38
-# define __P(protos) ()
39
-#endif
40
-
41
-typedef unsigned long UINT4;
42
-typedef long 	      INT4;
43
-
44
-#define AUTH_VECTOR_LEN		16
45
-#define AUTH_PASS_LEN		(3 * 16) /* multiple of 16 */
46
-#define AUTH_ID_LEN		64
47
-#define AUTH_STRING_LEN		128	 /* maximum of 253 */
48
-
49
-#define	BUFFER_LEN		8192
50
-
51
-#define NAME_LENGTH		32
52
-#define	GETSTR_LENGTH		128	/* must be bigger than AUTH_PASS_LEN */
53
-
54
-/* codes for radius_buildreq, radius_getport, etc. */
55
-#define AUTH			0
56
-#define ACCT			1
57
-
58
-/* defines for config.c */
59
-
60
-#define SERVER_MAX 8
61
-
62
-#define AUTH_LOCAL_FST	(1<<0)
63
-#define AUTH_RADIUS_FST (1<<1)
64
-#define AUTH_LOCAL_SND  (1<<2)
65
-#define AUTH_RADIUS_SND (1<<3)
66
-
67
-typedef struct server {
68
-	int max;
69
-	char *name[SERVER_MAX];
70
-	unsigned short port[SERVER_MAX];	
71
-} SERVER;
72
-
73
-typedef struct pw_auth_hdr
74
-{
75
-	u_char          code;
76
-	u_char          id;
77
-	u_short         length;
78
-	u_char          vector[AUTH_VECTOR_LEN];
79
-	u_char          data[2];
80
-} AUTH_HDR;
81
-
82
-#define AUTH_HDR_LEN			20
83
-#define MAX_SECRET_LENGTH		(3 * 16) /* MUST be multiple of 16 */
84
-#define CHAP_VALUE_LENGTH		16
85
-
86
-#define PW_AUTH_UDP_PORT		1645
87
-#define PW_ACCT_UDP_PORT		1646
88
-
89
-#define PW_TYPE_STRING			0
90
-#define PW_TYPE_INTEGER			1
91
-#define PW_TYPE_IPADDR			2
92
-#define PW_TYPE_DATE			3
93
-
94
-/* standard RADIUS codes */
95
-
96
-#define	PW_ACCESS_REQUEST		1
97
-#define	PW_ACCESS_ACCEPT		2
98
-#define	PW_ACCESS_REJECT		3
99
-#define	PW_ACCOUNTING_REQUEST		4
100
-#define	PW_ACCOUNTING_RESPONSE		5
101
-#define	PW_ACCOUNTING_STATUS		6
102
-#define	PW_PASSWORD_REQUEST		7
103
-#define	PW_PASSWORD_ACK			8
104
-#define	PW_PASSWORD_REJECT		9
105
-#define	PW_ACCOUNTING_MESSAGE		10
106
-#define	PW_ACCESS_CHALLENGE		11
107
-#define	PW_STATUS_SERVER		12
108
-#define	PW_STATUS_CLIENT		13
109
-
110
-
111
-/* standard RADIUS attribute-value pairs */
112
-
113
-#define	PW_USER_NAME			1	/* string */
114
-#define	PW_USER_PASSWORD		2	/* string */
115
-#define	PW_CHAP_PASSWORD		3	/* string */
116
-#define	PW_NAS_IP_ADDRESS		4	/* ipaddr */
117
-#define	PW_NAS_PORT			5	/* integer */
118
-#define	PW_SERVICE_TYPE			6	/* integer */
119
-#define	PW_FRAMED_PROTOCOL		7	/* integer */
120
-#define	PW_FRAMED_IP_ADDRESS		8	/* ipaddr */
121
-#define	PW_FRAMED_IP_NETMASK		9	/* ipaddr */
122
-#define	PW_FRAMED_ROUTING		10	/* integer */
123
-#define	PW_FILTER_ID		        11	/* string */
124
-#define	PW_FRAMED_MTU			12	/* integer */
125
-#define	PW_FRAMED_COMPRESSION		13	/* integer */
126
-#define	PW_LOGIN_IP_HOST		14	/* ipaddr */
127
-#define	PW_LOGIN_SERVICE		15	/* integer */
128
-#define	PW_LOGIN_PORT			16	/* integer */
129
-#define	PW_OLD_PASSWORD			17	/* string */ /* deprecated */
130
-#define	PW_REPLY_MESSAGE		18	/* string */
131
-#define	PW_LOGIN_CALLBACK_NUMBER	19	/* string */
132
-#define	PW_FRAMED_CALLBACK_ID		20	/* string */
133
-#define	PW_EXPIRATION			21	/* date */ /* deprecated */
134
-#define	PW_FRAMED_ROUTE			22	/* string */
135
-#define	PW_FRAMED_IPX_NETWORK		23	/* integer */
136
-#define	PW_STATE			24	/* string */
137
-#define	PW_CLASS			25	/* string */
138
-#define	PW_VENDOR_SPECIFIC		26	/* string */
139
-#define	PW_SESSION_TIMEOUT		27	/* integer */
140
-#define	PW_IDLE_TIMEOUT			28	/* integer */
141
-#define	PW_TERMINATION_ACTION		29	/* integer */
142
-#define	PW_CALLED_STATION_ID            30      /* string */
143
-#define	PW_CALLING_STATION_ID           31      /* string */
144
-#define	PW_NAS_IDENTIFIER		32	/* string */
145
-#define	PW_PROXY_STATE			33	/* string */
146
-#define	PW_LOGIN_LAT_SERVICE		34	/* string */
147
-#define	PW_LOGIN_LAT_NODE		35	/* string */
148
-#define	PW_LOGIN_LAT_GROUP		36	/* string */
149
-#define	PW_FRAMED_APPLETALK_LINK	37	/* integer */
150
-#define	PW_FRAMED_APPLETALK_NETWORK	38	/* integer */
151
-#define	PW_FRAMED_APPLETALK_ZONE	39	/* string */
152
-#define	PW_CHAP_CHALLENGE               60      /* string */
153
-#define	PW_NAS_PORT_TYPE                61      /* integer */
154
-#define	PW_PORT_LIMIT                   62      /* integer */
155
-#define PW_LOGIN_LAT_PORT               63      /* string */
156
-#define PW_CONNECT_INFO                 77      /* string */
157
-#define PW_NAS_IPV6_ADDRESS             95      /* string */
158
-#define PW_FRAMED_INTERFACE_ID          96      /* string */
159
-#define PW_FRAMED_IPV6_PREFIX           97      /* string */
160
-#define PW_LOGIN_IPV6_HOST              98      /* string */
161
-#define PW_FRAMED_IPV6_ROUTE            99      /* string */
162
-#define PW_FRAMED_IPV6_POOL             100     /* string */
163
-
164
-/*	Accounting */
165
-
166
-#define	PW_ACCT_STATUS_TYPE		40	/* integer */
167
-#define	PW_ACCT_DELAY_TIME		41	/* integer */
168
-#define	PW_ACCT_INPUT_OCTETS		42	/* integer */
169
-#define	PW_ACCT_OUTPUT_OCTETS		43	/* integer */
170
-#define	PW_ACCT_SESSION_ID		44	/* string */
171
-#define	PW_ACCT_AUTHENTIC		45	/* integer */
172
-#define	PW_ACCT_SESSION_TIME		46	/* integer */
173
-#define	PW_ACCT_INPUT_PACKETS		47	/* integer */
174
-#define	PW_ACCT_OUTPUT_PACKETS		48	/* integer */
175
-#define PW_ACCT_TERMINATE_CAUSE		49	/* integer */
176
-#define PW_ACCT_MULTI_SESSION_ID	50	/* string */
177
-#define PW_ACCT_LINK_COUNT		51	/* integer */
178
-
179
-/*	Merit Experimental Extensions */
180
-
181
-#define PW_USER_ID                      222     /* string */
182
-#define PW_USER_REALM                   223     /* string */
183
-
184
-/*	IPTEL Experimental Extensions */
185
-
186
-#define PW_DIGEST_RESPONSE	        206	/* string */
187
-#define PW_DIGEST_ATTRIBUTES	        207	/* string */
188
-#define PW_SIP_URI_USER                 208     /* int */
189
-#define PW_SIP_METHOD                   209     /* int */
190
-#define PW_SIP_RESPONSE_CODE            210     /* int */
191
-#define PW_SIP_FROM_TAG                 211     /* string */
192
-#define PW_SIP_TO_TAG                   212     /* string */
193
-#define PW_SIP_CSEQ                     213     /* string */
194
-#define PW_SIP_TRANSLATED_REQ_URI       214     /* string */
195
-
196
-#define PW_DIGEST_REALM		        1063	/* string */
197
-#define	PW_DIGEST_NONCE		        1064	/* string */
198
-#define	PW_DIGEST_METHOD	        1065	/* string */
199
-#define	PW_DIGEST_URI		        1066	/* string */
200
-#define	PW_DIGEST_QOP		        1067	/* string */
201
-#define	PW_DIGEST_ALGORITHM	        1068	/* string */
202
-#define	PW_DIGEST_BODY_DIGEST	        1069	/* string */
203
-#define	PW_DIGEST_CNONCE	        1070	/* string */
204
-#define	PW_DIGEST_NONCE_COUNT	        1071	/* string */
205
-#define	PW_DIGEST_USER_NAME	        1072	/* string */
206
-
207
-#define PW_SIP_USER_ID         	        110	/* string */
208
-#define PW_SIP_USER_REALM 	        111	/* string */
209
-#define PW_SIP_USER_NONCE 	        112	/* string */
210
-#define PW_SIP_USER_METHOD	        113	/* string */
211
-#define PW_SIP_USER_DIGEST_URI          114	/* string */
212
-#define	PW_SIP_USER_NONCE_COUNT         115	/* string */
213
-#define	PW_SIP_USER_QOP		        116	/* string */
214
-#define	PW_SIP_USER_OPAQUE	        117	/* string */
215
-#define	PW_SIP_USER_RESPONSE	        118	/* string */
216
-#define PW_SIP_USER_CNONCE	        119	/* string */
217
-
218
-/*	Integer Translations */
219
-
220
-/*	SERVICE TYPES	*/
221
-
222
-#define	PW_LOGIN			1
223
-#define	PW_FRAMED			2
224
-#define	PW_CALLBACK_LOGIN		3
225
-#define	PW_CALLBACK_FRAMED		4
226
-#define	PW_OUTBOUND			5
227
-#define	PW_ADMINISTRATIVE		6
228
-#define PW_NAS_PROMPT                   7
229
-#define PW_AUTHENTICATE_ONLY		8
230
-#define PW_CALLBACK_NAS_PROMPT          9
231
-#define PW_CALL_CHECK                  10
232
-
233
-/*	IPTEL Experimental Service Type */
234
-
235
-#define PW_SIP                         12
236
-
237
-/*	FRAMED PROTOCOLS	*/
238
-
239
-#define	PW_PPP				1
240
-#define	PW_SLIP				2
241
-#define PW_ARA                          3
242
-#define PW_GANDALF                      4
243
-#define PW_XYLOGICS                     5
244
-
245
-/*	FRAMED ROUTING VALUES	*/
246
-
247
-#define	PW_NONE				0
248
-#define	PW_BROADCAST			1
249
-#define	PW_LISTEN			2
250
-#define	PW_BROADCAST_LISTEN		3
251
-
252
-/*	FRAMED COMPRESSION TYPES	*/
253
-
254
-#define	PW_VAN_JACOBSON_TCP_IP		1
255
-#define	PW_IPX_HEADER_COMPRESSION	2
256
-
257
-/*	LOGIN SERVICES	*/
258
-
259
-#define PW_TELNET                       0
260
-#define PW_RLOGIN                       1
261
-#define PW_TCP_CLEAR                    2
262
-#define PW_PORTMASTER                   3
263
-#define PW_LAT                          4
264
-#define PW_X25_PAD                      5
265
-#define PW_X25_T3POS                    6
266
-#define PW_SSH                          1000 /* FIX ME dc Better value? */
267
-
268
-/*	TERMINATION ACTIONS	*/
269
-
270
-#define	PW_DEFAULT			0
271
-#define	PW_RADIUS_REQUEST		1
272
-
273
-/*	PROHIBIT PROTOCOL  */
274
-
275
-#define PW_DUMB		0	/* 1 and 2 are defined in FRAMED PROTOCOLS */
276
-#define PW_AUTH_ONLY	3
277
-#define PW_ALL		255
278
-
279
-/*	ACCOUNTING STATUS TYPES    */
280
-
281
-#define PW_STATUS_START		1
282
-#define PW_STATUS_STOP		2
283
-#define PW_STATUS_ALIVE		3
284
-#define PW_STATUS_MODEM_START	4
285
-#define PW_STATUS_MODEM_STOP	5
286
-#define PW_STATUS_CANCEL	6
287
-#define PW_ACCOUNTING_ON	7
288
-#define PW_ACCOUNTING_OFF	8
289
-
290
-/*      ACCOUNTING TERMINATION CAUSES   */
291
-
292
-#define PW_USER_REQUEST         1
293
-#define PW_LOST_CARRIER         2
294
-#define PW_LOST_SERVICE         3
295
-#define PW_ACCT_IDLE_TIMEOUT    4
296
-#define PW_ACCT_SESSION_TIMEOUT 5
297
-#define PW_ADMIN_RESET          6
298
-#define PW_ADMIN_REBOOT         7
299
-#define PW_PORT_ERROR           8
300
-#define PW_NAS_ERROR            9
301
-#define PW_NAS_REQUEST          10
302
-#define PW_NAS_REBOOT           11
303
-#define PW_PORT_UNNEEDED        12
304
-#define PW_PORT_PREEMPTED       13
305
-#define PW_PORT_SUSPENDED       14
306
-#define PW_SERVICE_UNAVAILABLE  15
307
-#define PW_CALLBACK             16
308
-#define PW_USER_ERROR           17
309
-#define PW_HOST_REQUEST         18
310
- 
311
-/*     NAS PORT TYPES    */
312
-
313
-#define PW_ASYNC		0
314
-#define PW_SYNC			1
315
-#define PW_ISDN_SYNC		2
316
-#define PW_ISDN_SYNC_V120	3
317
-#define PW_ISDN_SYNC_V110	4
318
-#define PW_VIRTUAL		5
319
-
320
-/*	   AUTHENTIC TYPES */
321
-#define PW_RADIUS	1
322
-#define PW_LOCAL	2
323
-#define PW_REMOTE	3
324
-
325
-/* Server data structures */
326
-
327
-typedef struct dict_attr
328
-{
329
-	char              name[NAME_LENGTH + 1];	/* attribute name */
330
-	int               value;			/* attribute index */
331
-	int               type;				/* string, int, etc. */
332
-	struct dict_attr *next;
333
-} DICT_ATTR;
334
-
335
-typedef struct dict_value
336
-{
337
-	char               attrname[NAME_LENGTH +1];
338
-	char               name[NAME_LENGTH + 1];
339
-	int                value;
340
-	struct dict_value *next;
341
-} DICT_VALUE;
342
-
343
-typedef struct value_pair
344
-{
345
-	char               name[NAME_LENGTH + 1];
346
-	int                attribute;
347
-	int                type;
348
-	UINT4              lvalue;
349
-	char               strvalue[AUTH_STRING_LEN + 1];
350
-	struct value_pair *next;
351
-} VALUE_PAIR;
352
-
353
-/* don't change this, as it has to be the same as in the Merit radiusd code */
354
-#define MGMT_POLL_SECRET	"Hardlyasecret"
355
-
356
-/* 	Define return codes from "SendServer" utility */
357
-
358
-#define BADRESP_RC	-2
359
-#define ERROR_RC	-1
360
-#define OK_RC		0
361
-#define TIMEOUT_RC	1
362
-
363
-typedef struct send_data /* Used to pass information to sendserver() function */
364
-{
365
-	u_char          code;		/* RADIUS packet code */
366
-	u_char          seq_nbr;	/* Packet sequence number */
367
-	char           *server;		/* Name/addrress of RADIUS server */
368
-	int             svc_port;	/* RADIUS protocol destination port */
369
-	int             timeout;	/* Session timeout in seconds */
370
-	int		retries;
371
-	VALUE_PAIR     *send_pairs;     /* More a/v pairs to send */
372
-	VALUE_PAIR     *receive_pairs;  /* Where to place received a/v pairs */
373
-} SEND_DATA;
374
-
375
-#ifndef MIN
376
-#define MIN(a, b)     ((a) < (b) ? (a) : (b))
377
-#endif
378
-#ifndef MAX
379
-#define MAX(a, b)     ((a) > (b) ? (a) : (b))
380
-#endif
381
-
382
-#ifndef PATH_MAX
383
-#define PATH_MAX	1024
384
-#endif
385
-
386
-typedef struct env
387
-{
388
-	int maxsize, size;
389
-	char **env;
390
-} ENV;
391
-
392
-#define ENV_SIZE	128
393
-
394
-__BEGIN_DECLS
395
-
396
-/*	Function prototypes	*/
397
-
398
-/*	avpair.c		*/
399
-
400
-VALUE_PAIR *rc_avpair_add __P((VALUE_PAIR **, int, void *, int));
401
-int rc_avpair_assign __P((VALUE_PAIR *, void *, int));
402
-VALUE_PAIR *rc_avpair_new __P((int, void *, int));
403
-VALUE_PAIR *rc_avpair_gen __P((AUTH_HDR *));
404
-VALUE_PAIR *rc_avpair_get __P((VALUE_PAIR *, UINT4));
405
-void rc_avpair_insert __P((VALUE_PAIR **, VALUE_PAIR *, VALUE_PAIR *));
406
-void rc_avpair_free __P((VALUE_PAIR *));
407
-int rc_avpair_parse __P((char *, VALUE_PAIR **));
408
-int rc_avpair_tostr __P((VALUE_PAIR *, char *, int, char *, int));
409
-VALUE_PAIR *rc_avpair_readin __P((FILE *));
410
-
411
-/*	buildreq.c		*/
412
-
413
-void rc_buildreq __P((SEND_DATA *, int, char *, unsigned short, int, int));
414
-unsigned char rc_get_seqnbr __P((void));
415
-int rc_auth __P((UINT4, VALUE_PAIR *, VALUE_PAIR **, char *));
416
-int rc_auth_proxy __P((VALUE_PAIR *, VALUE_PAIR **, char *));
417
-int rc_acct __P((UINT4, VALUE_PAIR *));
418
-int rc_acct_proxy __P((VALUE_PAIR *));
419
-int rc_check __P((char *, unsigned short, char *));
420
-
421
-/*	clientid.c		*/
422
-
423
-int rc_read_mapfile __P((char *));
424
-UINT4 rc_map2id __P((char *));
425
-
426
-/*	config.c		*/
427
-
428
-int rc_read_config __P((char *));
429
-char *rc_conf_str __P((char *));
430
-int rc_conf_int __P((char *));
431
-SERVER *rc_conf_srv __P((char *));
432
-int rc_find_server __P((char *, UINT4 *, char *));
433
-
434
-/*	dict.c			*/
435
-
436
-int rc_read_dictionary __P((char *));
437
-DICT_ATTR *rc_dict_getattr __P((int));
438
-DICT_ATTR *rc_dict_findattr __P((char *));
439
-DICT_VALUE *rc_dict_findval __P((char *));
440
-DICT_VALUE * rc_dict_getval __P((UINT4, char *));
441
-
442
-/*	ip_util.c		*/
443
-
444
-UINT4 rc_get_ipaddr __P((char *));
445
-int rc_good_ipaddr __P((char *));
446
-const char *rc_ip_hostname __P((UINT4));
447
-unsigned short rc_getport __P((int));
448
-int rc_own_hostname __P((char *, int));
449
-UINT4 rc_own_ipaddress __P((void));
450
-
451
-
452
-/*	log.c			*/
453
-
454
-void rc_openlog __P((char *));
455
-void rc_log __P((int, const char *, ...));
456
-
457
-/*	sendserver.c		*/
458
-
459
-int rc_send_server __P((SEND_DATA *, char *));
460
-
461
-/*	util.c			*/
462
-
463
-void rc_str2tm __P((char *, struct tm *));
464
-char *rc_mksid __P((void));
465
-char *rc_getifname __P((char *));
466
-char *rc_getstr __P((char *, int));
467
-void rc_mdelay __P((int));
468
-char *rc_mksid __P((void));
469
-
470
-/*	env.c			*/
471
-
472
-struct env *rc_new_env __P((int));
473
-void rc_free_env __P((struct env *));
474
-int rc_add_env __P((struct env *, char *, char *));
475
-int rc_import_env __P((struct env *, char **));
476
-
477
-/* md5.c			*/
478
-
479
-void rc_md5_calc __P((unsigned char *, unsigned char *, unsigned int));
480
-
481
-__END_DECLS
482
-
483
-#endif /* RADIUSCLIENT_H */