]> git.saurik.com Git - apple/network_cmds.git/blob - rbootd.tproj/conf.c
network_cmds-85.tar.gz
[apple/network_cmds.git] / rbootd.tproj / conf.c
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License."
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24 /*
25 * Copyright (c) 1988, 1992 The University of Utah and the Center
26 * for Software Science (CSS).
27 * Copyright (c) 1992, 1993
28 * The Regents of the University of California. All rights reserved.
29 *
30 * This code is derived from software contributed to Berkeley by
31 * the Center for Software Science of the University of Utah Computer
32 * Science Department. CSS requests users of this software to return
33 * to css-dist@cs.utah.edu any improvements that they make and grant
34 * CSS redistribution rights.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. All advertising materials mentioning features or use of this software
45 * must display the following acknowledgement:
46 * This product includes software developed by the University of
47 * California, Berkeley and its contributors.
48 * 4. Neither the name of the University nor the names of its contributors
49 * may be used to endorse or promote products derived from this software
50 * without specific prior written permission.
51 *
52 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 * SUCH DAMAGE.
63 *
64 * @(#)conf.c 8.1 (Berkeley) 6/4/93
65 *
66 * Utah $Hdr: conf.c 3.1 92/07/06$
67 * Author: Jeff Forys, University of Utah CSS
68 */
69
70 #ifndef lint
71 static char sccsid[] = "@(#)conf.c 8.1 (Berkeley) 6/4/93";
72 #endif /* not lint */
73
74 #include <sys/param.h>
75 #include <sys/time.h>
76
77 #include <stdio.h>
78 #include "defs.h"
79 #include "pathnames.h"
80
81 /*
82 ** Define (and possibly initialize) global variables here.
83 **
84 ** Caveat:
85 ** The maximum number of bootable files (`char *BootFiles[]') is
86 ** limited to C_MAXFILE (i.e. the maximum number of files that
87 ** can be spec'd in the configuration file). This was done to
88 ** simplify the boot file search code.
89 */
90
91 char *ProgName; /* path-stripped argv[0] */
92 char MyHost[MAXHOSTNAMELEN+1]; /* host name */
93 int MyPid; /* process id */
94 int DebugFlg = 0; /* set true if debugging */
95 int BootAny = 0; /* set true if we boot anyone */
96
97 char *ConfigFile = NULL; /* configuration file */
98 char *DfltConfig = _PATH_RBOOTDCONF; /* default configuration file */
99 char *PidFile = _PATH_RBOOTDPID; /* file w/pid of server */
100 char *BootDir = _PATH_RBOOTDLIB; /* directory w/boot files */
101 char *DbgFile = _PATH_RBOOTDDBG; /* debug output file */
102
103 FILE *DbgFp = NULL; /* debug file pointer */
104 char *IntfName = NULL; /* intf we are attached to */
105
106 u_short SessionID = 0; /* generated session ID */
107
108 char *BootFiles[C_MAXFILE]; /* list of boot files */
109
110 CLIENT *Clients = NULL; /* list of addrs we'll accept */
111 RMPCONN *RmpConns = NULL; /* list of active connections */
112
113 char RmpMcastAddr[RMP_ADDRLEN] = RMP_ADDR; /* RMP multicast address */