summaryrefslogtreecommitdiff
path: root/nuttx/include/net/uip
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-04 22:59:30 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-11-04 22:59:30 +0000
commit83705d736e7e957752226de8c2165aa9ff4deeaa (patch)
tree35763ac9f5bbba31583e967fb7e199f854b50928 /nuttx/include/net/uip
parentd71296f49b301d3ca8edcc6e9b79dd6b23a01c31 (diff)
downloadpx4-nuttx-83705d736e7e957752226de8c2165aa9ff4deeaa.tar.gz
px4-nuttx-83705d736e7e957752226de8c2165aa9ff4deeaa.tar.bz2
px4-nuttx-83705d736e7e957752226de8c2165aa9ff4deeaa.zip
Integrating with DM320
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@368 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/net/uip')
-rw-r--r--nuttx/include/net/uip/uip-arp.h15
-rw-r--r--nuttx/include/net/uip/uip.h77
2 files changed, 50 insertions, 42 deletions
diff --git a/nuttx/include/net/uip/uip-arp.h b/nuttx/include/net/uip/uip-arp.h
index e7c636357..9ee7f3254 100644
--- a/nuttx/include/net/uip/uip-arp.h
+++ b/nuttx/include/net/uip/uip-arp.h
@@ -35,17 +35,24 @@
#define __UIP_ARP_H__
#include <sys/types.h>
+#include <nuttx/compiler.h>
#include <net/uip/uip.h>
-/* The Ethernet header */
+/* The Ethernet header -- 14 bytes. The first two fields are type 'struct
+ * uip_eth_addr but are represented as a simple byte array here because
+ * some compilers refuse to pack 6 byte structures.
+ */
struct uip_eth_hdr
{
- struct uip_eth_addr dest;
- struct uip_eth_addr src;
- uint16 type;
+
+ uint8 dest[6]; /* Ethernet destination address (6 bytes) */
+ uint8 src[6]; /* Ethernet source address (6 bytes) */
+ uint16 type; /* Type code (2 bytes) */
};
+/* Recognized values of the type bytes in the Ethernet header */
+
#define UIP_ETHTYPE_ARP 0x0806
#define UIP_ETHTYPE_IP 0x0800
#define UIP_ETHTYPE_IP6 0x86dd
diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h
index 9f6a662d4..6853a2714 100644
--- a/nuttx/include/net/uip/uip.h
+++ b/nuttx/include/net/uip/uip.h
@@ -280,7 +280,7 @@ struct uip_tcpip_hdr
{
#ifdef CONFIG_NET_IPv6
- /* IPv6 header. */
+ /* IPv6 Ip header. */
uint8 vtc;
uint8 tcflow;
@@ -292,18 +292,18 @@ struct uip_tcpip_hdr
#else /* CONFIG_NET_IPv6 */
- /* IPv4 header. */
+ /* IPv4 IP header. */
- uint8 vhl;
- uint8 tos;
- uint8 len[2];
- uint8 ipid[2];
- uint8 ipoffset[2];
- uint8 ttl;
- uint8 proto;
- uint16 ipchksum;
- uint16 srcipaddr[2];
- uint16 destipaddr[2];
+ uint8 vhl; /* 8-bit Version (4) and header length (5 or 6) */
+ uint8 tos; /* 8-bit Type of service (e.g., 6=TCP) */
+ uint8 len[2]; /* 16-bit Total length */
+ uint8 ipid[2]; /* 16-bit Identification */
+ uint8 ipoffset[2]; /* 16-bit IP flags + fragment offset */
+ uint8 ttl; /* 8-bit Time to Live */
+ uint8 proto; /* 8-bit Protocol */
+ uint16 ipchksum; /* 16-bit Header checksum */
+ uint16 srcipaddr[2]; /* 32-bit Source IP address */
+ uint16 destipaddr[2]; /* 32-bit Destination IP address */
#endif /* CONFIG_NET_IPv6 */
@@ -327,7 +327,7 @@ struct uip_icmpip_hdr
{
#ifdef CONFIG_NET_IPv6
- /* IPv6 header. */
+ /* IPv6 IP header. */
uint8 vtc;
uint8 tcf;
@@ -340,18 +340,18 @@ struct uip_icmpip_hdr
#else /* CONFIG_NET_IPv6 */
- /* IPv4 header. */
+ /* IPv4 IP header. */
- uint8 vhl;
- uint8 tos;
- uint8 len[2];
- uint8 ipid[2];
- uint8 ipoffset[2];
- uint8 ttl;
- uint8 proto;
- uint16 ipchksum;
- uint16 srcipaddr[2];
- uint16 destipaddr[2];
+ uint8 vhl; /* 8-bit Version (4) and header length (5 or 6) */
+ uint8 tos; /* 8-bit Type of service (e.g., 6=TCP) */
+ uint8 len[2]; /* 16-bit Total length */
+ uint8 ipid[2]; /* 16-bit Identification */
+ uint8 ipoffset[2]; /* 16-bit IP flags + fragment offset */
+ uint8 ttl; /* 8-bit Time to Live */
+ uint8 proto; /* 8-bit Protocol */
+ uint16 ipchksum; /* 16-bit Header checksum */
+ uint16 srcipaddr[2]; /* 32-bit Source IP address */
+ uint16 destipaddr[2]; /* 32-bit Destination IP address */
#endif /* CONFIG_NET_IPv6 */
@@ -384,13 +384,14 @@ struct uip_udpip_hdr
{
#ifdef CONFIG_NET_IPv6
- /* IPv6 header. */
+ /* IPv6 IP header. */
- uint8 vtc;
+ uint8 vtc;
uint8 tcf;
uint16 flow;
- uint8 len[2];
- uint8 proto, ttl;
+ uint8 len[2];
+ uint8 proto;
+ uint8 ttl;
uip_ip6addr_t srcipaddr;
uip_ip6addr_t destipaddr;
@@ -398,16 +399,16 @@ struct uip_udpip_hdr
/* IPv4 header. */
- uint8 vhl;
- uint8 tos;
- uint8 len[2];
- uint8 ipid[2];
- uint8 ipoffset[2];
- uint8 ttl;
- uint8 proto;
- uint16 ipchksum;
- uint16 srcipaddr[2];
- uint16 destipaddr[2];
+ uint8 vhl; /* 8-bit Version (4) and header length (5 or 6) */
+ uint8 tos; /* 8-bit Type of service (e.g., 6=TCP) */
+ uint8 len[2]; /* 16-bit Total length */
+ uint8 ipid[2]; /* 16-bit Identification */
+ uint8 ipoffset[2]; /* 16-bit IP flags + fragment offset */
+ uint8 ttl; /* 8-bit Time to Live */
+ uint8 proto; /* 8-bit Protocol */
+ uint16 ipchksum; /* 16-bit Header checksum */
+ uint16 srcipaddr[2]; /* 32-bit Source IP address */
+ uint16 destipaddr[2]; /* 32-bit Destination IP address */
#endif /* CONFIG_NET_IPv6 */