Expand PMF_FN_* macros.
[netbsd-mini2440.git] / usr.sbin / bootp / common / bootpd.h
blob274b16396024d61b80fe7c4b47bd84038822ef2e
1 /* $NetBSD: bootpd.h,v 1.4 1998/01/09 08:09:02 perry Exp $ */
3 /************************************************************************
4 Copyright 1988, 1991 by Carnegie Mellon University
6 All Rights Reserved
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
22 SOFTWARE.
23 ************************************************************************/
27 * bootpd.h -- common header file for all the modules of the bootpd program.
30 #include "bptypes.h"
31 #include "hash.h"
32 #include "hwaddr.h"
34 #ifndef TRUE
35 #define TRUE 1
36 #endif
37 #ifndef FALSE
38 #define FALSE 0
39 #endif
41 #ifndef PRIVATE
42 #define PRIVATE static
43 #endif
45 #ifndef SIGUSR1
46 #define SIGUSR1 30 /* From 4.3 <signal.h> */
47 #endif
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
64 * appropriately.
67 struct in_addr_list {
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.
95 struct flag {
96 unsigned bootfile :1,
97 bootserver :1,
98 bootsize :1,
99 bootsize_auto :1,
100 cookie_server :1,
101 domain_server :1,
102 gateway :1,
103 generic :1,
104 haddr :1,
105 homedir :1,
106 htype :1,
107 impress_server :1,
108 iaddr :1,
109 log_server :1,
110 lpr_server :1,
111 name_server :1,
112 name_switch :1,
113 rlp_server :1,
114 send_name :1,
115 subnet_mask :1,
116 tftpdir :1,
117 time_offset :1,
118 time_server :1,
119 dump_file :1,
120 domain_name :1,
121 swap_server :1,
122 root_path :1,
123 exten_file :1,
124 reply_addr :1,
125 nis_domain :1,
126 nis_server :1,
127 ntp_server :1,
128 exec_file :1,
129 msg_size :1,
130 min_wait :1,
131 /* XXX - Add new tags here */
132 vm_cookie :1;
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
143 * IP addresses.
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.
156 struct host {
157 unsigned linkcount; /* hash list inserts */
158 struct flag flags; /* ALL valid fields */
159 struct in_addr_list *cookie_server,
160 *domain_server,
161 *gateway,
162 *impress_server,
163 *log_server,
164 *lpr_server,
165 *name_server,
166 *rlp_server,
167 *time_server,
168 *nis_server,
169 *ntp_server;
170 struct shared_string *bootfile,
171 *hostname,
172 *domain_name,
173 *homedir,
174 *tftpdir,
175 *dump_file,
176 *exten_file,
177 *root_path,
178 *nis_domain,
179 *exec_file;
180 struct shared_bindata *generic;
181 byte vm_cookie[4],
182 htype, /* RFC826 says this should be 16-bits but
183 RFC951 only allocates 1 byte. . . */
184 haddr[MAXHADDRLEN];
185 int32 time_offset;
186 u_int32 bootsize,
187 msg_size,
188 min_wait;
189 struct in_addr bootserver,
190 iaddr,
191 swap_server,
192 reply_addr,
193 subnet_mask;
194 /* XXX - Add new tags here (or above as appropriate) */
200 * Variables shared among modules.
203 extern int debug;
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;