Watt-32 tcp/ip  2.2 dev-rel.10
pcbootp.h
Go to the documentation of this file.
1 
7 #ifndef _w32_PCBOOTP_H
8 #define _w32_PCBOOTP_H
9 
10 extern DWORD _bootp_host;
11 extern int _bootp_timeout;
12 
13 extern int BOOTP_do_boot (void);
14 
15 #define BOOTP_REQUEST 1
16 #define BOOTP_REPLY 2
17 
18 /*
19  * BOOTP options and values.
20  */
21 enum BOOTP_Options {
22  BOOTP_OPT_PAD = 0,
23  BOOTP_OPT_SUBNET_MASK = 1,
24  BOOTP_OPT_TIME_OFFSET = 2,
25  BOOTP_OPT_ROUTERS_ON_SNET = 3,
26  BOOTP_OPT_TIME_SRV = 4,
27  BOOTP_OPT_NAME_SRV = 5,
28  BOOTP_OPT_DNS_SRV = 6,
29  BOOTP_OPT_LOG_SRV = 7,
30  BOOTP_OPT_COOKIE_SRV = 8,
31  BOOTP_OPT_LPR_SRV = 9,
32  BOOTP_OPT_IMPRESS_SRV = 10,
33  BOOTP_OPT_RES_LOCATION_SRV = 11,
34  BOOTP_OPT_HOST_NAME = 12,
35  BOOTP_OPT_BOOT_FSIZE = 13,
36  BOOTP_OPT_DOMAIN_NAME = 15,
37  BOOTP_OPT_NON_LOCAL_SRC_ROUTE = 20,
38  BOOTP_OPT_POLICY_FILTER = 21,
39  BOOTP_OPT_MAX_DGRAM_REASM_SIZE = 22,
40  BOOTP_OPT_IP_DEFAULT_TTL = 23,
41  BOOTP_OPT_PATH_MTU_AGING_TIMEOUT = 24,
42  BOOTP_OPT_PATH_MTU_PLATEAU_TABLE = 25,
43  BOOTP_OPT_IF_MTU = 26,
44  BOOTP_OPT_ALL_SUBNETS_LOCAL = 27,
45  BOOTP_OPT_BROADCAST_ADDR = 28,
46  BOOTP_OPT_PERFORM_MASK_DISCOVERY = 29,
47  BOOTP_OPT_MASK_SUPPLIER = 30,
48  BOOTP_OPT_PERFORM_ROUTER_DISCOVERY = 31,
49  BOOTP_OPT_ROUTER_SOLICITATION_ADDR = 32,
50  BOOTP_OPT_STATIC_ROUTE = 33,
51  BOOTP_OPT_TRAILER_ENCAPSULATION = 34,
52  BOOTP_OPT_ARP_CACHE_TIMEOUT = 35,
53  BOOTP_OPT_ETHERNET_ENCAPSULATION = 36,
54  BOOTP_OPT_END = 255,
55  };
56 
57 #include <sys/pack_on.h>
58 
63 struct bootp {
64  BYTE bp_op; /* packet op code / message type. */
65  BYTE bp_htype; /* hardware address type, 1 = 10 mb ethernet */
66  BYTE bp_hlen; /* hardware address len, eg '6' for 10mb eth */
67  BYTE bp_hops; /* client sets to zero, optionally used by */
68  /* gateways in cross-gateway booting. */
69  DWORD bp_xid; /* transaction ID, a random number */
70  WORD bp_secs; /* filled in by client, seconds elapsed */
71  /* since client started trying to boot. */
72  WORD bp_spare;
73  DWORD bp_ciaddr; /* client IP address filled by client if known */
74  DWORD bp_yiaddr; /* 'your' (client) IP address */
75  /* filled by server if client doesn't know */
76  DWORD bp_siaddr; /* server IP address returned in bootreply */
77  DWORD bp_giaddr; /* gateway IP address, */
78  /* used in optional cross-gateway booting. */
79  BYTE bp_chaddr[16]; /* client hardware address, filled by client */
80  BYTE bp_sname[64]; /* optional server host name, null terminated*/
81 
82  BYTE bp_file[128]; /* boot file name, null terminated string */
83  /* 'generic' name or null in bootrequest, */
84  /* fully qualified directory-path */
85  /* name in bootreply. */
86  BYTE bp_vend[64]; /* optional vendor-specific area */
87  };
88 
89 #define BOOTP_MIN_SIZE 44
90 
91 /*
92  * UDP port numbers, server and client.
93  */
94 #define IPPORT_BOOTPS 67
95 #define IPPORT_BOOTPC 68
96 
97 
98 /******** the following is stolen from NCSA which came from CUTCP *********/
99 /* I have not implemented these, but someone may wish to in the future so */
100 /* I kept them around. */
101 /**************************************************************************/
102 
107 struct bootp_vend {
108  BYTE v_magic[4]; /* magic number */
109  DWORD v_flags; /* flags/opcodes, etc. */
110  BYTE v_unused[56]; /* currently unused */
111  };
112 
113 #include <sys/pack_off.h>
114 
115 
116 #define VM_STANFORD 0x5354414EUL /* v_magic for Stanford ("STAN") */
117 #define VM_RFC1048 0x63825363UL /* v_magic for RFC client/servers */
118 
119 /*
120  * 'v_flags' values.
121  */
122 #define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
123 #define VF_HELP 2 /* help me, I'm not registered */
124 #define TAG_BOOTFILE_SIZE 13 /* tag used by bootp_vend fields, RFC 1048 */
125 
126 #endif
Definition: pcbootp.h:63
int BOOTP_do_boot(void)
Main BOOTP initialisation.
Definition: pcbootp.c:60