Allow IPv6 address entry in tools>ping - Loosens valid character check
[tomato/davidwu.git] / release / src / router / xl2tpd / aaa.h
blob318c7ebe4f9c8f77917108ca9a8dcaa4e5449f9a
1 /*
2 * Layer Two Tunnelling Protocol Daemon
3 * Copyright (C) 1998 Adtran, Inc.
4 * Copyright (C) 2002 Jeff McAdams
6 * Mark Spencer
8 * This software is distributed under the terms
9 * of the GPL, which you should have received
10 * along with this source.
12 * Authorization, Accounting, and Access control
16 #ifndef _AAA_H
17 #define _AAA_H
18 #include "md5.h"
20 #define ADDR_HASH_SIZE 256
21 #define MD_SIG_SIZE 16
22 #define MAX_VECTOR_SIZE 1024
23 #define VECTOR_SIZE 16
25 #define STATE_NONE 0
26 #define STATE_CHALLENGED 1
27 #define STATE_COMPLETE 2
29 struct addr_ent
31 unsigned int addr;
32 struct addr_ent *next;
35 struct challenge
37 struct MD5Context md5;
38 unsigned char ss; /* State we're sending in */
39 unsigned char secret[MAXSTRLEN]; /* The shared secret */
40 unsigned char *challenge; /* The original challenge */
41 unsigned int chal_len; /* The length of the original challenge */
42 unsigned char response[MD_SIG_SIZE]; /* What we expect as a respsonse */
43 unsigned char reply[MD_SIG_SIZE]; /* What the peer sent */
44 unsigned char *vector;
45 unsigned int vector_len;
46 int state; /* What state is challenge in? */
49 extern struct lns *get_lns (struct tunnel *);
50 extern unsigned int get_addr (struct iprange *);
51 extern void reserve_addr (unsigned int);
52 extern void unreserve_addr (unsigned int);
53 extern void init_addr ();
54 extern int handle_challenge (struct tunnel *, struct challenge *);
55 extern void mk_challenge (unsigned char *, int);
56 #endif