xref: /openbsd/usr.sbin/rbootd/conf.c (revision 404b540a)
1 /*	$OpenBSD: conf.c,v 1.6 2004/05/01 00:39:22 deraadt Exp $	*/
2 /*	$NetBSD: conf.c,v 1.5 1995/10/06 05:12:13 thorpej Exp $	*/
3 
4 /*
5  * Copyright (c) 1988, 1992 The University of Utah and the Center
6  *	for Software Science (CSS).
7  * Copyright (c) 1992, 1993
8  *	The Regents of the University of California.  All rights reserved.
9  *
10  * This code is derived from software contributed to Berkeley by
11  * the Center for Software Science of the University of Utah Computer
12  * Science Department.  CSS requests users of this software to return
13  * to css-dist@cs.utah.edu any improvements that they make and grant
14  * CSS redistribution rights.
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions
18  * are met:
19  * 1. Redistributions of source code must retain the above copyright
20  *    notice, this list of conditions and the following disclaimer.
21  * 2. Redistributions in binary form must reproduce the above copyright
22  *    notice, this list of conditions and the following disclaimer in the
23  *    documentation and/or other materials provided with the distribution.
24  * 3. Neither the name of the University nor the names of its contributors
25  *    may be used to endorse or promote products derived from this software
26  *    without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38  * SUCH DAMAGE.
39  *
40  *	from: @(#)conf.c	8.1 (Berkeley) 6/4/93
41  *
42  * From: Utah Hdr: conf.c 3.1 92/07/06
43  * Author: Jeff Forys, University of Utah CSS
44  */
45 
46 #ifndef lint
47 /*static char sccsid[] = "@(#)conf.c	8.1 (Berkeley) 6/4/93";*/
48 static char rcsid[] = "$OpenBSD: conf.c,v 1.6 2004/05/01 00:39:22 deraadt Exp $";
49 #endif /* not lint */
50 
51 #include <sys/param.h>
52 #include <sys/time.h>
53 
54 #include <stdio.h>
55 #include "defs.h"
56 #include "pathnames.h"
57 
58 /*
59 **  Define (and possibly initialize) global variables here.
60 **
61 **  Caveat:
62 **	The maximum number of bootable files (`char *BootFiles[]') is
63 **	limited to C_MAXFILE (i.e. the maximum number of files that
64 **	can be spec'd in the configuration file).  This was done to
65 **	simplify the boot file search code.
66 */
67 
68 char	MyHost[MAXHOSTNAMELEN];			/* host name */
69 int	DebugFlg = 0;				/* set true if debugging */
70 int	BootAny = 0;				/* set true if we boot anyone */
71 
72 char	*ConfigFile = NULL;			/* configuration file */
73 char	*DfltConfig = _PATH_RBOOTDCONF;		/* default configuration file */
74 char	*BootDir = _PATH_RBOOTDDIR;		/* directory w/boot files */
75 char	*DbgFile = _PATH_RBOOTDDBG;		/* debug output file */
76 
77 FILE	*DbgFp = NULL;				/* debug file pointer */
78 char	*IntfName = NULL;			/* intf we are attached to */
79 
80 u_int16_t SessionID = 0;			/* generated session ID */
81 
82 char	*BootFiles[C_MAXFILE];			/* list of boot files */
83 
84 CLIENT	*Clients = NULL;			/* list of addrs we'll accept */
85 RMPCONN	*RmpConns = NULL;			/* list of active connections */
86 
87 u_int8_t RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR;	/* RMP multicast address */
88