conf.c revision 27077
11558Srgrimes/* 21558Srgrimes * Copyright (c) 1988, 1992 The University of Utah and the Center 31558Srgrimes * for Software Science (CSS). 41558Srgrimes * Copyright (c) 1992, 1993 51558Srgrimes * The Regents of the University of California. All rights reserved. 61558Srgrimes * 71558Srgrimes * This code is derived from software contributed to Berkeley by 81558Srgrimes * the Center for Software Science of the University of Utah Computer 91558Srgrimes * Science Department. CSS requests users of this software to return 101558Srgrimes * to css-dist@cs.utah.edu any improvements that they make and grant 111558Srgrimes * CSS redistribution rights. 121558Srgrimes * 131558Srgrimes * Redistribution and use in source and binary forms, with or without 141558Srgrimes * modification, are permitted provided that the following conditions 151558Srgrimes * are met: 161558Srgrimes * 1. Redistributions of source code must retain the above copyright 171558Srgrimes * notice, this list of conditions and the following disclaimer. 181558Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 191558Srgrimes * notice, this list of conditions and the following disclaimer in the 201558Srgrimes * documentation and/or other materials provided with the distribution. 211558Srgrimes * 3. All advertising materials mentioning features or use of this software 221558Srgrimes * must display the following acknowledgement: 231558Srgrimes * This product includes software developed by the University of 241558Srgrimes * California, Berkeley and its contributors. 251558Srgrimes * 4. Neither the name of the University nor the names of its contributors 261558Srgrimes * may be used to endorse or promote products derived from this software 271558Srgrimes * without specific prior written permission. 281558Srgrimes * 291558Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 301558Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 311558Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 3250476Speter * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 331558Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34232977Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 351558Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3679530Sru * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 371558Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 381558Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 391558Srgrimes * SUCH DAMAGE. 401558Srgrimes * 4168960Sru * from: @(#)conf.c 8.1 (Berkeley) 6/4/93 4268960Sru * $Id$ 4347998Sru * 4447998Sru * From: Utah Hdr: conf.c 3.1 92/07/06 4547998Sru * Author: Jeff Forys, University of Utah CSS 4647998Sru */ 471558Srgrimes 481558Srgrimes#ifndef lint 4937417Scharnierstatic const char sccsid[] = "@(#)conf.c 8.1 (Berkeley) 6/4/93"; 5099501Scharnier#endif /* not lint */ 511558Srgrimes 521558Srgrimes#include <sys/param.h> 5347998Sru#include <sys/time.h> 541558Srgrimes 551558Srgrimes#include <stdio.h> 5637417Scharnier#include "defs.h" 5747998Sru#include "pathnames.h" 581558Srgrimes 591558Srgrimes/* 6037417Scharnier** Define (and possibly initialize) global variables here. 6199501Scharnier** 621558Srgrimes** Caveat: 631558Srgrimes** The maximum number of bootable files (`char *BootFiles[]') is 6447998Sru** limited to C_MAXFILE (i.e. the maximum number of files that 651558Srgrimes** can be spec'd in the configuration file). This was done to 661558Srgrimes** simplify the boot file search code. 671558Srgrimes*/ 681558Srgrimes 691558Srgrimeschar MyHost[MAXHOSTNAMELEN+1]; /* host name */ 7037417Scharnierpid_t MyPid; /* process id */ 711558Srgrimesint DebugFlg = 0; /* set true if debugging */ 721558Srgrimesint BootAny = 0; /* set true if we boot anyone */ 731558Srgrimes 741558Srgrimeschar *ConfigFile = NULL; /* configuration file */ 751558Srgrimeschar *DfltConfig = _PATH_RBOOTDCONF; /* default configuration file */ 7637417Scharnierchar *PidFile = _PATH_RBOOTDPID; /* file w/pid of server */ 771558Srgrimeschar *BootDir = _PATH_RBOOTDLIB; /* directory w/boot files */ 781558Srgrimeschar *DbgFile = _PATH_RBOOTDDBG; /* debug output file */ 7947998Sru 8047998SruFILE *DbgFp = NULL; /* debug file pointer */ 811558Srgrimeschar *IntfName = NULL; /* intf we are attached to */ 8237417Scharnier 8347998Sruu_int16_t SessionID = 0; /* generated session ID */ 841558Srgrimes 8579754Sddchar *BootFiles[C_MAXFILE]; /* list of boot files */ 8637417Scharnier 8747998SruCLIENT *Clients = NULL; /* list of addrs we'll accept */ 8847998SruRMPCONN *RmpConns = NULL; /* list of active connections */ 891558Srgrimes 90149766Sgarysu_int8_t RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR; /* RMP multicast address */ 91149766Sgarys