summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorwdenk <wdenk>2002-07-20 20:14:13 +0000
committerwdenk <wdenk>2002-07-20 20:14:13 +0000
commitefee1709912ad05c3a0bd1ca3f9e72dd7c587cbc (patch)
tree997080941eb5a4b9f260f1d68e647158a589290c /net
parent87e33a6fd7113eee7f4b2d4f1c1776df7536e349 (diff)
downloadu-boot-efee1709912ad05c3a0bd1ca3f9e72dd7c587cbc.tar.gz
u-boot-efee1709912ad05c3a0bd1ca3f9e72dd7c587cbc.tar.bz2
u-boot-efee1709912ad05c3a0bd1ca3f9e72dd7c587cbc.zip
Initial revision
Diffstat (limited to 'net')
-rw-r--r--net/bootp.h95
-rw-r--r--net/rarp.h44
2 files changed, 139 insertions, 0 deletions
diff --git a/net/bootp.h b/net/bootp.h
new file mode 100644
index 0000000000..0b3163901e
--- /dev/null
+++ b/net/bootp.h
@@ -0,0 +1,95 @@
+/*
+ * Copied from LiMon - BOOTP.
+ *
+ * Copyright 1994, 1995, 2000 Neil Russell.
+ * (See License)
+ * Copyright 2000 Paolo Scaffardi
+ */
+
+#ifndef __BOOTP_H__
+#define __BOOTP_H__
+
+#ifndef __NET_H__
+#include <net.h>
+#endif /* __NET_H__ */
+
+/**********************************************************************/
+
+/*
+ * BOOTP header.
+ */
+#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+#define OPT_SIZE 312 /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */
+#else
+#define OPT_SIZE 64
+#endif
+
+typedef struct
+{
+ uchar bp_op; /* Operation */
+# define OP_BOOTREQUEST 1
+# define OP_BOOTREPLY 2
+ uchar bp_htype; /* Hardware type */
+# define HWT_ETHER 1
+ uchar bp_hlen; /* Hardware address length */
+# define HWL_ETHER 6
+ uchar bp_hops; /* Hop count (gateway thing) */
+ ulong bp_id; /* Transaction ID */
+ ushort bp_secs; /* Seconds since boot */
+ ushort bp_spare1; /* Alignment */
+ IPaddr_t bp_ciaddr; /* Client IP address */
+ IPaddr_t bp_yiaddr; /* Your (client) IP address */
+ IPaddr_t bp_siaddr; /* Server IP address */
+ IPaddr_t bp_giaddr; /* Gateway IP address */
+ uchar bp_chaddr[16]; /* Client hardware address */
+ char bp_sname[64]; /* Server host name */
+ char bp_file[128]; /* Boot file name */
+ char bp_vend[OPT_SIZE]; /* Vendor information */
+} Bootp_t;
+
+#define BOOTP_HDR_SIZE sizeof (Bootp_t)
+#define BOOTP_SIZE (ETHER_HDR_SIZE + IP_HDR_SIZE + BOOTP_HDR_SIZE)
+
+/**********************************************************************/
+/*
+ * Global functions and variables.
+ */
+
+/* bootp.c */
+extern ulong BootpID; /* ID of cur BOOTP request */
+extern char BootFile[128]; /* Boot file name */
+extern int BootpTry;
+#ifdef CONFIG_BOOTP_RANDOM_DELAY
+ulong seed1, seed2; /* seed for random BOOTP delay */
+#endif
+
+
+/* Send a BOOTP request */
+extern void BootpRequest (void);
+
+/****************** DHCP Support *********************/
+extern void DhcpRequest(void);
+
+/* DHCP States */
+typedef enum { INIT,
+ INIT_REBOOT,
+ REBOOTING,
+ SELECTING,
+ REQUESTING,
+ REBINDING,
+ BOUND,
+ RENEWING } dhcp_state_t;
+
+#define DHCP_DISCOVER 1
+#define DHCP_OFFER 2
+#define DHCP_REQUEST 3
+#define DHCP_DECLINE 4
+#define DHCP_ACK 5
+#define DHCP_NAK 6
+#define DHCP_RELEASE 7
+
+#define SELECT_TIMEOUT 3 /* Seconds to wait for offers */
+
+/**********************************************************************/
+
+#endif /* __BOOTP_H__ */
diff --git a/net/rarp.h b/net/rarp.h
new file mode 100644
index 0000000000..0c16d46668
--- /dev/null
+++ b/net/rarp.h
@@ -0,0 +1,44 @@
+/*
+ * (C) Copyright 2000
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+
+#ifndef __RARP_H__
+#define __RARP_H__
+
+#ifndef __NET_H__
+#include <net.h>
+#endif /* __NET_H__ */
+
+
+/**********************************************************************/
+/*
+ * Global functions and variables.
+ */
+
+extern int RarpTry;
+
+extern void RarpRequest (void); /* Send a RARP request */
+
+/**********************************************************************/
+
+#endif /* __RARP_H__ */