radius.h revision 43693
1107590Sobrien/* 2169689Skan * Copyright 1999 Internet Business Solutions Ltd., Switzerland 3132718Skan * All rights reserved. 4107590Sobrien * 5107590Sobrien * Redistribution and use in source and binary forms, with or without 6107590Sobrien * modification, are permitted provided that the following conditions 7132718Skan * are met: 8107590Sobrien * 1. Redistributions of source code must retain the above copyright 9132718Skan * notice, this list of conditions and the following disclaimer. 10132718Skan * 2. Redistributions in binary form must reproduce the above copyright 11132718Skan * notice, this list of conditions and the following disclaimer in the 12132718Skan * documentation and/or other materials provided with the distribution. 13107590Sobrien * 14132718Skan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15132718Skan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16132718Skan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17132718Skan * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18132718Skan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19107590Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20132718Skan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21169689Skan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22169689Skan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23107590Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24107590Sobrien * SUCH DAMAGE. 25169689Skan * 26107590Sobrien * $Id: radius.h,v 1.1 1999/01/28 01:56:34 brian Exp $ 27169689Skan */ 28107590Sobrien 29107590Sobrienstruct radius { 30132718Skan struct descriptor desc; /* We're a sort of (selectable) descriptor */ 31132718Skan struct { 32132718Skan int fd; /* We're selecting on this */ 33169689Skan struct rad_handle *rad; /* Using this to talk to our lib */ 34132718Skan struct pppTimer timer; /* for this long */ 35132718Skan struct authinfo *auth; /* Tell this about success/failure */ 36169689Skan } cx; 37132718Skan unsigned valid : 1; /* Is this structure valid ? */ 38132718Skan unsigned vj : 1; /* FRAMED Compression */ 39169689Skan struct in_addr ip; /* FRAMED IP */ 40169689Skan struct in_addr mask; /* FRAMED Netmask */ 41132718Skan unsigned long mtu; /* FRAMED MTU */ 42169689Skan struct sticky_route *routes; /* FRAMED Routes */ 43169689Skan struct { 44169689Skan char file[MAXPATHLEN]; /* Radius config file */ 45169689Skan } cfg; 46169689Skan}; 47169689Skan 48169689Skan#define descriptor2radius(d) \ 49107590Sobrien ((d)->type == RADIUS_DESCRIPTOR ? (struct radius *)(d) : NULL) 50107590Sobrien 51107590Sobrienstruct bundle; 52107590Sobrien 53107590Sobrienextern void radius_Init(struct radius *); 54107590Sobrienextern void radius_Destroy(struct radius *); 55117395Skan 56117395Skanextern void radius_Show(struct radius *, struct prompt *); 57117395Skanextern void radius_Authenticate(struct radius *, struct authinfo *, 58107590Sobrien const char *, const char *, const char *); 59117395Skan