diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-14 23:32:23 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-14 23:32:23 +0000 |
commit | d7d4a0d765d12cc152c62a37b490702c39d76447 (patch) | |
tree | d3969c50e49cd742124e05349431556344a93f54 /nuttx/include/net | |
parent | 313eb5bb780f9e9baa353651996b51ce33a85fca (diff) | |
download | px4-nuttx-d7d4a0d765d12cc152c62a37b490702c39d76447.tar.gz px4-nuttx-d7d4a0d765d12cc152c62a37b490702c39d76447.tar.bz2 px4-nuttx-d7d4a0d765d12cc152c62a37b490702c39d76447.zip |
Switching to C99 stdint.h types
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2340 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/net')
-rw-r--r-- | nuttx/include/net/ethernet.h | 12 | ||||
-rw-r--r-- | nuttx/include/net/uip/dhcpc.h | 6 | ||||
-rw-r--r-- | nuttx/include/net/uip/dhcpd.h | 4 | ||||
-rw-r--r-- | nuttx/include/net/uip/httpd.h | 4 | ||||
-rw-r--r-- | nuttx/include/net/uip/resolv.h | 1 | ||||
-rw-r--r-- | nuttx/include/net/uip/smtp.h | 2 | ||||
-rw-r--r-- | nuttx/include/net/uip/tftp.h | 10 | ||||
-rw-r--r-- | nuttx/include/net/uip/thttpd.h | 4 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-arch.h | 33 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-arp.h | 17 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-icmp.h | 61 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-lib.h | 16 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-tcp.h | 99 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip-udp.h | 63 | ||||
-rw-r--r-- | nuttx/include/net/uip/uip.h | 13 | ||||
-rw-r--r-- | nuttx/include/net/uip/webclient.h | 2 |
16 files changed, 174 insertions, 173 deletions
diff --git a/nuttx/include/net/ethernet.h b/nuttx/include/net/ethernet.h index 92a810c90..f93e86c1e 100644 --- a/nuttx/include/net/ethernet.h +++ b/nuttx/include/net/ethernet.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/net/ethernet.h * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <stdint.h> /**************************************************************************** * Pre-Processor Definitions @@ -54,14 +54,14 @@ struct ether_addr { - uint8 ether_addr_octet[6]; /* 48-bit Ethernet address */ + uint8_t ether_addr_octet[6]; /* 48-bit Ethernet address */ }; struct ether_header { - uint8 ether_dhost[ETHER_ADDR_LEN]; /* Destination Ethernet address */ - uint8 ether_shost[ETHER_ADDR_LEN]; /* Source Ethernet address */ - uint16 ether_type; /* Ethernet packet type*/ + uint8_t ether_dhost[ETHER_ADDR_LEN]; /* Destination Ethernet address */ + uint8_t ether_shost[ETHER_ADDR_LEN]; /* Source Ethernet address */ + uint16_t ether_type; /* Ethernet packet type*/ }; /**************************************************************************** diff --git a/nuttx/include/net/uip/dhcpc.h b/nuttx/include/net/uip/dhcpc.h index abfd71e77..8535c1b57 100644 --- a/nuttx/include/net/uip/dhcpc.h +++ b/nuttx/include/net/uip/dhcpc.h @@ -42,10 +42,10 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <stdint.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -54,7 +54,7 @@ struct dhcpc_state { - uint16 lease_time[2]; + uint16_t lease_time[2]; struct in_addr serverid; struct in_addr ipaddr; struct in_addr netmask; diff --git a/nuttx/include/net/uip/dhcpd.h b/nuttx/include/net/uip/dhcpd.h index 2bcc82abe..f9aea86f3 100644 --- a/nuttx/include/net/uip/dhcpd.h +++ b/nuttx/include/net/uip/dhcpd.h @@ -42,10 +42,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> - /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** diff --git a/nuttx/include/net/uip/httpd.h b/nuttx/include/net/uip/httpd.h index 44d4d8f4a..cd850e51d 100644 --- a/nuttx/include/net/uip/httpd.h +++ b/nuttx/include/net/uip/httpd.h @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/httpd.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Based on uIP which also has a BSD style license: @@ -44,8 +44,6 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/nuttx/include/net/uip/resolv.h b/nuttx/include/net/uip/resolv.h index 9d9f57f55..8b9f3bace 100644 --- a/nuttx/include/net/uip/resolv.h +++ b/nuttx/include/net/uip/resolv.h @@ -33,7 +33,6 @@ #ifndef __UIP_RESOLV_H__ #define __UIP_RESOLV_H__ -#include <sys/types.h> #include <net/uip/uipopt.h> #undef EXTERN diff --git a/nuttx/include/net/uip/smtp.h b/nuttx/include/net/uip/smtp.h index 7a95323bb..4653443ff 100644 --- a/nuttx/include/net/uip/smtp.h +++ b/nuttx/include/net/uip/smtp.h @@ -44,8 +44,6 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> - #include <net/uip/uipopt.h> #include <net/uip/uip.h> diff --git a/nuttx/include/net/uip/tftp.h b/nuttx/include/net/uip/tftp.h index 888a77e77..7aa77c109 100644 --- a/nuttx/include/net/uip/tftp.h +++ b/nuttx/include/net/uip/tftp.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/net/uip/tftp.h * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -40,11 +40,11 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <stdbool.h> #include <arpa/inet.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -62,8 +62,8 @@ extern "C" { #define EXTERN extern #endif -EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, boolean binary); -EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binary); +EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary); +EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary); #undef EXTERN #ifdef __cplusplus diff --git a/nuttx/include/net/uip/thttpd.h b/nuttx/include/net/uip/thttpd.h index ba23e0e1d..bd445766c 100644 --- a/nuttx/include/net/uip/thttpd.h +++ b/nuttx/include/net/uip/thttpd.h @@ -41,7 +41,7 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <nuttx/symtab.h> /**************************************************************************** @@ -69,7 +69,7 @@ extern "C" { */ EXTERN FAR const struct symtab_s *g_thttpdsymtab; -EXTERN int g_thttpdnsymbols; +EXTERN int g_thttpdnsymbols; /**************************************************************************** * Public Function Prototypes diff --git a/nuttx/include/net/uip/uip-arch.h b/nuttx/include/net/uip/uip-arch.h index 3409f1416..34cdf8a4a 100644 --- a/nuttx/include/net/uip/uip-arch.h +++ b/nuttx/include/net/uip/uip-arch.h @@ -43,8 +43,9 @@ #define __UIP_ARCH_H #include <nuttx/config.h> -#include <sys/types.h> + #include <sys/ioctl.h> +#include <stdint.h> #include <net/if.h> #include <net/uip/uip.h> @@ -56,7 +57,7 @@ #include <net/ethernet.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** @@ -121,30 +122,30 @@ struct uip_driver_s * } */ - uint8 d_buf[CONFIG_NET_BUFSIZE + 2]; + uint8_t d_buf[CONFIG_NET_BUFSIZE + 2]; /* d_appdata points to the location where application data can be read from * or written into a packet. */ - uint8 *d_appdata; + uint8_t *d_appdata; /* This is a pointer into d_buf where a user application may append * data to be sent. */ - uint8 *d_snddata; + uint8_t *d_snddata; #ifdef CONFIG_NET_TCPURGDATA /* This pointer points to any urgent TCP data that has been received. Only * present if compiled with support for urgent data (CONFIG_NET_TCPURGDATA). */ - uint8 *d_urgdata; + uint8_t *d_urgdata; /* Length of the (received) urgent data */ - uint16 d_urglen; + uint16_t d_urglen; #endif /* The length of the packet in the d_buf buffer. @@ -160,13 +161,13 @@ struct uip_driver_s * packet. */ - uint16 d_len; + uint16_t d_len; /* When d_buf contains outgoing xmit data, xmtlen is nonzero and represents * the amount of appllcation data after d_snddata */ - uint16 d_sndlen; + uint16_t d_sndlen; /* Driver callbacks */ @@ -315,8 +316,8 @@ extern int uip_timer(struct uip_driver_s *dev, uip_poll_callback_t callback, int * uip_add32 only. */ -extern void uip_add32(const uint8 *op32, uint16 op16, uint8 *sum); -extern void uip_incr32(uint8 *op32, uint16 op16); +extern void uip_add32(const uint8_t *op32, uint16_t op16, uint8_t *sum); +extern void uip_incr32(uint8_t *op32, uint16_t op16); /* Calculate the Internet checksum over a buffer. * @@ -337,7 +338,7 @@ extern void uip_incr32(uint8 *op32, uint16 op16); * Return: The Internet checksum of the buffer. */ -extern uint16 uip_chksum(uint16 *buf, uint16 len); +extern uint16_t uip_chksum(uint16_t *buf, uint16_t len); /* Calculate the IP header checksum of the packet header in d_buf. * @@ -348,7 +349,7 @@ extern uint16 uip_chksum(uint16 *buf, uint16 len); * buffer. */ -extern uint16 uip_ipchksum(struct uip_driver_s *dev); +extern uint16_t uip_ipchksum(struct uip_driver_s *dev); /* Calculate the TCP checksum of the packet in d_buf and d_appdata. * @@ -363,10 +364,10 @@ extern uint16 uip_ipchksum(struct uip_driver_s *dev); * to by d_appdata. */ -extern uint16 uip_tcpchksum(struct uip_driver_s *dev); +extern uint16_t uip_tcpchksum(struct uip_driver_s *dev); -extern uint16 uip_udpchksum(struct uip_driver_s *dev); -extern uint16 uip_icmpchksum(struct uip_driver_s *dev, int len); +extern uint16_t uip_udpchksum(struct uip_driver_s *dev); +extern uint16_t uip_icmpchksum(struct uip_driver_s *dev, int len); #endif /* __UIP_ARCH_H */ diff --git a/nuttx/include/net/uip/uip-arp.h b/nuttx/include/net/uip/uip-arp.h index 134293ece..47b5b9992 100644 --- a/nuttx/include/net/uip/uip-arp.h +++ b/nuttx/include/net/uip/uip-arp.h @@ -46,8 +46,9 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <nuttx/compiler.h> + +#include <stdint.h> #include <net/ethernet.h> #include <net/uip/uip.h> @@ -72,9 +73,9 @@ struct uip_eth_hdr { - uint8 dest[6]; /* Ethernet destination address (6 bytes) */ - uint8 src[6]; /* Ethernet source address (6 bytes) */ - uint16 type; /* Type code (2 bytes) */ + uint8_t dest[6]; /* Ethernet destination address (6 bytes) */ + uint8_t src[6]; /* Ethernet source address (6 bytes) */ + uint16_t type; /* Type code (2 bytes) */ }; /* One entry in the ARP table (volatile!) */ @@ -83,7 +84,7 @@ struct arp_entry { in_addr_t at_ipaddr; /* IP address */ struct ether_addr at_ethaddr; /* Hardware address */ - uint8 at_time; + uint8_t at_time; }; /**************************************************************************** @@ -181,15 +182,15 @@ EXTERN void uip_arp_timer(void); * address of an existing association. * * Input parameters: - * pipaddr - Refers to an IP address uint16[2] in network order - * ethaddr - Refers to a HW address uint8[IFHWADDRLEN] + * pipaddr - Refers to an IP address uint16_t[2] in network order + * ethaddr - Refers to a HW address uint8_t[IFHWADDRLEN] * * Assumptions * Interrupts are disabled * ****************************************************************************/ -EXTERN void uip_arp_update(uint16 *pipaddr, uint8 *ethaddr); +EXTERN void uip_arp_update(uint16_t *pipaddr, uint8_t *ethaddr); /**************************************************************************** * Name: uip_arp_find diff --git a/nuttx/include/net/uip/uip-icmp.h b/nuttx/include/net/uip/uip-icmp.h index e6b52b07c..c9d4d90ee 100644 --- a/nuttx/include/net/uip/uip-icmp.h +++ b/nuttx/include/net/uip/uip-icmp.h @@ -46,11 +46,12 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> #include <net/uip/uipopt.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* ICMP/ICMP6 definitions */ @@ -115,12 +116,12 @@ struct uip_icmpip_hdr /* IPv6 Ip header */ - uint8 vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */ - uint8 tcf; /* Bits 0-3: traffic class (LS), bits 4-7: flow label (MS) */ - uint16 flow; /* 16-bit flow label (LS) */ - uint8 len[2]; /* 16-bit Payload length */ - uint8 proto; /* 8-bit Next header (same as IPv4 protocol field) */ - uint8 ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ + uint8_t vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */ + uint8_t tcf; /* Bits 0-3: traffic class (LS), bits 4-7: flow label (MS) */ + uint16_t flow; /* 16-bit flow label (LS) */ + uint8_t len[2]; /* 16-bit Payload length */ + uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ + uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ uip_ip6addr_t srcipaddr; /* 128-bit Source address */ uip_ip6addr_t destipaddr; /* 128-bit Destination address */ @@ -128,24 +129,24 @@ struct uip_icmpip_hdr /* IPv4 IP header */ - 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 */ + uint8_t vhl; /* 8-bit Version (4) and header length (5 or 6) */ + uint8_t tos; /* 8-bit Type of service (e.g., 6=TCP) */ + uint8_t len[2]; /* 16-bit Total length */ + uint8_t ipid[2]; /* 16-bit Identification */ + uint8_t ipoffset[2]; /* 16-bit IP flags + fragment offset */ + uint8_t ttl; /* 8-bit Time to Live */ + uint8_t proto; /* 8-bit Protocol */ + uint16_t ipchksum; /* 16-bit Header checksum */ + uint16_t srcipaddr[2]; /* 32-bit Source IP address */ + uint16_t destipaddr[2]; /* 32-bit Destination IP address */ #endif /* CONFIG_NET_IPv6 */ /* ICMP header */ - uint8 type; /* Defines the format of the ICMP message */ - uint8 icode; /* Further qualifies the ICMP messsage */ - uint16 icmpchksum; /* Checksum of ICMP header and data */ + uint8_t type; /* Defines the format of the ICMP message */ + uint8_t icode; /* Further qualifies the ICMP messsage */ + uint16_t icmpchksum; /* Checksum of ICMP header and data */ /* Data following the ICMP header contains the data specific to the * message type indicated by the Type and Code fields. @@ -155,19 +156,19 @@ struct uip_icmpip_hdr /* ICMP_ECHO_REQUEST and ICMP_ECHO_REPLY data */ - uint16 id; /* Used to match requests with replies */ - uint16 seqno; /* " " "" " " " " " " " " */ + uint16_t id; /* Used to match requests with replies */ + uint16_t seqno; /* " " "" " " " " " " " " */ #else /* !CONFIG_NET_IPv6 */ /* ICMP6_ECHO_REQUEST and ICMP6_ECHO_REPLY data */ - uint8 flags; - uint8 reserved1; - uint8 reserved2; - uint8 reserved3; - uint8 icmp6data[16]; - uint8 options[1]; + uint8_t flags; + uint8_t reserved1; + uint8_t reserved2; + uint8_t reserved3; + uint8_t icmp6data[16]; + uint8_t options[1]; #endif /* !CONFIG_NET_IPv6 */ }; @@ -201,7 +202,7 @@ extern "C" { #define EXTERN extern #endif -EXTERN int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dsecs); +EXTERN int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, int dsecs); #undef EXTERN #ifdef __cplusplus diff --git a/nuttx/include/net/uip/uip-lib.h b/nuttx/include/net/uip/uip-lib.h index ac7355e62..d0e5ac1d6 100644 --- a/nuttx/include/net/uip/uip-lib.h +++ b/nuttx/include/net/uip/uip-lib.h @@ -50,12 +50,14 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> +#include <stdbool.h> #include <pthread.h> #include <netinet/in.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* SOCK_DGRAM is the preferred socket type to use when we just want a @@ -89,12 +91,12 @@ * Return: Non-zero If the IP address was parsed. */ -extern boolean uiplib_ipaddrconv(const char *addrstr, ubyte *addr); +extern bool uiplib_ipaddrconv(const char *addrstr, uint8_t *addr); /* Get and set IP/MAC addresses */ -extern int uip_setmacaddr(const char *ifname, const uint8 *macaddr); -extern int uip_getmacaddr(const char *ifname, uint8 *macaddr); +extern int uip_setmacaddr(const char *ifname, const uint8_t *macaddr); +extern int uip_getmacaddr(const char *ifname, uint8_t *macaddr); #ifdef CONFIG_NET_IPv6 extern int uip_gethostaddr(const char *ifname, struct in6_addr *addr); @@ -110,12 +112,12 @@ extern int uip_setnetmask(const char *ifname, const struct in_addr *addr); /* HTTP support */ -extern int uip_parsehttpurl(const char *url, uint16 *port, +extern int uip_parsehttpurl(const char *url, uint16_t *port, char *hostname, int hostlen, char *filename, int namelen); /* Generic server logic */ -extern void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize); +extern void uip_server(uint16_t portno, pthread_startroutine_t handler, int stacksize); #endif /* __NET_UIP_UIP_LIB_H */ diff --git a/nuttx/include/net/uip/uip-tcp.h b/nuttx/include/net/uip/uip-tcp.h index 4b61c8f2a..935f19ce7 100644 --- a/nuttx/include/net/uip/uip-tcp.h +++ b/nuttx/include/net/uip/uip-tcp.h @@ -6,7 +6,7 @@ * of C macros that are used by uIP programs as well as internal uIP * structures, TCP/IP header structures and function declarations. * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * This logic was leveraged from uIP which also has a BSD-style license: @@ -52,11 +52,12 @@ #include <nuttx/config.h> #ifdef CONFIG_NET_TCP -#include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> #include <net/uip/uipopt.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* TCP definitions */ @@ -124,25 +125,25 @@ struct uip_conn { dq_entry_t node; /* Implements a doubly linked list */ uip_ipaddr_t ripaddr; /* The IP address of the remote host */ - uint16 lport; /* The local TCP port, in network byte order */ - uint16 rport; /* The remoteTCP port, in network byte order */ - uint8 rcv_nxt[4]; /* The sequence number that we expect to + uint16_t lport; /* The local TCP port, in network byte order */ + uint16_t rport; /* The remoteTCP port, in network byte order */ + uint8_t rcv_nxt[4]; /* The sequence number that we expect to * receive next */ - uint8 snd_nxt[4]; /* The sequence number that was last sent by us */ - uint16 len; /* Length of the data that was previously sent */ - uint16 mss; /* Current maximum segment size for the + uint8_t snd_nxt[4]; /* The sequence number that was last sent by us */ + uint16_t len; /* Length of the data that was previously sent */ + uint16_t mss; /* Current maximum segment size for the * connection */ - uint16 initialmss; /* Initial maximum segment size for the + uint16_t initialmss; /* Initial maximum segment size for the * connection */ - uint8 crefs; /* Reference counts on this instance */ - uint8 sa; /* Retransmission time-out calculation state + uint8_t crefs; /* Reference counts on this instance */ + uint8_t sa; /* Retransmission time-out calculation state * variable */ - uint8 sv; /* Retransmission time-out calculation state + uint8_t sv; /* Retransmission time-out calculation state * variable */ - uint8 rto; /* Retransmission time-out */ - uint8 tcpstateflags; /* TCP state and flags */ - uint8 timer; /* The retransmission timer (units: half-seconds) */ - uint8 nrtx; /* The number of retransmissions for the last + uint8_t rto; /* Retransmission time-out */ + uint8_t tcpstateflags; /* TCP state and flags */ + uint8_t timer; /* The retransmission timer (units: half-seconds) */ + uint8_t nrtx; /* The number of retransmissions for the last * segment sent */ /* Read-ahead buffering. @@ -204,7 +205,7 @@ struct uip_conn /* connection_event() is called on any of the subset of connection-related events */ FAR void *connection_private; - void (*connection_event)(FAR struct uip_conn *conn, uint16 flags); + void (*connection_event)(FAR struct uip_conn *conn, uint16_t flags); }; /* The following structure is used to handle read-ahead buffering for TCP @@ -217,8 +218,8 @@ struct uip_conn struct uip_readahead_s { sq_entry_t rh_node; /* Supports a singly linked list */ - uint16 rh_nbytes; /* Number of bytes available in this buffer */ - uint8 rh_buffer[CONFIG_NET_TCP_READAHEAD_BUFSIZE]; + uint16_t rh_nbytes; /* Number of bytes available in this buffer */ + uint8_t rh_buffer[CONFIG_NET_TCP_READAHEAD_BUFSIZE]; }; #endif @@ -271,12 +272,12 @@ struct uip_tcpip_hdr /* IPv6 Ip header */ - uint8 vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */ - uint8 tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */ - uint16 flow; /* 16-bit flow label (LS) */ - uint8 len[2]; /* 16-bit Payload length */ - uint8 proto; /* 8-bit Next header (same as IPv4 protocol field) */ - uint8 ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ + uint8_t vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */ + uint8_t tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */ + uint16_t flow; /* 16-bit flow label (LS) */ + uint8_t len[2]; /* 16-bit Payload length */ + uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ + uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ uip_ip6addr_t srcipaddr; /* 128-bit Source address */ uip_ip6addr_t destipaddr; /* 128-bit Destination address */ @@ -284,31 +285,31 @@ struct uip_tcpip_hdr /* IPv4 IP header */ - 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 */ + uint8_t vhl; /* 8-bit Version (4) and header length (5 or 6) */ + uint8_t tos; /* 8-bit Type of service (e.g., 6=TCP) */ + uint8_t len[2]; /* 16-bit Total length */ + uint8_t ipid[2]; /* 16-bit Identification */ + uint8_t ipoffset[2]; /* 16-bit IP flags + fragment offset */ + uint8_t ttl; /* 8-bit Time to Live */ + uint8_t proto; /* 8-bit Protocol */ + uint16_t ipchksum; /* 16-bit Header checksum */ + uint16_t srcipaddr[2]; /* 32-bit Source IP address */ + uint16_t destipaddr[2]; /* 32-bit Destination IP address */ #endif /* CONFIG_NET_IPv6 */ /* TCP header */ - uint16 srcport; - uint16 destport; - uint8 seqno[4]; - uint8 ackno[4]; - uint8 tcpoffset; - uint8 flags; - uint8 wnd[2]; - uint16 tcpchksum; - uint8 urgp[2]; - uint8 optdata[4]; + uint16_t srcport; + uint16_t destport; + uint8_t seqno[4]; + uint8_t ackno[4]; + uint8_t tcpoffset; + uint8_t flags; + uint8_t wnd[2]; + uint16_t tcpchksum; + uint8_t urgp[2]; + uint8_t optdata[4]; }; /**************************************************************************** @@ -401,9 +402,9 @@ extern int uip_backlogdestroy(FAR struct uip_conn *conn); extern int uip_backlogadd(FAR struct uip_conn *conn, FAR struct uip_conn *blconn); #ifndef CONFIG_DISABLE_POLL -extern boolean uip_backlogavailable(FAR struct uip_conn *conn); +extern bool uip_backlogavailable(FAR struct uip_conn *conn); #else -# define uip_backlogavailable(conn) (FALSE); +# define uip_backlogavailable(conn) (false); #endif extern FAR struct uip_conn *uip_backlogremove(FAR struct uip_conn *conn); extern int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blconn); @@ -412,7 +413,7 @@ extern int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blc # define uip_backlogcreate(conn,nblg) (-ENOSYS) # define uip_backlogdestroy(conn) (-ENOSYS) # define uip_backlogadd(conn,blconn) (-ENOSYS) -# define uip_backlogavailable(conn) (FALSE); +# define uip_backlogavailable(conn) (false); # define uip_backlogremove(conn) (NULL) #endif diff --git a/nuttx/include/net/uip/uip-udp.h b/nuttx/include/net/uip/uip-udp.h index 69f0ea7f5..a27e1a3b5 100644 --- a/nuttx/include/net/uip/uip-udp.h +++ b/nuttx/include/net/uip/uip-udp.h @@ -6,7 +6,7 @@ * of C macros that are used by uIP programs as well as internal uIP * structures, UDP header structures and function declarations. * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * This logic was leveraged from uIP which also has a BSD-style license: @@ -50,11 +50,12 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> #include <net/uip/uipopt.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* Header sizes */ @@ -74,10 +75,10 @@ struct uip_udp_conn { dq_entry_t node; /* Supports a doubly linked list */ uip_ipaddr_t ripaddr; /* The IP address of the remote peer */ - uint16 lport; /* The local port number in network byte order */ - uint16 rport; /* The remote port number in network byte order */ - uint8 ttl; /* Default time-to-live */ - uint8 crefs; /* Reference counts on this instance */ + uint16_t lport; /* The local port number in network byte order */ + uint16_t rport; /* The remote port number in network byte order */ + uint8_t ttl; /* Default time-to-live */ + uint8_t crefs; /* Reference counts on this instance */ /* Defines the list of UDP callbacks */ @@ -92,12 +93,12 @@ struct uip_udpip_hdr /* IPv6 Ip header */ - uint8 vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */ - uint8 tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */ - uint16 flow; /* 16-bit flow label (LS) */ - uint8 len[2]; /* 16-bit Payload length */ - uint8 proto; /* 8-bit Next header (same as IPv4 protocol field) */ - uint8 ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ + uint8_t vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */ + uint8_t tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */ + uint16_t flow; /* 16-bit flow label (LS) */ + uint8_t len[2]; /* 16-bit Payload length */ + uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */ + uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */ uip_ip6addr_t srcipaddr; /* 128-bit Source address */ uip_ip6addr_t destipaddr; /* 128-bit Destination address */ @@ -105,25 +106,25 @@ struct uip_udpip_hdr /* IPv4 header */ - 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 */ + uint8_t vhl; /* 8-bit Version (4) and header length (5 or 6) */ + uint8_t tos; /* 8-bit Type of service (e.g., 6=TCP) */ + uint8_t len[2]; /* 16-bit Total length */ + uint8_t ipid[2]; /* 16-bit Identification */ + uint8_t ipoffset[2]; /* 16-bit IP flags + fragment offset */ + uint8_t ttl; /* 8-bit Time to Live */ + uint8_t proto; /* 8-bit Protocol */ + uint16_t ipchksum; /* 16-bit Header checksum */ + uint16_t srcipaddr[2]; /* 32-bit Source IP address */ + uint16_t destipaddr[2]; /* 32-bit Destination IP address */ #endif /* CONFIG_NET_IPv6 */ /* UDP header */ - uint16 srcport; - uint16 destport; - uint16 udplen; - uint16 udpchksum; + uint16_t srcport; + uint16_t destport; + uint16_t udplen; + uint16_t udpchksum; }; /* The structure holding the UDP statistics that are gathered if @@ -133,10 +134,10 @@ struct uip_udpip_hdr #ifdef CONFIG_NET_STATISTICS struct uip_udp_stats_s { - uip_stats_t drop; /* Number of dropped UDP segments */ - uip_stats_t recv; /* Number of recived UDP segments */ - uip_stats_t sent; /* Number of sent UDP segments */ - uip_stats_t chkerr; /* Number of UDP segments with a bad checksum */ + uip_stats_t drop; /* Number of dropped UDP segments */ + uip_stats_t recv; /* Number of recived UDP segments */ + uip_stats_t sent; /* Number of sent UDP segments */ + uip_stats_t chkerr; /* Number of UDP segments with a bad checksum */ }; #endif diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h index af3b75adb..8c6c1246c 100644 --- a/nuttx/include/net/uip/uip.h +++ b/nuttx/include/net/uip/uip.h @@ -50,14 +50,15 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> #include <queue.h> #include <arpa/inet.h> #include <net/uip/uipopt.h> /**************************************************************************** - * Definitions + * Pre-processor Definitions ****************************************************************************/ /* The following flags may be set in the set of flags before calling the @@ -350,9 +351,9 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); /* Convert an IPv4 address of the form uint16_t[2] to an in_addr_t */ #ifdef CONFIG_ENDIAN_BIG -# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[0] << 16) | (in_addr_t)((uint16*)addr)[1]) +# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[0] << 16) | (in_addr_t)((uint16_t*)addr)[1]) #else -# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16*)addr)[1] << 16) | (in_addr_t)((uint16_t*)addr)[0]) +# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[1] << 16) | (in_addr_t)((uint16_t*)addr)[0]) #endif /* Construct an IPv6 address from eight 16-bit words. @@ -452,8 +453,8 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len); (((in_addr_t)(addr1) & (in_addr_t)(mask)) == \ ((in_addr_t)(addr2) & (in_addr_t)(mask))) #else -extern boolean uip_ipaddr_maskcmp(uip_addr_t addr1, uip_addr_t addr2, - uip_addr_t mask); +extern bool uip_ipaddr_maskcmp(uip_addr_t addr1, uip_addr_t addr2, + uip_addr_t mask); #endif /* Mask out the network part of an IP address. diff --git a/nuttx/include/net/uip/webclient.h b/nuttx/include/net/uip/webclient.h index 13787e2db..6e91bfb23 100644 --- a/nuttx/include/net/uip/webclient.h +++ b/nuttx/include/net/uip/webclient.h @@ -52,7 +52,7 @@ #include <sys/types.h> /**************************************************************************** - * Pre-processor definitions + * Pre-processor Definitions ****************************************************************************/ #ifndef CONFIG_WEBCLIENT_MAXHTTPLINE |