1 | /* 2 | * Layer Two Tunnelling Protocol Daemon 3 | * Copyright (C) 1998 Adtran, Inc. 4 | * 5 | * Mark Spencer 6 | * 7 | * This software is distributed under the terms 8 | * of the GPL, which you should have received 9 | * along with this source. 10 | * 11 | * Authorization, Accounting, and Access control 12 | * 13 | */ 14 | 15 | #ifndef _AAA_H 16 | #define _AAA_H 17 | #include "md5.h" 18 | 19 | #define ADDR_HASH_SIZE 256 20 | #define MD_SIG_SIZE 16 21 | #define MAX_VECTOR_SIZE 1024 22 | #define VECTOR_SIZE 16 23 | 24 | #define STATE_NONE 0 25 | #define STATE_CHALLENGED 1 26 | #define STATE_COMPLETE 2 27 | 28 | struct addr_ent 29 | { 30 | unsigned int addr; 31 | struct addr_ent *next; 32 | }; 33 | 34 | struct challenge 35 | { 36 | struct MD5Context md5; 37 | unsigned char ss; /* State we're sending in */ 38 | unsigned char secret[MAXSTRLEN]; /* The shared secret */ 39 | unsigned char challenge[MD_SIG_SIZE]; /* The original challenge */ 40 | unsigned char response[MD_SIG_SIZE]; /* What we expect as a respsonse */ 41 | unsigned char reply[MD_SIG_SIZE]; /* What the peer sent */ 42 | unsigned char *vector; 43 | unsigned int vector_len; 44 | int state; /* What state is challenge in? */ 45 | }; 46 | 47 | extern struct lns *get_lns (struct tunnel *); 48 | extern struct addr_ent *uaddr[]; 49 | extern unsigned int get_addr (struct iprange *); 50 | extern void reserve_addr (unsigned int); 51 | extern void unreserve_addr (unsigned int); 52 | extern void init_addr (); 53 | extern int handle_challenge (struct tunnel *, struct challenge *); 54 | extern void mk_challenge (char *, int); 55 | #endif