Import of tac_plus.v8.tar.gz: 173206 bytes, md5:
[tac_plus.git] / tac_plus.h
1 /* 
2    Copyright (c) 1995-1998 by Cisco systems, Inc.
3
4    Permission to use, copy, modify, and distribute this software for
5    any purpose and without fee is hereby granted, provided that this
6    copyright and permission notice appear on all copies of the
7    software and supporting documentation, the name of Cisco Systems,
8    Inc. not be used in advertising or publicity pertaining to
9    distribution of the program without specific prior permission, and
10    notice be given in supporting documentation that modification,
11    copying and distribution is by permission of Cisco Systems, Inc.
12
13    Cisco Systems, Inc. makes no representations about the suitability
14    of this software for any purpose.  THIS SOFTWARE IS PROVIDED ``AS
15    IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
16    WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17    FITNESS FOR A PARTICULAR PURPOSE.
18 */
19 /* For autoconfig */
20 #include "config.h"
21
22 /* 
23  * If you are defining a system from scratch, the following may be useful.
24  * Otherwise, just use the system definitions below this section.
25  */
26
27 /* Define this for minor include file differences on SYSV-based systems */
28 /* #define SYSV */
29
30 /* Define this if your sys_errlist is defined using const */
31 /* #define CONST_SYSERRLIST */
32
33 /* Do you need tacacs+ versions of bzero etc. */
34 /* #define NEED_BZERO */
35
36 /* Define this if you have shadow passwords in /etc/passwd and
37  * /etc/shadow. Note that you usually need to be root to read
38  * /etc/shadow */
39 /*#define SHADOW_PASSWORDS*/
40
41 /* Define this if your malloc is defined in malloc.h instead of stdlib.h */
42 /* #define STDLIB_MALLOC */
43
44 /* Define this if your wait call status is a union as opposed to an int */
45 /* #define UNIONWAIT */
46
47 /* Define this if your signal() uses a function returning void instead 
48  * of int
49  */
50 /* #define VOIDSIG */
51
52 /* Define this if your password file does not contain age and comment fields. */
53 /* #define NO_PWAGE */
54
55 /* Define this if you need a getdtablesize routine defined */
56 /* #define GETDTABLESIZE */
57
58 /* Define this if your system does not reap children automatically
59  * when you ignore SIGCLD */
60 /* #define REAPCHILD */
61
62 /* Define this if you have DES routines you can link to for ARAP (See
63  * the user's guide for more details). 
64  */
65 /* #define ARAP_DES */
66
67 /* Define this if you find that your daemon quits after being sent more than
68  * one SIGUSR1. Some systems need to explicitly rearm signals after they've been
69  * used once
70  */
71 /* #define REARMSIGNAL */
72
73 #define VERSION "F4.0.3.alpha.v8 (Extended Tac_plus)"
74
75 /*
76  * System definitions. 
77  */
78
79 #ifdef NETBSD
80 #define STDLIB_MALLOC
81 #define NO_PWAGE
82 #define CONST_SYSERRLIST
83 #define VOIDSIG
84 #endif
85
86 #ifdef AIX
87
88 /* 
89  * The only way to properly compile BSD stuff on AIX is to define a
90  * "bsdcc" compiler on your system. See /usr/lpp/bos/bsdport on your
91  * system for details. People who do NOT do this tell me that the code
92  * still compiles but that it then doesn't behave correctly e.g. child
93  * processes are not reaped correctly. Don't expect much sympathy if
94  * you do this.
95  */
96
97 #define _BSD 1
98 #define _BSD_INCLUDES
99 #define UNIONWAIT
100 #define NO_PWAGE
101 #endif /* AIX */
102
103 #ifdef LINUX
104 #define VOIDSIG
105 #define NO_PWAGE
106 #define REAPCHILD
107 #include <unistd.h>
108 #define REARMSIGNAL
109 #ifdef GLIBC
110 #define CONST_SYSERRLIST
111 #endif
112 #endif /* LINUX */
113
114 #ifdef MIPS
115 #define SYSV
116 #define GETDTABLESIZE
117 #define REAPCHILD
118 #define NEED_BZERO
119 #endif /* MIPS */
120
121 #ifdef SOLARIS
122 #define SYSV
123 #define GETDTABLESIZE
124 #define REAPCHILD
125 #define SHADOW_PASSWORDS
126 #define NEED_BZERO
127 #define REARMSIGNAL
128 #endif /* SOLARIS */
129
130 #ifdef HPUX
131 #define SYSV
132 #define GETDTABLESIZE
133 #define REAPCHILD
134 #define SYSLOG_IN_SYS
135 #define REARMSIGNAL
136 #endif /* HPUX */
137
138 #ifdef FREEBSD
139 #define CONST_SYSERRLIST
140 #define STDLIB_MALLOC
141 #define VOIDSIG
142 #define NO_PWAGE
143 #endif
144
145 #ifdef BSDI
146 #define VOIDSIG
147 #define STDLIB_MALLOC
148 #define NO_PWAGE
149 #endif
150
151 #define MD5_LEN           16
152 #ifdef MSCHAP
153 #define MSCHAP_DIGEST_LEN 49
154 #endif /* MSCHAP */
155
156 #include <string.h>
157 #include <sys/types.h>
158 #include <sys/socket.h>
159 #include <sys/ioctl.h>
160 #include <sys/file.h>
161 #include <sys/time.h>
162 #include <netinet/in.h>
163
164 #include <stdio.h>
165 #include <errno.h>
166 #include <pwd.h>
167 #include <netdb.h>
168
169 #ifdef SYSLOG_IN_SYS
170 #include <syslog.h>
171 #else
172 #include <sys/syslog.h>
173 #endif
174
175 #include <utmp.h>
176
177 #include <unistd.h>
178
179 #ifdef SYSV
180 #include <fcntl.h>
181 #define index strchr
182 #else /* ! SYSV */
183 #include <strings.h>
184 #endif  /* SYSV */
185
186 #ifndef TACPLUS_PIDFILE
187 #define TACPLUS_PIDFILE "/var/run/tac_plus.pid"
188 #endif
189
190
191 /* 
192  * You probably shouldn't be changing much below this line unless you really
193  * know what you are doing.
194  */
195
196 #define DOLLARSIGN '$'
197
198 /*
199  * XTACACSP protocol defintions
200  */
201
202 /*
203  * This structure describes an authentication method.
204  *   authen_name     contains the name of the authentication method.
205  *   authen_func     is a pointer to the authentication function.
206  *   authen_method   numeric value of authentication method
207  */
208
209 #define AUTHEN_NAME_SIZE 128
210
211 struct authen_type {
212     char authen_name[AUTHEN_NAME_SIZE];
213     int (*authen_func)();
214     int authen_type;
215 };
216
217 /*
218  * This structure describes a principal that is to be authenticated.
219  *   username        is the principals name (ASCII, null terminated)
220  *   NAS_name        is the name of the NAS where the user is
221  *   NAS_port        is the port on the NAS where the user is
222  *   NAC_address     is the remote user location.  This may be
223  *                   a remote IP address or a caller-ID or ...
224  *   priv_lvl        user's requested privilege level.
225  */
226
227 struct identity {
228     char *username;
229     char *NAS_name;
230     char *NAS_port;
231     char *NAC_address;
232     int priv_lvl;
233 };
234
235 /*
236  * The authen_data structure is the data structure for passing
237  * information to and from the authentication function
238  * (authen_type.authen_func).
239  */
240
241 struct authen_data {
242     struct identity *NAS_id;    /* user identity */
243     char *server_msg;           /* null-terminated output msg */
244
245     int server_dlen;            /* output data length */
246     char *server_data;          /* output data */
247
248     char *client_msg;           /* null-terminated input msg a user typed */
249
250     int client_dlen;            /* input data length */
251     char *client_data;          /* input data */
252
253     void *method_data;          /* opaque private method data */
254     int action;                 /* what's to be done */
255     int service;                /* calling service */
256     int status;                 /* Authen status */
257     int type;                   /* Authen type */
258     u_char flags;               /* input & output flags fields */
259 };
260
261
262 /* return values for  choose_authen(); */
263
264 #define CHOOSE_FAILED -1     /* failed to choose an authentication function */
265 #define CHOOSE_OK      0     /* successfully chose an authentication function */
266 #define CHOOSE_GETUSER 1     /* need a username before choosing */
267 #define CHOOSE_BADTYPE 2     /* Invalid preferred authen function specified */
268
269
270 /*
271  * This structure is the data structure for passing information to
272  * and from the authorization function (do_author()).
273  */
274 struct author_data {
275     struct identity *id;        /* user id */
276     int authen_method;          /* authentication method */
277
278 #define AUTHEN_METH_NONE             0x01
279 #define AUTHEN_METH_KRB5             0x02
280 #define AUTHEN_METH_LINE             0x03
281 #define AUTHEN_METH_ENABLE           0x04
282 #define AUTHEN_METH_LOCAL            0x05
283 #define AUTHEN_METH_TACACSPLUS       0x06
284 #define AUTHEN_METH_RCMD             0x20
285
286     int authen_type;            /* authentication type see authen_type */
287     int service;                /* calling service */
288     char *msg;                  /* optional NULL-terminated return message */
289     char *admin_msg;            /* optional NULL-terminated admin message */
290     int status;                 /* return status */
291
292 #define AUTHOR_STATUS_PASS_ADD       0x01
293 #define AUTHOR_STATUS_PASS_REPL      0x02
294 #define AUTHOR_STATUS_FAIL           0x10
295 #define AUTHOR_STATUS_ERROR          0x11
296
297     int num_in_args;            /* input arg count */
298     char **input_args;          /* input arguments */
299     int num_out_args;           /* output arg cnt */
300     char **output_args;         /* output arguments */
301
302 };
303
304 /* An API accounting record structure */
305 struct acct_rec {
306     int acct_type;              /* start, stop, update */
307
308 #define ACCT_TYPE_START      1
309 #define ACCT_TYPE_STOP       2
310 #define ACCT_TYPE_UPDATE     3
311
312     struct identity *identity;
313     int authen_method;
314     int authen_type;
315     int authen_service;
316     char *msg;       /* output field */
317     char *admin_msg; /* output field */
318     int num_args;
319     char **args;
320 };
321
322 #ifndef TAC_PLUS_PORT
323 #define TAC_PLUS_PORT                   49
324 #endif
325
326 /* Define tac_plus name for hosts.* files */ 
327 #ifdef TCPWRAPPER
328 #define TACNAME                         "tac_plus"
329 #endif
330
331 #define TAC_PLUS_READ_TIMEOUT           180     /* seconds */
332 #define TAC_PLUS_WRITE_TIMEOUT          180     /* seconds */
333
334 #define NAS_PORT_MAX_LEN                255
335
336 struct session {
337     int session_id;                /* host specific unique session id */
338     int aborted;                   /* have we received an abort flag? */
339     int seq_no;                    /* seq. no. of last packet exchanged */
340     time_t last_exch;              /* time of last packet exchange */
341     int sock;                      /* socket for this connection */
342     char *key;                     /* the key */
343     int keyline;                   /* line number key was found on */
344     char *peer;                    /* name of connected peer */
345     char *cfgfile;                 /* config file name */
346     char *acctfile;                /* name of accounting file */
347     char *db_acct;                 /* name of db accounting string */
348     char port[NAS_PORT_MAX_LEN+1]; /* For error reporting */
349     u_char version;                /* version of last packet read */
350 };
351
352 extern struct session session;     /* the session */
353
354 /* Global variables */
355
356 extern int debug;                  /* debugging flag */
357 extern int logging;                /* syslog logging flag */
358 extern int single;                 /* do not fork (for debugging) */
359 extern int console;                /* log to console */
360 extern FILE *ostream;              /* for logging to console */
361 extern int parse_only;             /* exit after parsing verbosely */
362 extern int sendauth_only;          /* don't do sendauth */
363
364 /* All tacacs+ packets have the same header format */
365
366 struct tac_plus_pak_hdr {
367     u_char version;
368
369 #define TAC_PLUS_MAJOR_VER_MASK 0xf0
370 #define TAC_PLUS_MAJOR_VER      0xc0
371
372 #define TAC_PLUS_MINOR_VER_0    0x0
373 #define TAC_PLUS_VER_0  (TAC_PLUS_MAJOR_VER | TAC_PLUS_MINOR_VER_0)
374
375 #define TAC_PLUS_MINOR_VER_1    0x01
376 #define TAC_PLUS_VER_1  (TAC_PLUS_MAJOR_VER | TAC_PLUS_MINOR_VER_1)
377
378     u_char type;
379
380 #define TAC_PLUS_AUTHEN                 1
381 #define TAC_PLUS_AUTHOR                 2
382 #define TAC_PLUS_ACCT                   3
383
384     u_char seq_no;              /* packet sequence number */
385     u_char encryption;          /* packet is encrypted or cleartext */
386
387 #define TAC_PLUS_ENCRYPTED 0x0          /* packet is encrypted */
388 #define TAC_PLUS_CLEAR     0x1          /* packet is not encrypted */
389
390     int session_id;             /* session identifier FIXME: Is this needed? */
391     int datalength;             /* length of encrypted data following this
392                                  * header */
393     /* datalength bytes of encrypted data */
394 };
395
396 #define HASH_TAB_SIZE 157        /* user and group hash table sizes */
397
398 #define TAC_PLUS_HDR_SIZE 12
399
400 typedef struct tac_plus_pak_hdr HDR;
401
402 /* Authentication packet NAS sends to us */ 
403
404 struct authen_start {
405     u_char action;
406
407 #define TAC_PLUS_AUTHEN_LOGIN    0x1
408 #define TAC_PLUS_AUTHEN_CHPASS   0x2
409 #define TAC_PLUS_AUTHEN_SENDPASS 0x3 /* deprecated */
410 #define TAC_PLUS_AUTHEN_SENDAUTH 0x4
411
412     u_char priv_lvl;
413
414 #define TAC_PLUS_PRIV_LVL_MIN 0x0
415 #define TAC_PLUS_PRIV_LVL_MAX 0xf
416
417     u_char authen_type;
418
419 #define TAC_PLUS_AUTHEN_TYPE_ASCII  1
420 #define TAC_PLUS_AUTHEN_TYPE_PAP    2
421 #define TAC_PLUS_AUTHEN_TYPE_CHAP   3
422 #define TAC_PLUS_AUTHEN_TYPE_ARAP   4
423 #ifdef MSCHAP
424 #define TAC_PLUS_AUTHEN_TYPE_MSCHAP 5
425 #endif /* MSCHAP */
426
427     u_char service;
428
429 #define TAC_PLUS_AUTHEN_SVC_LOGIN  1
430 #define TAC_PLUS_AUTHEN_SVC_ENABLE 2
431 #define TAC_PLUS_AUTHEN_SVC_PPP    3
432 #define TAC_PLUS_AUTHEN_SVC_ARAP   4
433 #define TAC_PLUS_AUTHEN_SVC_PT     5
434 #define TAC_PLUS_AUTHEN_SVC_RCMD   6
435 #define TAC_PLUS_AUTHEN_SVC_X25    7
436 #define TAC_PLUS_AUTHEN_SVC_NASI   8
437
438     u_char user_len;
439     u_char port_len;
440     u_char rem_addr_len;
441     u_char data_len;
442     /* <user_len bytes of char data> */
443     /* <port_len bytes of char data> */
444     /* <rem_addr_len bytes of u_char data> */
445     /* <data_len bytes of u_char data> */
446 };
447
448 #define TAC_AUTHEN_START_FIXED_FIELDS_SIZE 8
449
450 /* Authentication continue packet NAS sends to us */ 
451 struct authen_cont {
452     u_short user_msg_len;
453     u_short user_data_len;
454     u_char flags;
455
456 #define TAC_PLUS_CONTINUE_FLAG_ABORT 0x1
457
458     /* <user_msg_len bytes of u_char data> */
459     /* <user_data_len bytes of u_char data> */
460 };
461
462 #define TAC_AUTHEN_CONT_FIXED_FIELDS_SIZE 5
463
464 /* Authentication reply packet we send to NAS */ 
465 struct authen_reply {
466     u_char status;
467
468 #define TAC_PLUS_AUTHEN_STATUS_PASS     1
469 #define TAC_PLUS_AUTHEN_STATUS_FAIL     2
470 #define TAC_PLUS_AUTHEN_STATUS_GETDATA  3
471 #define TAC_PLUS_AUTHEN_STATUS_GETUSER  4
472 #define TAC_PLUS_AUTHEN_STATUS_GETPASS  5
473 #define TAC_PLUS_AUTHEN_STATUS_RESTART  6
474 #define TAC_PLUS_AUTHEN_STATUS_ERROR    7 
475 #define TAC_PLUS_AUTHEN_STATUS_FOLLOW   0x21
476
477     u_char flags;
478
479 #define TAC_PLUS_AUTHEN_FLAG_NOECHO     0x1
480
481     u_short msg_len;
482     u_short data_len;
483
484     /* <msg_len bytes of char data> */
485     /* <data_len bytes of u_char data> */
486 };
487
488 #define TAC_AUTHEN_REPLY_FIXED_FIELDS_SIZE 6
489
490 /* An authorization request packet */
491 struct author {
492     u_char authen_method;
493     u_char priv_lvl;
494     u_char authen_type;
495     u_char service;
496
497     u_char user_len;
498     u_char port_len;
499     u_char rem_addr_len;
500     u_char arg_cnt;             /* the number of args */
501
502     /* <arg_cnt u_chars containing the lengths of args 1 to arg n> */
503     /* <user_len bytes of char data> */
504     /* <port_len bytes of char data> */
505     /* <rem_addr_len bytes of u_char data> */
506     /* <char data for each arg> */
507 };
508
509 #define TAC_AUTHOR_REQ_FIXED_FIELDS_SIZE 8
510
511 /* An authorization reply packet */
512 struct author_reply {
513     u_char status;
514     u_char arg_cnt;
515     u_short msg_len;
516     u_short data_len;
517
518     /* <arg_cnt u_chars containing the lengths of arg 1 to arg n> */
519     /* <msg_len bytes of char data> */
520     /* <data_len bytes of char data> */
521     /* <char data for each arg> */
522 };
523
524 #define TAC_AUTHOR_REPLY_FIXED_FIELDS_SIZE 6
525
526 struct acct {
527     u_char flags;
528
529 #define TAC_PLUS_ACCT_FLAG_MORE     0x1
530 #define TAC_PLUS_ACCT_FLAG_START    0x2
531 #define TAC_PLUS_ACCT_FLAG_STOP     0x4
532 #define TAC_PLUS_ACCT_FLAG_WATCHDOG 0x8
533             
534     u_char authen_method;
535     u_char priv_lvl;
536     u_char authen_type;
537     u_char authen_service;
538     u_char user_len;
539     u_char port_len;
540     u_char rem_addr_len;
541     u_char arg_cnt; /* the number of cmd args */
542     /* one u_char containing size for each arg */
543     /* <user_len bytes of char data> */
544     /* <port_len bytes of char data> */
545     /* <rem_addr_len bytes of u_char data> */
546     /* char data for args 1 ... n */
547 };
548
549 #define TAC_ACCT_REQ_FIXED_FIELDS_SIZE 9
550
551 struct acct_reply {
552     u_short msg_len;
553     u_short data_len;
554     u_char status;
555
556 #define TAC_PLUS_ACCT_STATUS_SUCCESS 0x1
557 #define TAC_PLUS_ACCT_STATUS_ERROR   0x2
558 #define TAC_PLUS_ACCT_STATUS_FOLLOW  0x21
559
560 };
561
562 #define TAC_ACCT_REPLY_FIXED_FIELDS_SIZE 5
563
564 /* Odds and ends */
565 #define TAC_PLUS_MAX_ITERATIONS 50
566 #undef MIN
567 #define MIN(a,b) ((a)<(b)?(a):(b))
568 #define STREQ(a,b) (strcmp(a,b)==0)
569 #define MAX_INPUT_LINE_LEN 255
570
571 /* Debugging flags */
572
573 #define DEBUG_PARSE_FLAG     2
574 #define DEBUG_FORK_FLAG      4
575 #define DEBUG_AUTHOR_FLAG    8
576 #define DEBUG_AUTHEN_FLAG    16
577 #define DEBUG_PASSWD_FLAG    32
578 #define DEBUG_ACCT_FLAG      64
579 #define DEBUG_CONFIG_FLAG    128
580 #define DEBUG_PACKET_FLAG    256
581 #define DEBUG_HEX_FLAG       512
582 #define DEBUG_MD5_HASH_FLAG  1024
583 #define DEBUG_XOR_FLAG       2048
584 #define DEBUG_CLEAN_FLAG     4096
585 #define DEBUG_SUBST_FLAG     8192
586 #define DEBUG_PROXY_FLAG     16384
587 #define DEBUG_MAXSESS_FLAG   32768
588 #define DEBUG_LOCK_FLAG      65536
589
590 extern char *codestring();
591 extern int keycode();
592
593 #define TAC_IS_USER           1
594 #define TAC_PLUS_RECURSE      1
595 #define TAC_PLUS_NORECURSE    0
596
597 #define DEFAULT_USERNAME "DEFAULT"
598
599 #include "parse.h"
600
601 /* Node types */
602
603 #define N_arg           50
604 #define N_optarg        51
605 #define N_svc_exec      52
606 #define N_svc_slip      53
607 #define N_svc_ppp       54
608 #define N_svc_arap      55
609 #define N_svc_cmd       56
610 #define N_permit        57
611 #define N_deny          58
612 #define N_svc           59
613
614 /* A parse tree node */
615 struct node {
616     int type;     /* node type (arg, svc, proto) */
617     void *next;   /* pointer to next node in chain */
618     void *value;  /* node value */
619     void *value1; /* node value */
620     int dflt;     /* default value for node */
621     int line;     /* line number declared on */
622 };
623
624 typedef struct node NODE;
625
626 union v {
627     int intval;
628     void *pval;
629 };
630
631 typedef union v VALUE;
632
633 /* acct.c */
634 extern void accounting();
635
636 /* report.c */
637 extern void report_string();
638 extern void report_hex();
639 #ifdef __STDC__
640 extern void report(int priority, char *fmt,...);
641 #else
642 extern void report();
643 #endif
644
645 /* packet.c */
646 extern u_char *get_authen_continue();
647 extern int send_authen_reply();
648
649 /* utils.c */
650 extern char *tac_malloc();
651 extern char *tac_strdup();
652 extern char *tac_make_string();
653 extern char *tac_find_substring();
654 extern char *tac_realloc();
655
656 /* dump.c */
657 extern char *summarise_outgoing_packet_type();
658 extern char *summarise_incoming_packet_type();
659
660 /* author.c */
661 extern void author();
662
663 /* hash.c */
664 extern void *hash_add_entry();
665 extern void **hash_get_entries();
666 extern void *hash_lookup();
667
668 /* config.c */
669 extern int cfg_get_intvalue();
670 extern char * cfg_get_pvalue();
671 extern char *cfg_get_authen_default();
672 extern int cfg_get_authen_default_method();
673 extern char **cfg_get_svc_attrs();
674 extern NODE *cfg_get_cmd_node();
675 extern NODE *cfg_get_svc_node();
676 extern char *cfg_get_expires();
677 extern char *cfg_get_login_secret();
678 extern int cfg_get_user_nopasswd();
679 extern char *cfg_get_arap_secret();
680 extern char *cfg_get_chap_secret();
681 #ifdef MSCHAP
682 extern char *cfg_get_mschap_secret();
683 #endif /* MSCHAP */
684 extern char *cfg_get_pap_secret();
685 extern char *cfg_get_opap_secret();
686 extern char *cfg_get_global_secret();
687 #ifdef USE_PAM
688 extern char *cfg_get_pam_service();
689 #endif / *PAM */ 
690 extern void cfg_clean_config();
691 extern char *cfg_nodestring();
692
693 /* pw.c */
694 extern struct passwd *tac_passwd_lookup();
695
696 /* parse.c */
697 extern void parser_init();
698
699 /* pwlib.c */
700 extern void set_expiration_status();
701
702 /* miscellaneous */
703 #ifdef CONST_SYSERRLIST
704 extern const char *const sys_errlist[];
705 #else
706 extern char *sys_errlist[];
707 #endif
708 extern int errno;
709 extern int sendauth_fn();
710 extern int sendpass_fn();
711 extern int enable_fn();
712 extern int default_fn();
713 extern int default_v0_fn();
714 extern int skey_fn();
715 #ifdef MSCHAP
716 extern void mschap_lmchallengeresponse();
717 extern void mschap_ntchallengeresponse();
718 #endif /* MSCHAP */
719
720 #ifdef MAXSESS
721
722 extern void maxsess_loginit();
723 extern int maxsess_check_count();
724
725 /*
726  * This is a shared file used to maintain a record of who's on
727  */
728 #define WHOLOG_DEFAULT "/var/log/tac_who.log"
729 extern char *wholog;
730 /*
731  * This is state kept per user/session
732  */
733 struct peruser {
734     char username[64];          /* User name */
735     char NAS_name[32];          /* NAS user logged into */
736     char NAS_port[32];          /*  ...port on that NAS */
737     char NAC_address[32];       /*  ...IP address of NAS */
738 };
739
740 #endif /* MAXSESS */
741
742 #ifdef USE_PAM
743 extern int tac_pam_authorization();
744 #endif
745
746 #define LOGFILE_DEFAULT "/var/log/tac_plus.log"
747
748 extern struct timeval started_at;
749 extern char *logfile;
750 extern char *wtmpfile;
751 extern int wtmpfd;