1 /* $NetBSD: bootpd.h,v 1.4 1998/01/09 08:09:02 perry Exp $ */
3 /************************************************************************
4 Copyright 1988, 1991 by Carnegie Mellon University
8 Permission to use, copy, modify, and distribute this software and its
9 documentation for any purpose and without fee is hereby granted, provided
10 that the above copyright notice appear in all copies and that both that
11 copyright notice and this permission notice appear in supporting
12 documentation, and that the name of Carnegie Mellon University not be used
13 in advertising or publicity pertaining to distribution of the software
14 without specific, written prior permission.
16 CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
18 IN NO EVENT SHALL CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
19 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
20 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
21 ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23 ************************************************************************/
27 * bootpd.h -- common header file for all the modules of the bootpd program.
42 #define PRIVATE static
46 #define SIGUSR1 30 /* From 4.3 <signal.h> */
49 #define MAXSTRINGLEN 80 /* Max string length */
51 /* Local definitions: */
52 #define MAX_MSG_SIZE (3*512) /* Maximum packet size */
56 * Return pointer to static string which gives full network error message.
58 #define get_network_errmsg get_errmsg
62 * Data structure used to hold an arbitrary-lengthed list of IP addresses.
63 * The list may be shared among multiple hosts by setting the linkcount
68 unsigned int linkcount
, addrcount
;
69 struct in_addr addr
[1]; /* Dynamically extended */
74 * Data structures used to hold shared strings and shared binary data.
75 * The linkcount must be set appropriately.
78 struct shared_string
{
79 unsigned int linkcount
;
80 char string
[1]; /* Dynamically extended */
83 struct shared_bindata
{
84 unsigned int linkcount
, length
;
85 byte data
[1]; /* Dynamically extended */
90 * Flag structure which indicates which symbols have been defined for a
91 * given host. This information is used to determine which data should or
92 * should not be reported in the bootp packet vendor info field.
131 /* XXX - Add new tags here */
138 * The flags structure contains TRUE flags for all the fields which
139 * are considered valid, regardless of whether they were explicitly
140 * specified or indirectly inferred from another entry.
142 * The gateway and the various server fields all point to a shared list of
145 * The hostname, home directory, and bootfile are all shared strings.
147 * The generic data field is a shared binary data structure. It is used to
148 * hold future RFC1048 vendor data until bootpd is updated to understand it.
150 * The vm_cookie field specifies the four-octet vendor magic cookie to use
151 * if it is desired to always send the same response to a given host.
153 * Hopefully, the rest is self-explanatory.
157 unsigned linkcount
; /* hash list inserts */
158 struct flag flags
; /* ALL valid fields */
159 struct in_addr_list
*cookie_server
,
170 struct shared_string
*bootfile
,
180 struct shared_bindata
*generic
;
182 htype
, /* RFC826 says this should be 16-bits but
183 RFC951 only allocates 1 byte. . . */
189 struct in_addr bootserver
,
194 /* XXX - Add new tags here (or above as appropriate) */
200 * Variables shared among modules.
204 extern const char *bootptab
;
205 extern const char *progname
;
207 extern u_char vm_cmu
[4];
208 extern u_char vm_rfc1048
[4];
210 extern hash_tbl
*hwhashtable
;
211 extern hash_tbl
*iphashtable
;
212 extern hash_tbl
*nmhashtable
;