/************************************************************************1Copyright 1988, 1991 by Carnegie Mellon University23All Rights Reserved45Permission to use, copy, modify, and distribute this software and its6documentation for any purpose and without fee is hereby granted, provided7that the above copyright notice appear in all copies and that both that8copyright notice and this permission notice appear in supporting9documentation, and that the name of Carnegie Mellon University not be used10in advertising or publicity pertaining to distribution of the software11without specific, written prior permission.1213CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS14SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.15IN NO EVENT SHALL CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL16DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR17PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS18ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS19SOFTWARE.20************************************************************************/212223/*24* bootpd.h -- common header file for all the modules of the bootpd program.25*/2627#include "bptypes.h"28#include "hash.h"29#include "hwaddr.h"3031#ifndef TRUE32#define TRUE 133#endif34#ifndef FALSE35#define FALSE 036#endif3738#ifndef PRIVATE39#define PRIVATE static40#endif4142#ifndef SIGUSR143#define SIGUSR1 30 /* From 4.3 <signal.h> */44#endif4546#define MAXSTRINGLEN 80 /* Max string length */4748/* Local definitions: */49#define MAX_MSG_SIZE (3*512) /* Maximum packet size */505152/*53* Return pointer to static string which gives full network error message.54*/55#define get_network_errmsg get_errmsg565758/*59* Data structure used to hold an arbitrary-lengthed list of IP addresses.60* The list may be shared among multiple hosts by setting the linkcount61* appropriately.62*/6364struct in_addr_list {65unsigned int linkcount, addrcount;66struct in_addr addr[1]; /* Dynamically extended */67};686970/*71* Data structures used to hold shared strings and shared binary data.72* The linkcount must be set appropriately.73*/7475struct shared_string {76unsigned int linkcount;77char string[1]; /* Dynamically extended */78};7980struct shared_bindata {81unsigned int linkcount, length;82byte data[1]; /* Dynamically extended */83};848586/*87* Flag structure which indicates which symbols have been defined for a88* given host. This information is used to determine which data should or89* should not be reported in the bootp packet vendor info field.90*/9192struct flag {93unsigned bootfile :1,94bootserver :1,95bootsize :1,96bootsize_auto :1,97cookie_server :1,98domain_server :1,99gateway :1,100generic :1,101haddr :1,102homedir :1,103htype :1,104impress_server :1,105iaddr :1,106log_server :1,107lpr_server :1,108name_server :1,109name_switch :1,110rlp_server :1,111send_name :1,112subnet_mask :1,113tftpdir :1,114time_offset :1,115time_server :1,116dump_file :1,117domain_name :1,118swap_server :1,119root_path :1,120exten_file :1,121reply_addr :1,122nis_domain :1,123nis_server :1,124ntp_server :1,125exec_file :1,126msg_size :1,127min_wait :1,128/* XXX - Add new tags here */129vm_cookie :1;130};131132133134/*135* The flags structure contains TRUE flags for all the fields which136* are considered valid, regardless of whether they were explicitly137* specified or indirectly inferred from another entry.138*139* The gateway and the various server fields all point to a shared list of140* IP addresses.141*142* The hostname, home directory, and bootfile are all shared strings.143*144* The generic data field is a shared binary data structure. It is used to145* hold future RFC1048 vendor data until bootpd is updated to understand it.146*147* The vm_cookie field specifies the four-octet vendor magic cookie to use148* if it is desired to always send the same response to a given host.149*150* Hopefully, the rest is self-explanatory.151*/152153struct host {154unsigned linkcount; /* hash list inserts */155struct flag flags; /* ALL valid fields */156struct in_addr_list *cookie_server,157*domain_server,158*gateway,159*impress_server,160*log_server,161*lpr_server,162*name_server,163*rlp_server,164*time_server,165*nis_server,166*ntp_server;167struct shared_string *bootfile,168*hostname,169*domain_name,170*homedir,171*tftpdir,172*dump_file,173*exten_file,174*root_path,175*nis_domain,176*exec_file;177struct shared_bindata *generic;178byte vm_cookie[4],179htype, /* RFC826 says this should be 16-bits but180RFC951 only allocates 1 byte. . . */181haddr[MAXHADDRLEN];182int32 time_offset;183u_int32 bootsize,184msg_size,185min_wait;186struct in_addr bootserver,187iaddr,188swap_server,189reply_addr,190subnet_mask;191/* XXX - Add new tags here (or above as appropriate) */192};193194195196/*197* Variables shared among modules.198*/199200extern int debug;201extern char *bootptab;202extern char *progname;203204extern u_char vm_cmu[4];205extern u_char vm_rfc1048[4];206207extern hash_tbl *hwhashtable;208extern hash_tbl *iphashtable;209extern hash_tbl *nmhashtable;210211212213