1 /*
2  *  Copyright conserver.com, 2000
3  *
4  *  Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com)
5  *
6  *  Copyright GNAC, Inc., 1998
7  */
8 
9 /*
10  * Copyright 1992 Purdue Research Foundation, West Lafayette, Indiana
11  * 47907.  All rights reserved.
12  *
13  * Written by Kevin S Braunsdorf, ksb@cc.purdue.edu, purdue!ksb
14  *
15  * This software is not subject to any license of the American Telephone
16  * and Telegraph Company or the Regents of the University of California.
17  *
18  * Permission is granted to anyone to use this software for any purpose on
19  * any computer system, and to alter it and redistribute it freely, subject
20  * to the following restrictions:
21  *
22  * 1. Neither the authors nor Purdue University are responsible for any
23  *    consequences of the use of this software.
24  *
25  * 2. The origin of this software must not be misrepresented, either by
26  *    explicit claim or by omission.  Credit to the authors and Purdue
27  *    University must appear in documentation and sources.
28  *
29  * 3. Altered versions must be plainly marked as such, and must not be
30  *    misrepresented as being the original software.
31  *
32  * 4. This notice may not be removed or altered.
33  */
34 
35 /* timers used to have various things happen */
36 #define T_STATE		0
37 #define T_CIDLE		1
38 #define T_MARK		2
39 #define T_REINIT	3
40 #define T_AUTOUP	4
41 #define T_ROLL		5
42 #define T_INITDELAY	6
43 #define T_MAX		7	/* T_MAX *must* be last */
44 
45 /* return values used by CheckPass()
46  */
47 #define AUTH_SUCCESS	0	/* ok                                   */
48 #define AUTH_NOUSER	1	/* no user                              */
49 #define AUTH_INVALID	2	/* invalid password                     */
50 
51 typedef struct grpent {		/* group info                           */
52     unsigned int id;		/* uniqueue group id                    */
53     unsigned short port;	/* port group listens on                */
54     pid_t pid;			/* pid of server for group              */
55     int imembers;		/* number of consoles in this group     */
56     CONSENT *pCElist;		/* list of consoles in this group       */
57     CONSENT *pCEctl;		/* our control `console'                */
58     CONSCLIENT *pCLall;		/* all clients to scan after select     */
59     CONSCLIENT *pCLfree;	/* head of free list                    */
60     struct grpent *pGEnext;	/* next group entry                     */
61 } GRPENT;
62 
63 extern time_t timers[];
64 
65 extern void Spawn(GRPENT *, int);
66 extern int CheckPass(char *, char *, FLAG);
67 extern void TagLogfile(const CONSENT *, char *, ...);
68 extern void TagLogfileAct(const CONSENT *, char *, ...);
69 extern void DestroyGroup(GRPENT *);
70 extern void DestroyConsent(GRPENT *, CONSENT *);
71 extern void SendClientsMsg(CONSENT *, char *);
72 extern void ResetMark(void);
73 extern void DestroyConsentUsers(CONSENTUSERS **);
74 extern CONSENTUSERS *ConsentFindUser(CONSENTUSERS *, char *);
75 extern int ConsentUserOk(CONSENTUSERS *, char *);
76 extern void DisconnectClient(GRPENT *, CONSCLIENT *, char *, FLAG);
77 extern int ClientAccess(CONSENT *, char *);
78 extern void DestroyClient(CONSCLIENT *);
79 extern int CheckPasswd(CONSCLIENT *, char *, FLAG);
80 extern void DeUtmp(GRPENT *, int);
81 extern void ClientWantsWrite(CONSCLIENT *);
82 extern void SendIWaitClientsMsg(CONSENT *, char *);
83 #if HAVE_OPENSSL
84 extern int AttemptSSL(CONSCLIENT *);
85 #endif
86