1/* 2 * $Id: options.h,v 1.1 2004/11/14 07:26:26 paulus Exp $ 3 * 4 * Copyright (C) 1996 Lars Fenneberg 5 * 6 * See the file COPYRIGHT for the respective terms and conditions. 7 * If the file is missing contact me at lf@elemental.net 8 * and I'll send you a copy. 9 * 10 */ 11 12#define OPTION_LEN 64 13 14/* ids for different option types */ 15#define OT_STR (1<<0) /* string */ 16#define OT_INT (1<<1) /* integer */ 17#define OT_SRV (1<<2) /* server list */ 18#define OT_AUO (1<<3) /* authentication order */ 19 20#define OT_ANY ((unsigned int)~0) /* used internally */ 21 22/* status types */ 23#define ST_UNDEF (1<<0) /* option is undefined */ 24 25typedef struct _option { 26 char name[OPTION_LEN]; /* name of the option */ 27 int type, status; /* type and status */ 28 void *val; /* pointer to option value */ 29} OPTION; 30 31static SERVER acctserver = {0}; 32static SERVER authserver = {0}; 33 34int default_tries = 4; 35int default_timeout = 60; 36 37static OPTION config_options[] = { 38/* internally used options */ 39{"config_file", OT_STR, ST_UNDEF, NULL}, 40/* General options */ 41{"auth_order", OT_AUO, ST_UNDEF, NULL}, 42{"login_tries", OT_INT, ST_UNDEF, &default_tries}, 43{"login_timeout", OT_INT, ST_UNDEF, &default_timeout}, 44{"nologin", OT_STR, ST_UNDEF, "/etc/nologin"}, 45{"issue", OT_STR, ST_UNDEF, "/etc/radiusclient/issue"}, 46/* RADIUS specific options */ 47{"authserver", OT_SRV, ST_UNDEF, &authserver}, 48{"acctserver", OT_SRV, ST_UNDEF, &acctserver}, 49{"servers", OT_STR, ST_UNDEF, NULL}, 50{"dictionary", OT_STR, ST_UNDEF, NULL}, 51{"login_radius", OT_STR, ST_UNDEF, "/usr/sbin/login.radius"}, 52{"seqfile", OT_STR, ST_UNDEF, NULL}, 53{"mapfile", OT_STR, ST_UNDEF, NULL}, 54{"default_realm", OT_STR, ST_UNDEF, NULL}, 55{"radius_timeout", OT_INT, ST_UNDEF, NULL}, 56{"radius_retries", OT_INT, ST_UNDEF, NULL}, 57{"nas_identifier", OT_STR, ST_UNDEF, ""}, 58/* local options */ 59{"login_local", OT_STR, ST_UNDEF, NULL}, 60}; 61 62static int num_options = ((sizeof(config_options))/(sizeof(config_options[0]))); 63