summaryrefslogtreecommitdiff
path: root/nuttx/include/sys
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-05 17:36:13 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-05 17:36:13 +0000
commitd8a039ee18825d1f29e0c020ae6569453fb7bb4f (patch)
treef5b452486749985de7826e7deb82d4752deabe58 /nuttx/include/sys
parentefb4bf7dca5d637268c6d70eec2880352047e34c (diff)
downloadpx4-nuttx-d8a039ee18825d1f29e0c020ae6569453fb7bb4f.tar.gz
px4-nuttx-d8a039ee18825d1f29e0c020ae6569453fb7bb4f.tar.bz2
px4-nuttx-d8a039ee18825d1f29e0c020ae6569453fb7bb4f.zip
FTPD daemon and example now build without errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4371 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/sys')
-rw-r--r--nuttx/include/sys/socket.h83
1 files changed, 54 insertions, 29 deletions
diff --git a/nuttx/include/sys/socket.h b/nuttx/include/sys/socket.h
index 7613d00cd..83699bfbd 100644
--- a/nuttx/include/sys/socket.h
+++ b/nuttx/include/sys/socket.h
@@ -52,35 +52,35 @@
/* Protocol families */
-#define PF_UNSPEC 0 /* Protocol family unspecified */
-#define PF_UNIX 1 /* Local communication */
-#define PF_LOCAL 1 /* Local communication */
-#define PF_INET 2 /* IPv4 Internet protocols */
-#define PF_INET6 3 /* IPv6 Internet protocols */
-#define PF_IPX 4 /* IPX - Novell protocols */
-#define PF_NETLINK 5 /* Kernel user interface device */
-#define PF_X25 6 /* ITU-T X.25 / ISO-8208 protocol */
-#define PF_AX25 7 /* Amateur radio AX.25 protocol */
-#define PF_ATMPVC 8 /* Access to raw ATM PVCs */
-#define PF_APPLETALK 9 /* Appletalk */
-#define PF_PACKET 10 /* Low level packet interface */
+#define PF_UNSPEC 0 /* Protocol family unspecified */
+#define PF_UNIX 1 /* Local communication */
+#define PF_LOCAL 1 /* Local communication */
+#define PF_INET 2 /* IPv4 Internet protocols */
+#define PF_INET6 3 /* IPv6 Internet protocols */
+#define PF_IPX 4 /* IPX - Novell protocols */
+#define PF_NETLINK 5 /* Kernel user interface device */
+#define PF_X25 6 /* ITU-T X.25 / ISO-8208 protocol */
+#define PF_AX25 7 /* Amateur radio AX.25 protocol */
+#define PF_ATMPVC 8 /* Access to raw ATM PVCs */
+#define PF_APPLETALK 9 /* Appletalk */
+#define PF_PACKET 10 /* Low level packet interface */
/* Address families */
-#define AF_UNSPEC PF_UNSPEC
-#define AF_UNIX PF_UNIX
-#define AF_LOCAL PF_LOCAL
-#define AF_INET PF_INET
-#define AF_INET6 PF_INET6
-#define AF_IPX PF_IPX
-#define AF_NETLINK PF_NETLINK
-#define AF_X25 PF_X25
-#define AF_AX25 PF_AX25
-#define AF_ATMPVC PF_ATMPVC
-#define AF_APPLETALK PF_APPLETALK
-#define AF_PACKET PF_PACKET
-
-/*The socket created by socket() has the indicated type, which specifies
+#define AF_UNSPEC PF_UNSPEC
+#define AF_UNIX PF_UNIX
+#define AF_LOCAL PF_LOCAL
+#define AF_INET PF_INET
+#define AF_INET6 PF_INET6
+#define AF_IPX PF_IPX
+#define AF_NETLINK PF_NETLINK
+#define AF_X25 PF_X25
+#define AF_AX25 PF_AX25
+#define AF_ATMPVC PF_ATMPVC
+#define AF_APPLETALK PF_APPLETALK
+#define AF_PACKET PF_PACKET
+
+/* The socket created by socket() has the indicated type, which specifies
* the communication semantics.
*/
@@ -95,7 +95,6 @@
#define SOCK_RDM 4 /* Provides a reliable datagram layer that does not guarantee ordering. */
#define SOCK_PACKET 5 /* Obsolete and should not be used in new programs */
-
/* Bits in the FLAGS argument to `send', `recv', et al. These are the bits
* recognized by Linus, not all are supported by NuttX.
*/
@@ -160,10 +159,36 @@
* Type Definitions
****************************************************************************/
+ /* sockaddr_storage structure. This structure must be (1) large enough to
+ * accommodate all supported protocol-specific address structures, and (2)
+ * aligned at an appropriate boundary so that pointers to it can be cast
+ * as pointers to protocol-specific address structures and used to access
+ * the fields of those structures without alignment problems
+ */
+
+#ifdef CONFIG_NET_IPv6
+struct sockaddr_storage
+{
+ sa_family_t ss_family; /* Address family */
+ char ss_data[18]; /* 18-bytes of address data */
+};
+#else
+struct sockaddr_storage
+{
+ sa_family_t ss_family; /* Address family */
+ char ss_data[14]; /* 14-bytes of address data */
+};
+#endif
+
+/* The sockaddr structure is used to define a socket address which is used
+ * in the bind(), connect(), getpeername(), getsockname(), recvfrom(), and
+ * sendto() functions.
+ */
+
struct sockaddr
{
- sa_family_t sa_family;
- char sa_data[14];
+ sa_family_t sa_family; /* Address family: See AF_* definitions */
+ char sa_data[14]; /* 14-bytes of address data */
};
/****************************************************************************