Home | History | Annotate | Line # | Download | only in libsa
bootp.h revision 1.3
      1  1.3     cgd /*	$NetBSD: bootp.h,v 1.3 1996/09/26 23:22:01 cgd Exp $	*/
      2  1.2     cgd 
      3  1.1  brezak /*
      4  1.1  brezak  * Bootstrap Protocol (BOOTP).  RFC951 and RFC1048.
      5  1.1  brezak  *
      6  1.1  brezak  * This file specifies the "implementation-independent" BOOTP protocol
      7  1.1  brezak  * information which is common to both client and server.
      8  1.1  brezak  *
      9  1.1  brezak  * Copyright 1988 by Carnegie Mellon.
     10  1.1  brezak  *
     11  1.1  brezak  * Permission to use, copy, modify, and distribute this program for any
     12  1.1  brezak  * purpose and without fee is hereby granted, provided that this copyright
     13  1.1  brezak  * and permission notice appear on all copies and supporting documentation,
     14  1.1  brezak  * the name of Carnegie Mellon not be used in advertising or publicity
     15  1.1  brezak  * pertaining to distribution of the program without specific prior
     16  1.1  brezak  * permission, and notice be given in supporting documentation that copying
     17  1.1  brezak  * and distribution is by permission of Carnegie Mellon and Stanford
     18  1.1  brezak  * University.  Carnegie Mellon makes no representations about the
     19  1.1  brezak  * suitability of this software for any purpose.  It is provided "as is"
     20  1.1  brezak  * without express or implied warranty.
     21  1.1  brezak  */
     22  1.1  brezak 
     23  1.1  brezak 
     24  1.1  brezak struct bootp {
     25  1.1  brezak 	unsigned char	bp_op;		/* packet opcode type */
     26  1.1  brezak 	unsigned char	bp_htype;	/* hardware addr type */
     27  1.1  brezak 	unsigned char	bp_hlen;	/* hardware addr length */
     28  1.1  brezak 	unsigned char	bp_hops;	/* gateway hops */
     29  1.3     cgd 	unsigned int	bp_xid;		/* transaction ID */
     30  1.1  brezak 	unsigned short	bp_secs;	/* seconds since boot began */
     31  1.1  brezak 	unsigned short	bp_unused;
     32  1.1  brezak 	struct in_addr	bp_ciaddr;	/* client IP address */
     33  1.1  brezak 	struct in_addr	bp_yiaddr;	/* 'your' IP address */
     34  1.1  brezak 	struct in_addr	bp_siaddr;	/* server IP address */
     35  1.1  brezak 	struct in_addr	bp_giaddr;	/* gateway IP address */
     36  1.1  brezak 	unsigned char	bp_chaddr[16];	/* client hardware address */
     37  1.1  brezak 	unsigned char	bp_sname[64];	/* server host name */
     38  1.1  brezak 	unsigned char	bp_file[128];	/* boot file name */
     39  1.1  brezak 	unsigned char	bp_vend[64];	/* vendor-specific area */
     40  1.1  brezak };
     41  1.1  brezak 
     42  1.1  brezak /*
     43  1.1  brezak  * UDP port numbers, server and client.
     44  1.1  brezak  */
     45  1.1  brezak #define	IPPORT_BOOTPS		67
     46  1.1  brezak #define	IPPORT_BOOTPC		68
     47  1.1  brezak 
     48  1.1  brezak #define BOOTREPLY		2
     49  1.1  brezak #define BOOTREQUEST		1
     50  1.1  brezak 
     51  1.1  brezak 
     52  1.1  brezak /*
     53  1.1  brezak  * Vendor magic cookie (v_magic) for CMU
     54  1.1  brezak  */
     55  1.1  brezak #define VM_CMU		"CMU"
     56  1.1  brezak 
     57  1.1  brezak /*
     58  1.1  brezak  * Vendor magic cookie (v_magic) for RFC1048
     59  1.1  brezak  */
     60  1.1  brezak #define VM_RFC1048	{ 99, 130, 83, 99 }
     61  1.1  brezak 
     62  1.1  brezak 
     63  1.1  brezak 
     65  1.1  brezak /*
     66  1.1  brezak  * RFC1048 tag values used to specify what information is being supplied in
     67  1.1  brezak  * the vendor field of the packet.
     68  1.1  brezak  */
     69  1.1  brezak 
     70  1.1  brezak #define TAG_PAD			((unsigned char)   0)
     71  1.1  brezak #define TAG_SUBNET_MASK		((unsigned char)   1)
     72  1.1  brezak #define TAG_TIME_OFFSET		((unsigned char)   2)
     73  1.1  brezak #define TAG_GATEWAY		((unsigned char)   3)
     74  1.1  brezak #define TAG_TIME_SERVER		((unsigned char)   4)
     75  1.1  brezak #define TAG_NAME_SERVER		((unsigned char)   5)
     76  1.1  brezak #define TAG_DOMAIN_SERVER	((unsigned char)   6)
     77  1.1  brezak #define TAG_LOG_SERVER		((unsigned char)   7)
     78  1.1  brezak #define TAG_COOKIE_SERVER	((unsigned char)   8)
     79  1.1  brezak #define TAG_LPR_SERVER		((unsigned char)   9)
     80  1.1  brezak #define TAG_IMPRESS_SERVER	((unsigned char)  10)
     81  1.1  brezak #define TAG_RLP_SERVER		((unsigned char)  11)
     82  1.1  brezak #define TAG_HOSTNAME		((unsigned char)  12)
     83  1.1  brezak #define TAG_BOOTSIZE		((unsigned char)  13)
     84  1.1  brezak #define TAG_DUMPFILE		((unsigned char)  14)
     85  1.1  brezak #define TAG_DOMAINNAME		((unsigned char)  15)
     86  1.1  brezak #define TAG_SWAPSERVER		((unsigned char)  16)
     87  1.1  brezak #define TAG_ROOTPATH		((unsigned char)  17)
     88  1.1  brezak #define TAG_END			((unsigned char) 255)
     89  1.1  brezak 
     90  1.1  brezak 
     91  1.1  brezak 
     92  1.1  brezak /*
     93  1.1  brezak  * "vendor" data permitted for CMU bootp clients.
     94  1.1  brezak  */
     95  1.1  brezak 
     96  1.1  brezak struct cmu_vend {
     97  1.3     cgd 	unsigned char	v_magic[4];	/* magic number */
     98  1.1  brezak 	unsigned int	v_flags;	/* flags/opcodes, etc. */
     99  1.1  brezak 	struct in_addr	v_smask;	/* Subnet mask */
    100  1.1  brezak 	struct in_addr	v_dgate;	/* Default gateway */
    101  1.1  brezak 	struct in_addr	v_dns1, v_dns2; /* Domain name servers */
    102  1.1  brezak 	struct in_addr	v_ins1, v_ins2; /* IEN-116 name servers */
    103  1.1  brezak 	struct in_addr	v_ts1, v_ts2;	/* Time servers */
    104  1.1  brezak 	unsigned char	v_unused[25];	/* currently unused */
    105  1.1  brezak };
    106  1.1  brezak 
    107  1.1  brezak 
    108  1.1  brezak /* v_flags values */
    109              #define VF_SMASK	1	/* Subnet mask field contains valid data */
    110