2 * Copied from LiMon - BOOTP.
4 * 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
27 #if defined(CONFIG_BOOTP_VENDOREX)
28 extern u8
*dhcp_vendorex_prep(u8
*e
); /*rtn new e after add own opts. */
29 extern u8
*dhcp_vendorex_proc(u8
*e
); /*rtn next e if mine,else NULL */
32 #define OPT_FIELD_SIZE 64
36 u8 bp_op
; /* Operation */
37 # define OP_BOOTREQUEST 1
38 # define OP_BOOTREPLY 2
39 u8 bp_htype
; /* Hardware type */
41 u8 bp_hlen
; /* Hardware address length */
43 u8 bp_hops
; /* Hop count (gateway thing) */
44 u32 bp_id
; /* Transaction ID */
45 u16 bp_secs
; /* Seconds since boot */
46 u16 bp_spare1
; /* Alignment */
47 struct in_addr bp_ciaddr
; /* Client IP address */
48 struct in_addr bp_yiaddr
; /* Your (client) IP address */
49 struct in_addr bp_siaddr
; /* Server IP address */
50 struct in_addr bp_giaddr
; /* Gateway IP address */
51 u8 bp_chaddr
[16]; /* Client hardware address */
52 char bp_sname
[64]; /* Server host name */
53 char bp_file
[128]; /* Boot file name */
54 char bp_vend
[OPT_FIELD_SIZE
]; /* Vendor information */
55 } __attribute__((packed
));
57 #define BOOTP_HDR_SIZE sizeof(struct bootp_hdr)
59 /**********************************************************************/
61 * Global functions and variables.
65 extern u32 bootp_id
; /* ID of cur BOOTP request */
68 /* Send a BOOTP request */
69 void bootp_reset(void);
70 void bootp_request(void);
72 /****************** DHCP Support *********************/
73 void dhcp_request(void);
83 RENEWING
} dhcp_state_t
;
85 #define DHCP_DISCOVER 1
87 #define DHCP_REQUEST 3
88 #define DHCP_DECLINE 4
91 #define DHCP_RELEASE 7
93 /**********************************************************************/
95 #endif /* __BOOTP_H__ */