FTPD daemon and example now build without errors

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4371 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-02-05 17:36:13 +00:00
parent c6e75138be
commit 3d42ab8282
19 changed files with 748 additions and 516 deletions
+41 -12
View File
@@ -51,8 +51,36 @@
/* Values for protocol argument to socket() */
#define IPPROTO_TCP 1
#define IPPROTO_UDP 2
#define IPPROTO_IP 0 /* Dummy protocol for TCP */
#define IPPROTO_HOPOPTS 0 /* IPv6 Hop-by-Hop options. */
#define IPPROTO_ICMP 1 /* Internet Control Message Protocol */
#define IPPROTO_IGMP 2 /* Internet Group Management Protocol */
#define IPPROTO_IPIP 4 /* IPIP tunnels (older KA9Q tunnels use 94) */
#define IPPROTO_TCP 6 /* Transmission Control Protocol */
#define IPPROTO_EGP 8 /* Exterior Gateway Protocol */
#define IPPROTO_PUP 12 /* PUP protocol */
#define IPPROTO_UDP 17 /* User Datagram Protocol */
#define IPPROTO_IDP 22 /* XNS IDP protocol */
#define IPPROTO_TP 29 /* SO Transport Protocol Class 4. */
#define IPPROTO_DCCP 33 /* Datagram Congestion Control Protocol */
#define IPPROTO_IPV6 41 /* IPv6-in-IPv4 tunnelling */
#define IPPROTO_ROUTING 43 /* IPv6 routing header. */
#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header. */
#define IPPROTO_RSVP 46 /* Reservation Protocol. */
#define IPPROTO_GRE 47 /* General Routing Encapsulation. */
#define IPPROTO_ESP 50 /* Encapsulation Security Payload protocol */
#define IPPROTO_AH 51 /* Authentication Header protocol */
#define IPPROTO_ICMPV6 58 /* ICMPv6 */
#define IPPROTO_NONE 59 /* IPv6 no next header. */
#define IPPROTO_DSTOPTS 60 /* IPv6 destination options. */
#define IPPROTO_MTP 92 /* Multicast Transport Protocol. */
#define IPPROTO_ENCAP 98 /* Encapsulation Header. */
#define IPPROTO_BEETPH 94 /* IP option pseudo header for BEET */
#define IPPROTO_PIM 103 /* Protocol Independent Multicast */
#define IPPROTO_COMP 108 /* Compression Header protocol */
#define IPPROTO_SCTP 132 /* Stream Control Transport Protocol */
#define IPPROTO_UDPLITE 136 /* UDP-Lite (RFC 3828) */
#define IPPROTO_RAW 255 /* Raw IP packets */
/* Values used with SIOCSIFMCFILTER and SIOCGIFMCFILTER ioctl's */
@@ -88,16 +116,17 @@
/* IPv4 Internet address */
typedef uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr; /* Address (network byte order) */
in_addr_t s_addr; /* Address (network byte order) */
};
struct sockaddr_in
{
sa_family_t sin_family; /* Address family: AF_INET */
uint16_t sin_port; /* Port in network byte order */
struct in_addr sin_addr; /* Internet address */
sa_family_t sin_family; /* Address family: AF_INET */
uint16_t sin_port; /* Port in network byte order */
struct in_addr sin_addr; /* Internet address */
};
/* IPv6 Internet address */
@@ -106,17 +135,17 @@ struct in6_addr
{
union
{
uint8_t u6_addr8[16];
uint16_t u6_addr16[8];
uint32_t u6_addr32[4];
uint8_t u6_addr8[16];
uint16_t u6_addr16[8];
uint32_t u6_addr32[4];
} in6_u;
};
struct sockaddr_in6
{
sa_family_t sin_family; /* Address family: AF_INET */
uint16_t sin_port; /* Port in network byte order */
struct in6_addr sin6_addr; /* IPv6 internet address */
sa_family_t sin_family; /* Address family: AF_INET */
uint16_t sin_port; /* Port in network byte order */
struct in6_addr sin6_addr; /* IPv6 internet address */
};
/****************************************************************************
+2 -2
View File
@@ -197,9 +197,9 @@ struct pthread_mutex_s
typedef struct pthread_mutex_s pthread_mutex_t;
#ifdef CONFIG_MUTEX_TYPES
# define PTHREAD_MUTEX_INITIALIZER {0, {1, 0xffff}, PTHREAD_MUTEX_DEFAULT, 0}
# define PTHREAD_MUTEX_INITIALIZER {0, SEM_INITIALIZER(1), PTHREAD_MUTEX_DEFAULT, 0}
#else
# define PTHREAD_MUTEX_INITIALIZER {0, {1, 0xffff}}
# define PTHREAD_MUTEX_INITIALIZER {0, SEM_INITIALIZER(1)}
#endif
struct pthread_barrierattr_s
+12
View File
@@ -71,7 +71,13 @@ struct semholder_s
void *holder; /* Holder TCB (actual type is _TCB) */
int16_t counts; /* Number of counts owned by this holder */
};
#if CONFIG_SEM_PREALLOCHOLDERS > 0
# define SEMHOLDER_INITIALIZER {NULL, NULL, 0}
#else
# define SEMHOLDER_INITIALIZER {NULL, 0}
#endif
#endif /* CONFIG_PRIORITY_INHERITANCE */
/* This is the generic semaphore structure. */
@@ -85,6 +91,12 @@ struct sem_s
};
typedef struct sem_s sem_t;
#ifdef CONFIG_PRIORITY_INHERITANCE
# define SEM_INITIALIZER(c) {(c), SEMHOLDER_INITIALIZER}
#else
# define SEM_INITIALIZER(c) {(c)}
#endif
/****************************************************************************
* Public Variables
****************************************************************************/
+53 -28
View File
@@ -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
#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 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 */
};
/****************************************************************************