xref: /openbsd/usr.sbin/rbootd/conf.c (revision 76d0caae)
1 /*	$OpenBSD: conf.c,v 1.8 2015/01/16 06:40:19 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 #include <sys/time.h>
47 
48 #include <stdio.h>
49 #include <limits.h>
50 #include "defs.h"
51 #include "pathnames.h"
52 
53 /*
54 **  Define (and possibly initialize) global variables here.
55 **
56 **  Caveat:
57 **	The maximum number of bootable files (`char *BootFiles[]') is
58 **	limited to C_MAXFILE (i.e. the maximum number of files that
59 **	can be spec'd in the configuration file).  This was done to
60 **	simplify the boot file search code.
61 */
62 
63 char	MyHost[HOST_NAME_MAX+1];			/* host name */
64 int	DebugFlg = 0;				/* set true if debugging */
65 int	BootAny = 0;				/* set true if we boot anyone */
66 
67 char	*ConfigFile = NULL;			/* configuration file */
68 char	*DfltConfig = _PATH_RBOOTDCONF;		/* default configuration file */
69 char	*BootDir = _PATH_RBOOTDDIR;		/* directory w/boot files */
70 char	*DbgFile = _PATH_RBOOTDDBG;		/* debug output file */
71 
72 FILE	*DbgFp = NULL;				/* debug file pointer */
73 char	*IntfName = NULL;			/* intf we are attached to */
74 
75 u_int16_t SessionID = 0;			/* generated session ID */
76 
77 char	*BootFiles[C_MAXFILE];			/* list of boot files */
78 
79 CLIENT	*Clients = NULL;			/* list of addrs we'll accept */
80 RMPCONN	*RmpConns = NULL;			/* list of active connections */
81 
82 u_int8_t RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR;	/* RMP multicast address */
83