]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - net/bootp.h
14f5af68e1505cbec02a40915c06f066ba6db74e
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copied from LiMon - BOOTP.
5 * Copyright 1994, 1995, 2000 Neil Russell.
6 * Copyright 2000 Paolo Scaffardi
14 #endif /* __NET_H__ */
16 /**********************************************************************/
18 #define PORT_BOOTPS 67 /* BOOTP server UDP port */
19 #define PORT_BOOTPC 68 /* BOOTP client UDP port */
24 #if defined(CONFIG_CMD_DHCP)
25 /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */
26 #define OPT_FIELD_SIZE 312
28 #define OPT_FIELD_SIZE 64
32 u8 bp_op
; /* Operation */
33 # define OP_BOOTREQUEST 1
34 # define OP_BOOTREPLY 2
35 u8 bp_htype
; /* Hardware type */
37 u8 bp_hlen
; /* Hardware address length */
39 u8 bp_hops
; /* Hop count (gateway thing) */
40 u32 bp_id
; /* Transaction ID */
41 u16 bp_secs
; /* Seconds since boot */
42 u16 bp_spare1
; /* Alignment */
43 struct in_addr bp_ciaddr
; /* Client IP address */
44 struct in_addr bp_yiaddr
; /* Your (client) IP address */
45 struct in_addr bp_siaddr
; /* Server IP address */
46 struct in_addr bp_giaddr
; /* Gateway IP address */
47 u8 bp_chaddr
[16]; /* Client hardware address */
48 char bp_sname
[64]; /* Server host name */
49 char bp_file
[128]; /* Boot file name */
50 char bp_vend
[OPT_FIELD_SIZE
]; /* Vendor information */
51 } __attribute__((packed
));
53 #define BOOTP_HDR_SIZE sizeof(struct bootp_hdr)
55 /**********************************************************************/
57 * Global functions and variables.
61 extern u32 bootp_id
; /* ID of cur BOOTP request */
64 /* Send a BOOTP request */
65 void bootp_reset(void);
66 void bootp_request(void);
68 /****************** DHCP Support *********************/
69 void dhcp_request(void);
79 RENEWING
} dhcp_state_t
;
81 #define DHCP_DISCOVER 1
83 #define DHCP_REQUEST 3
84 #define DHCP_DECLINE 4
87 #define DHCP_RELEASE 7
89 #define DHCP_OPTION_PXE_CONFIG_FILE 209 /* "ConfigFile" option according to rfc5071 */
91 /**********************************************************************/
93 #endif /* __BOOTP_H__ */