summaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-05 19:27:42 +0000
committerwdenk <wdenk>2003-06-05 19:27:42 +0000
commit73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3 (patch)
treef409359364776e565b9484337a0620388041b456 /include/net.h
parent08eaea9c9fa4e8ea25325610c512cb90b6bea1dd (diff)
downloadu-boot-imx-73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3.zip
u-boot-imx-73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3.tar.gz
u-boot-imx-73a8b27c574f5ec1c8fdd9d8d065bb845d8743d3.tar.bz2
* Add support for RMU board
* Add support for TQM862L at 100/50 MHz * Patch by Pantelis Antoniou, 02 Jun 2003: major reconstruction of networking code; add "ping" support (outgoing only!)
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net.h b/include/net.h
index e4f7cbd..689a90f 100644
--- a/include/net.h
+++ b/include/net.h
@@ -200,7 +200,9 @@ typedef struct
/*
* ICMP stuff (just enough to handle (host) redirect messages)
*/
+#define ICMP_ECHO_REPLY 0 /* Echo reply */
#define ICMP_REDIRECT 5 /* Redirect (change route) */
+#define ICMP_ECHO_REQUEST 8 /* Echo request */
/* Codes for REDIRECT. */
#define ICMP_REDIR_NET 0 /* Redirect Net */
@@ -292,11 +294,15 @@ extern int NetState; /* Network loop state */
extern int NetRestartWrap; /* Tried all network devices */
#endif
-typedef enum { BOOTP, RARP, ARP, TFTP, DHCP } proto_t;
+typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS } proto_t;
/* from net/net.c */
extern char BootFile[128]; /* Boot File name */
+#if (CONFIG_COMMANDS & CFG_CMD_PING)
+extern IPaddr_t NetPingIP; /* the ip address to ping */
+#endif
+
/* Initialize the network adapter */
extern int NetLoop(proto_t);
@@ -323,6 +329,9 @@ extern void NetSetTimeout(int, thand_f *); /* Set timeout handler */
/* Transmit "NetTxPacket" */
extern void NetSendPacket(volatile uchar *, int);
+/* Transmit UDP packet, performing ARP request if needed */
+extern int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len);
+
/* Processes a received packet */
extern void NetReceive(volatile uchar *, int);
@@ -373,6 +382,9 @@ static inline void NetCopyLong(ulong *to, ulong *from)
/* Convert an IP address to a string */
extern void ip_to_string (IPaddr_t x, char *s);
+/* Convert a string to ip address */
+extern IPaddr_t string_to_ip(char *s);
+
/* read an IP address from a environment variable */
extern IPaddr_t getenv_IPaddr (char *);