11592Srgrimes/*
21592Srgrimes * Copyright (c) 1988, 1992 The University of Utah and the Center
31592Srgrimes *	for Software Science (CSS).
41592Srgrimes * Copyright (c) 1992, 1993
51592Srgrimes *	The Regents of the University of California.  All rights reserved.
61592Srgrimes *
71592Srgrimes * This code is derived from software contributed to Berkeley by
81592Srgrimes * the Center for Software Science of the University of Utah Computer
91592Srgrimes * Science Department.  CSS requests users of this software to return
101592Srgrimes * to css-dist@cs.utah.edu any improvements that they make and grant
111592Srgrimes * CSS redistribution rights.
121592Srgrimes *
131592Srgrimes * Redistribution and use in source and binary forms, with or without
141592Srgrimes * modification, are permitted provided that the following conditions
151592Srgrimes * are met:
161592Srgrimes * 1. Redistributions of source code must retain the above copyright
171592Srgrimes *    notice, this list of conditions and the following disclaimer.
181592Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
191592Srgrimes *    notice, this list of conditions and the following disclaimer in the
201592Srgrimes *    documentation and/or other materials provided with the distribution.
211592Srgrimes * 3. All advertising materials mentioning features or use of this software
221592Srgrimes *    must display the following acknowledgement:
231592Srgrimes *	This product includes software developed by the University of
241592Srgrimes *	California, Berkeley and its contributors.
251592Srgrimes * 4. Neither the name of the University nor the names of its contributors
261592Srgrimes *    may be used to endorse or promote products derived from this software
271592Srgrimes *    without specific prior written permission.
281592Srgrimes *
291592Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
301592Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
311592Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
321592Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
331592Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
341592Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
351592Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
361592Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
371592Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
381592Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
391592Srgrimes * SUCH DAMAGE.
401592Srgrimes *
4127074Ssteve *	from: @(#)conf.c	8.1 (Berkeley) 6/4/93
421592Srgrimes *
4327074Ssteve * From: Utah Hdr: conf.c 3.1 92/07/06
441592Srgrimes * Author: Jeff Forys, University of Utah CSS
451592Srgrimes */
461592Srgrimes
471592Srgrimes#ifndef lint
4831386Scharnier#if 0
4927077Sstevestatic const char sccsid[] = "@(#)conf.c	8.1 (Berkeley) 6/4/93";
5031386Scharnier#endif
5131386Scharnierstatic const char rcsid[] =
5250476Speter  "$FreeBSD$";
531592Srgrimes#endif /* not lint */
541592Srgrimes
551592Srgrimes#include <sys/param.h>
561592Srgrimes#include <sys/time.h>
571592Srgrimes
581592Srgrimes#include <stdio.h>
591592Srgrimes#include "defs.h"
601592Srgrimes#include "pathnames.h"
611592Srgrimes
621592Srgrimes/*
631592Srgrimes**  Define (and possibly initialize) global variables here.
641592Srgrimes**
651592Srgrimes**  Caveat:
661592Srgrimes**	The maximum number of bootable files (`char *BootFiles[]') is
671592Srgrimes**	limited to C_MAXFILE (i.e. the maximum number of files that
681592Srgrimes**	can be spec'd in the configuration file).  This was done to
691592Srgrimes**	simplify the boot file search code.
701592Srgrimes*/
711592Srgrimes
7245422Sbrianchar	MyHost[MAXHOSTNAMELEN];			/* host name */
7327074Sstevepid_t	MyPid;					/* process id */
741592Srgrimesint	DebugFlg = 0;				/* set true if debugging */
751592Srgrimesint	BootAny = 0;				/* set true if we boot anyone */
761592Srgrimes
771592Srgrimeschar	*ConfigFile = NULL;			/* configuration file */
781592Srgrimeschar	*DfltConfig = _PATH_RBOOTDCONF;		/* default configuration file */
791592Srgrimeschar	*PidFile = _PATH_RBOOTDPID;		/* file w/pid of server */
801592Srgrimeschar	*BootDir = _PATH_RBOOTDLIB;		/* directory w/boot files */
811592Srgrimeschar	*DbgFile = _PATH_RBOOTDDBG;		/* debug output file */
821592Srgrimes
831592SrgrimesFILE	*DbgFp = NULL;				/* debug file pointer */
841592Srgrimeschar	*IntfName = NULL;			/* intf we are attached to */
851592Srgrimes
8627074Ssteveu_int16_t SessionID = 0;			/* generated session ID */
871592Srgrimes
881592Srgrimeschar	*BootFiles[C_MAXFILE];			/* list of boot files */
891592Srgrimes
901592SrgrimesCLIENT	*Clients = NULL;			/* list of addrs we'll accept */
911592SrgrimesRMPCONN	*RmpConns = NULL;			/* list of active connections */
921592Srgrimes
9327074Ssteveu_int8_t RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR;	/* RMP multicast address */
94