conf.c revision 45422
1117395Skan/* 2132718Skan * Copyright (c) 1988, 1992 The University of Utah and the Center 3132718Skan * for Software Science (CSS). 418334Speter * Copyright (c) 1992, 1993 5132718Skan * The Regents of the University of California. All rights reserved. 618334Speter * 7117395Skan * This code is derived from software contributed to Berkeley by 818334Speter * the Center for Software Science of the University of Utah Computer 9117395Skan * Science Department. CSS requests users of this software to return 10117395Skan * to css-dist@cs.utah.edu any improvements that they make and grant 11117395Skan * CSS redistribution rights. 12117395Skan * 1318334Speter * Redistribution and use in source and binary forms, with or without 14117395Skan * modification, are permitted provided that the following conditions 15117395Skan * are met: 16117395Skan * 1. Redistributions of source code must retain the above copyright 17117395Skan * notice, this list of conditions and the following disclaimer. 1818334Speter * 2. Redistributions in binary form must reproduce the above copyright 19117395Skan * notice, this list of conditions and the following disclaimer in the 20117395Skan * documentation and/or other materials provided with the distribution. 21117395Skan * 3. All advertising materials mentioning features or use of this software 22117395Skan * must display the following acknowledgement: 2318334Speter * This product includes software developed by the University of 2418334Speter * California, Berkeley and its contributors. 2550397Sobrien * 4. Neither the name of the University nor the names of its contributors 26132718Skan * may be used to endorse or promote products derived from this software 27132718Skan * without specific prior written permission. 2818334Speter * 2950397Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 30117395Skan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 3190075Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3218334Speter * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 33117395Skan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34132718Skan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35117395Skan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3618334Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37117395Skan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3818334Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39117395Skan * SUCH DAMAGE. 4018334Speter * 41117395Skan * from: @(#)conf.c 8.1 (Berkeley) 6/4/93 42117395Skan * 43117395Skan * From: Utah Hdr: conf.c 3.1 92/07/06 44117395Skan * Author: Jeff Forys, University of Utah CSS 45117395Skan */ 46117395Skan 4718334Speter#ifndef lint 48117395Skan#if 0 49117395Skanstatic const char sccsid[] = "@(#)conf.c 8.1 (Berkeley) 6/4/93"; 50117395Skan#endif 5118334Speterstatic const char rcsid[] = 52132718Skan "$Id: conf.c,v 1.3 1997/11/24 07:33:40 charnier Exp $"; 53132718Skan#endif /* not lint */ 54132718Skan 55132718Skan#include <sys/param.h> 56132718Skan#include <sys/time.h> 5718334Speter 58117395Skan#include <stdio.h> 59117395Skan#include "defs.h" 60132718Skan#include "pathnames.h" 6118334Speter 62132718Skan/* 63132718Skan** Define (and possibly initialize) global variables here. 64117395Skan** 65117395Skan** Caveat: 66132718Skan** The maximum number of bootable files (`char *BootFiles[]') is 67117395Skan** limited to C_MAXFILE (i.e. the maximum number of files that 6818334Speter** can be spec'd in the configuration file). This was done to 69117395Skan** simplify the boot file search code. 70117395Skan*/ 71117395Skan 72117395Skanchar MyHost[MAXHOSTNAMELEN]; /* host name */ 7318334Speterpid_t MyPid; /* process id */ 7450397Sobrienint DebugFlg = 0; /* set true if debugging */ 75117395Skanint BootAny = 0; /* set true if we boot anyone */ 76117395Skan 7718334Speterchar *ConfigFile = NULL; /* configuration file */ 78117395Skanchar *DfltConfig = _PATH_RBOOTDCONF; /* default configuration file */ 79117395Skanchar *PidFile = _PATH_RBOOTDPID; /* file w/pid of server */ 80117395Skanchar *BootDir = _PATH_RBOOTDLIB; /* directory w/boot files */ 8118334Speterchar *DbgFile = _PATH_RBOOTDDBG; /* debug output file */ 82132718Skan 83132718SkanFILE *DbgFp = NULL; /* debug file pointer */ 84132718Skanchar *IntfName = NULL; /* intf we are attached to */ 85132718Skan 86132718Skanu_int16_t SessionID = 0; /* generated session ID */ 87132718Skan 88132718Skanchar *BootFiles[C_MAXFILE]; /* list of boot files */ 89132718Skan 90132718SkanCLIENT *Clients = NULL; /* list of addrs we'll accept */ 91132718SkanRMPCONN *RmpConns = NULL; /* list of active connections */ 92132718Skan 93132718Skanu_int8_t RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR; /* RMP multicast address */ 94132718Skan