Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2344 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
9634f25391
commit
92e71b0b94
30 changed files with 202 additions and 193 deletions
|
@ -55,9 +55,8 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -67,7 +66,7 @@
|
|||
#include <net/uip/uip-arp.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define ARP_REQUEST 1
|
||||
|
@ -87,32 +86,32 @@
|
|||
|
||||
struct arp_hdr
|
||||
{
|
||||
uint16 ah_hwtype; /* 16-bit Hardware type (Ethernet=0x001) */
|
||||
uint16 ah_protocol; /* 16-bit Protocol type (IP=0x0800) */
|
||||
uint8 ah_hwlen; /* 8-bit Hardware address size (6) */
|
||||
uint8 ah_protolen; /* 8-bit Procotol address size (4) */
|
||||
uint16 ah_opcode; /* 16-bit Operation */
|
||||
uint8 ah_shwaddr[6]; /* 48-bit Sender hardware address */
|
||||
uint16 ah_sipaddr[2]; /* 32-bit Sender IP adress */
|
||||
uint8 ah_dhwaddr[6]; /* 48-bit Target hardware address */
|
||||
uint16 ah_dipaddr[2]; /* 32-bit Target IP address */
|
||||
uint16_t ah_hwtype; /* 16-bit Hardware type (Ethernet=0x001) */
|
||||
uint16_t ah_protocol; /* 16-bit Protocol type (IP=0x0800) */
|
||||
uint8_t ah_hwlen; /* 8-bit Hardware address size (6) */
|
||||
uint8_t ah_protolen; /* 8-bit Procotol address size (4) */
|
||||
uint16_t ah_opcode; /* 16-bit Operation */
|
||||
uint8_t ah_shwaddr[6]; /* 48-bit Sender hardware address */
|
||||
uint16_t ah_sipaddr[2]; /* 32-bit Sender IP adress */
|
||||
uint8_t ah_dhwaddr[6]; /* 48-bit Target hardware address */
|
||||
uint16_t ah_dipaddr[2]; /* 32-bit Target IP address */
|
||||
};
|
||||
|
||||
/* IP header -- Size 20 or 24 bytes */
|
||||
|
||||
struct ethip_hdr
|
||||
{
|
||||
uint8 eh_vhl; /* 8-bit Version (4) and header length (5 or 6) */
|
||||
uint8 eh_tos; /* 8-bit Type of service (e.g., 6=TCP) */
|
||||
uint8 eh_len[2]; /* 16-bit Total length */
|
||||
uint8 eh_ipid[2]; /* 16-bit Identification */
|
||||
uint8 eh_ipoffset[2]; /* 16-bit IP flags + fragment offset */
|
||||
uint8 eh_ttl; /* 8-bit Time to Live */
|
||||
uint8 eh_proto; /* 8-bit Protocol */
|
||||
uint16 eh_ipchksum; /* 16-bit Header checksum */
|
||||
uint16 eh_srcipaddr[2]; /* 32-bit Source IP address */
|
||||
uint16 eh_destipaddr[2]; /* 32-bit Destination IP address */
|
||||
uint16 eh_ipoption[2]; /* (optional) */
|
||||
uint8_t eh_vhl; /* 8-bit Version (4) and header length (5 or 6) */
|
||||
uint8_t eh_tos; /* 8-bit Type of service (e.g., 6=TCP) */
|
||||
uint8_t eh_len[2]; /* 16-bit Total length */
|
||||
uint8_t eh_ipid[2]; /* 16-bit Identification */
|
||||
uint8_t eh_ipoffset[2]; /* 16-bit IP flags + fragment offset */
|
||||
uint8_t eh_ttl; /* 8-bit Time to Live */
|
||||
uint8_t eh_proto; /* 8-bit Protocol */
|
||||
uint16_t eh_ipchksum; /* 16-bit Header checksum */
|
||||
uint16_t eh_srcipaddr[2]; /* 32-bit Source IP address */
|
||||
uint16_t eh_destipaddr[2]; /* 32-bit Destination IP address */
|
||||
uint16_t eh_ipoption[2]; /* (optional) */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -123,7 +122,7 @@ struct ethip_hdr
|
|||
|
||||
static const struct ether_addr g_broadcast_ethaddr =
|
||||
{{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}};
|
||||
static const uint16 g_broadcast_ipaddr[2] = {0xffff, 0xffff};
|
||||
static const uint16_t g_broadcast_ipaddr[2] = {0xffff, 0xffff};
|
||||
|
||||
/* Support for IGMP multicast addresses.
|
||||
*
|
||||
|
@ -142,7 +141,7 @@ static const uint16 g_broadcast_ipaddr[2] = {0xffff, 0xffff};
|
|||
*/
|
||||
|
||||
#if defined(CONFIG_NET_MULTICAST) && !defined(CONFIG_NET_IPv6)
|
||||
static const ubyte g_multicast_ethaddr[3] = {0x01, 0x00, 0x5e};
|
||||
static const uint8_t g_multicast_ethaddr[3] = {0x01, 0x00, 0x5e};
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -325,7 +324,7 @@ void uip_arp_out(struct uip_driver_s *dev)
|
|||
* last three bytes of the IP address.
|
||||
*/
|
||||
|
||||
const ubyte *ip = ((ubyte*)pip->eh_destipaddr) + 1;
|
||||
const uint8_t *ip = ((uint8_t*)pip->eh_destipaddr) + 1;
|
||||
memcpy(peth->dest, g_multicast_ethaddr, 3);
|
||||
memcpy(&peth->dest[3], ip, 3);
|
||||
}
|
||||
|
|
|
@ -45,9 +45,8 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -57,7 +56,7 @@
|
|||
#include <net/uip/uip-arp.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -71,7 +70,7 @@
|
|||
/* The table of known address mappings */
|
||||
|
||||
static struct arp_entry g_arptable[CONFIG_NET_ARPTAB_SIZE];
|
||||
static uint8 g_arptime;
|
||||
static uint8_t g_arptime;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -134,15 +133,15 @@ void uip_arp_timer(void)
|
|||
* address of an existing association.
|
||||
*
|
||||
* Input parameters:
|
||||
* pipaddr - Refers to an IP address uint16[2]
|
||||
* ethaddr - Refers to a HW address uint8[IFHWADDRLEN]
|
||||
* pipaddr - Refers to an IP address uint16_t[2]
|
||||
* ethaddr - Refers to a HW address uint8_t[IFHWADDRLEN]
|
||||
*
|
||||
* Assumptions
|
||||
* Interrupts are disabled
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_arp_update(uint16 *pipaddr, uint8 *ethaddr)
|
||||
void uip_arp_update(uint16_t *pipaddr, uint8_t *ethaddr)
|
||||
{
|
||||
struct arp_entry *tabptr = NULL;
|
||||
in_addr_t ipaddr = uip_ip4addr_conv(pipaddr);
|
||||
|
@ -195,7 +194,7 @@ void uip_arp_update(uint16 *pipaddr, uint8 *ethaddr)
|
|||
|
||||
if (i == CONFIG_NET_ARPTAB_SIZE)
|
||||
{
|
||||
uint8 tmpage = 0;
|
||||
uint8_t tmpage = 0;
|
||||
int j = 0;
|
||||
for (i = 0; i < CONFIG_NET_ARPTAB_SIZE; ++i)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -206,8 +206,8 @@ void uip_callbackfree(FAR struct uip_callback_s *cb, FAR struct uip_callback_s *
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint16 uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn, uint16 flags,
|
||||
FAR struct uip_callback_s *list)
|
||||
uint16_t uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn,
|
||||
uint16_t flags, FAR struct uip_callback_s *list)
|
||||
{
|
||||
FAR struct uip_callback_s *next;
|
||||
irqstate_t save;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -51,7 +51,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BUF ((struct uip_ip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
@ -66,11 +66,11 @@
|
|||
****************************************************************************/
|
||||
|
||||
#if !UIP_ARCH_CHKSUM
|
||||
static uint16 chksum(uint16 sum, const uint8 *data, uint16 len)
|
||||
static uint16_t chksum(uint16_t sum, const uint8_t *data, uint16_t len)
|
||||
{
|
||||
uint16 t;
|
||||
const uint8 *dataptr;
|
||||
const uint8 *last_byte;
|
||||
uint16_t t;
|
||||
const uint8_t *dataptr;
|
||||
const uint8_t *last_byte;
|
||||
|
||||
dataptr = data;
|
||||
last_byte = data + len - 1;
|
||||
|
@ -103,16 +103,16 @@ static uint16 chksum(uint16 sum, const uint8 *data, uint16 len)
|
|||
return sum;
|
||||
}
|
||||
|
||||
static uint16 upper_layer_chksum(struct uip_driver_s *dev, uint8 proto)
|
||||
static uint16_t upper_layer_chksum(struct uip_driver_s *dev, uint8_t proto)
|
||||
{
|
||||
struct uip_ip_hdr *pbuf = BUF;
|
||||
uint16 upper_layer_len;
|
||||
uint16 sum;
|
||||
uint16_t upper_layer_len;
|
||||
uint16_t sum;
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
upper_layer_len = (((uint16)(pbuf->len[0]) << 8) + pbuf->len[1]);
|
||||
upper_layer_len = (((uint16_t)(pbuf->len[0]) << 8) + pbuf->len[1]);
|
||||
#else /* CONFIG_NET_IPv6 */
|
||||
upper_layer_len = (((uint16)(pbuf->len[0]) << 8) + pbuf->len[1]) - UIP_IPH_LEN;
|
||||
upper_layer_len = (((uint16_t)(pbuf->len[0]) << 8) + pbuf->len[1]) - UIP_IPH_LEN;
|
||||
#endif /* CONFIG_NET_IPv6 */
|
||||
|
||||
/* First sum pseudoheader. */
|
||||
|
@ -123,7 +123,7 @@ static uint16 upper_layer_chksum(struct uip_driver_s *dev, uint8 proto)
|
|||
|
||||
/* Sum IP source and destination addresses. */
|
||||
|
||||
sum = chksum(sum, (uint8 *)&pbuf->srcipaddr, 2 * sizeof(uip_ipaddr_t));
|
||||
sum = chksum(sum, (uint8_t *)&pbuf->srcipaddr, 2 * sizeof(uip_ipaddr_t));
|
||||
|
||||
/* Sum TCP header and data. */
|
||||
|
||||
|
@ -133,7 +133,7 @@ static uint16 upper_layer_chksum(struct uip_driver_s *dev, uint8 proto)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
static uint16 uip_icmp6chksum(struct uip_driver_s *dev)
|
||||
static uint16_t uip_icmp6chksum(struct uip_driver_s *dev)
|
||||
{
|
||||
return upper_layer_chksum(dev, UIP_PROTO_ICMP6);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ static uint16 uip_icmp6chksum(struct uip_driver_s *dev)
|
|||
/* Calculate the Internet checksum over a buffer. */
|
||||
|
||||
#if !UIP_ARCH_ADD32
|
||||
static void uip_carry32(uint8 *sum, uint16 op16)
|
||||
static void uip_carry32(uint8_t *sum, uint16_t op16)
|
||||
{
|
||||
if (sum[2] < (op16 >> 8))
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ static void uip_carry32(uint8 *sum, uint16 op16)
|
|||
}
|
||||
}
|
||||
|
||||
void uip_add32(const uint8 *op32, uint16 op16, uint8 *sum)
|
||||
void uip_add32(const uint8_t *op32, uint16_t op16, uint8_t *sum)
|
||||
{
|
||||
/* op32 and the sum are in network order (big-endian); op16 is host order. */
|
||||
|
||||
|
@ -184,7 +184,7 @@ void uip_add32(const uint8 *op32, uint16 op16, uint8 *sum)
|
|||
uip_carry32(sum, op16);
|
||||
}
|
||||
|
||||
void uip_incr32(uint8 *op32, uint16 op16)
|
||||
void uip_incr32(uint8_t *op32, uint16_t op16)
|
||||
{
|
||||
op32[3] += (op16 & 0xff);
|
||||
op32[2] += (op16 >> 8);
|
||||
|
@ -194,17 +194,17 @@ void uip_incr32(uint8 *op32, uint16 op16)
|
|||
#endif /* UIP_ARCH_ADD32 */
|
||||
|
||||
#if !UIP_ARCH_CHKSUM
|
||||
uint16 uip_chksum(uint16 *data, uint16 len)
|
||||
uint16_t uip_chksum(uint16_t *data, uint16_t len)
|
||||
{
|
||||
return htons(chksum(0, (uint8 *)data, len));
|
||||
return htons(chksum(0, (uint8_t *)data, len));
|
||||
}
|
||||
|
||||
/* Calculate the IP header checksum of the packet header in d_buf. */
|
||||
|
||||
#ifndef UIP_ARCH_IPCHKSUM
|
||||
uint16 uip_ipchksum(struct uip_driver_s *dev)
|
||||
uint16_t uip_ipchksum(struct uip_driver_s *dev)
|
||||
{
|
||||
uint16 sum;
|
||||
uint16_t sum;
|
||||
|
||||
sum = chksum(0, &dev->d_buf[UIP_LLH_LEN], UIP_IPH_LEN);
|
||||
return (sum == 0) ? 0xffff : htons(sum);
|
||||
|
@ -213,7 +213,7 @@ uint16 uip_ipchksum(struct uip_driver_s *dev)
|
|||
|
||||
/* Calculate the TCP checksum of the packet in d_buf and d_appdata. */
|
||||
|
||||
uint16 uip_tcpchksum(struct uip_driver_s *dev)
|
||||
uint16_t uip_tcpchksum(struct uip_driver_s *dev)
|
||||
{
|
||||
return upper_layer_chksum(dev, UIP_PROTO_TCP);
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ uint16 uip_tcpchksum(struct uip_driver_s *dev)
|
|||
/* Calculate the UDP checksum of the packet in d_buf and d_appdata. */
|
||||
|
||||
#ifdef CONFIG_NET_UDP_CHECKSUMS
|
||||
uint16 uip_udpchksum(struct uip_driver_s *dev)
|
||||
uint16_t uip_udpchksum(struct uip_driver_s *dev)
|
||||
{
|
||||
return upper_layer_chksum(dev, UIP_PROTO_UDP);
|
||||
}
|
||||
|
@ -230,10 +230,10 @@ uint16 uip_udpchksum(struct uip_driver_s *dev)
|
|||
/* Calculate the checksum of the ICMP message */
|
||||
|
||||
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING)
|
||||
uint16 uip_icmpchksum(struct uip_driver_s *dev, int len)
|
||||
uint16_t uip_icmpchksum(struct uip_driver_s *dev, int len)
|
||||
{
|
||||
struct uip_icmpip_hdr *picmp = ICMPBUF;
|
||||
return uip_chksum((uint16*)&picmp->type, len);
|
||||
return uip_chksum((uint16_t*)&picmp->type, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/if.h>
|
||||
|
@ -58,7 +58,7 @@
|
|||
#ifdef CONFIG_NET_ICMP
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define ICMPBUF ((struct uip_icmpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
@ -146,7 +146,7 @@ void uip_icmpinput(struct uip_driver_s *dev)
|
|||
/* The slow way... sum over the ICMP message */
|
||||
|
||||
picmp->icmpchksum = 0;
|
||||
picmp->icmpchksum = ~uip_icmpchksum(dev, (((uint16)picmp->len[0] << 8) | (uint16)picmp->len[1]) - UIP_IPH_LEN);
|
||||
picmp->icmpchksum = ~uip_icmpchksum(dev, (((uint16_t)picmp->len[0] << 8) | (uint16_t)picmp->len[1]) - UIP_IPH_LEN);
|
||||
if (picmp->icmpchksum == 0)
|
||||
{
|
||||
picmp->icmpchksum = 0xffff;
|
||||
|
@ -264,7 +264,7 @@ typeerr:
|
|||
#ifdef CONFIG_NET_ICMP_PING
|
||||
else if (picmp->type == ICMP6_ECHO_REPLY && g_echocallback)
|
||||
{
|
||||
uint16 flags = UIP_ECHOREPLY;
|
||||
uint16_t flags = UIP_ECHOREPLY;
|
||||
|
||||
if (g_echocallback)
|
||||
{
|
||||
|
|
|
@ -42,6 +42,8 @@
|
|||
defined(CONFIG_NET_ICMP_PING) && !defined(CONFIG_DISABLE_CLOCK)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <semaphore.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -55,7 +57,7 @@
|
|||
#include "../net_internal.h" /* Should not include this! */
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define ICMPBUF ((struct uip_icmpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
@ -75,14 +77,14 @@ struct icmp_ping_s
|
|||
FAR struct uip_callback_s *png_cb; /* Reference to callback instance */
|
||||
|
||||
sem_t png_sem; /* Use to manage the wait for the response */
|
||||
uint32 png_time; /* Start time for determining timeouts */
|
||||
uint32 png_ticks; /* System clock ticks to wait */
|
||||
uint32_t png_time; /* Start time for determining timeouts */
|
||||
uint32_t png_ticks; /* System clock ticks to wait */
|
||||
int png_result; /* 0: success; <0:negated errno on fail */
|
||||
uip_ipaddr_t png_addr; /* The peer to be ping'ed */
|
||||
uint16 png_id; /* Used to match requests with replies */
|
||||
uint16 png_seqno; /* IN: seqno to send; OUT: seqno recieved */
|
||||
uint16 png_datlen; /* The length of data to send in the ECHO request */
|
||||
boolean png_sent; /* TRUE... the PING request has been sent */
|
||||
uint16_t png_id; /* Used to match requests with replies */
|
||||
uint16_t png_seqno; /* IN: seqno to send; OUT: seqno recieved */
|
||||
uint16_t png_datlen; /* The length of data to send in the ECHO request */
|
||||
bool png_sent; /* true... the PING request has been sent */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -116,7 +118,7 @@ struct icmp_ping_s
|
|||
|
||||
static inline int ping_timeout(struct icmp_ping_s *pstate)
|
||||
{
|
||||
uint32 elapsed = g_system_timer - pstate->png_time;
|
||||
uint32_t elapsed = g_system_timer - pstate->png_time;
|
||||
if (elapsed >= pstate->png_ticks)
|
||||
{
|
||||
return TRUE;
|
||||
|
@ -145,11 +147,11 @@ static inline int ping_timeout(struct icmp_ping_s *pstate)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn,
|
||||
void *pvpriv, uint16 flags)
|
||||
static uint16_t ping_interrupt(struct uip_driver_s *dev, void *conn,
|
||||
void *pvpriv, uint16_t flags)
|
||||
{
|
||||
struct icmp_ping_s *pstate = (struct icmp_ping_s *)pvpriv;
|
||||
ubyte *ptr;
|
||||
uint8_t *ptr;
|
||||
int failcode = -ETIMEDOUT;
|
||||
int i;
|
||||
|
||||
|
@ -243,7 +245,7 @@ static uint16 ping_interrupt(struct uip_driver_s *dev, void *conn,
|
|||
nlldbg("Send ECHO request: seqno=%d\n", pstate->png_seqno);
|
||||
dev->d_sndlen= pstate->png_datlen + 4;
|
||||
uip_icmpsend(dev, &pstate->png_addr);
|
||||
pstate->png_sent = TRUE;
|
||||
pstate->png_sent = true;
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
|
@ -309,7 +311,8 @@ end_wait:
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dsecs)
|
||||
int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno,
|
||||
uint16_t datalen, int dsecs)
|
||||
{
|
||||
struct icmp_ping_s state;
|
||||
irqstate_t save;
|
||||
|
@ -323,7 +326,7 @@ int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dse
|
|||
state.png_id = id; /* The ID to use in the ECHO request */
|
||||
state.png_seqno = seqno; /* The seqno to use int the ECHO request */
|
||||
state.png_datlen = datalen; /* The length of data to send in the ECHO request */
|
||||
state.png_sent = FALSE; /* ECHO request not yet sent */
|
||||
state.png_sent = false; /* ECHO request not yet sent */
|
||||
|
||||
save = irqsave();
|
||||
state.png_time = g_system_timer;
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* net/uip/uip_initialize.c
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
* Adapted for NuttX from logic in uIP which also has a BSD-like license:
|
||||
|
@ -44,12 +44,13 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <stdint.h>
|
||||
#include <net/uip/uip.h>
|
||||
|
||||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -64,7 +65,7 @@ struct uip_stats uip_stat;
|
|||
|
||||
/* Increasing number used for the IP ID field. */
|
||||
|
||||
uint16 g_ipid;
|
||||
uint16_t g_ipid;
|
||||
|
||||
const uip_ipaddr_t g_alloneaddr =
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
|
@ -83,7 +84,7 @@ const uip_ipaddr_t g_allzeroaddr =
|
|||
/* Reassembly timer (units: deci-seconds) */
|
||||
|
||||
#if UIP_REASSEMBLY && !defined(CONFIG_NET_IPv6)
|
||||
uint8 uip_reasstmr;
|
||||
uint8_t uip_reasstmr;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -80,9 +80,8 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -97,7 +96,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Macros. */
|
||||
|
@ -120,11 +119,11 @@
|
|||
****************************************************************************/
|
||||
|
||||
#if UIP_REASSEMBLY && !defined(CONFIG_NET_IPv6)
|
||||
static uint8 uip_reassbuf[UIP_REASS_BUFSIZE];
|
||||
static uint8 uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
|
||||
static const uint8 bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01};
|
||||
static uint16 uip_reasslen;
|
||||
static uint8 uip_reassflags;
|
||||
static uint8_t uip_reassbuf[UIP_REASS_BUFSIZE];
|
||||
static uint8_t uip_reassbitmap[UIP_REASS_BUFSIZE / (8 * 8)];
|
||||
static const uint8_t bitmap_bits[8] = {0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01};
|
||||
static uint16_t uip_reasslen;
|
||||
static uint8_t uip_reassflags;
|
||||
#endif /* UIP_REASSEMBLY */
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -142,13 +141,13 @@ static uint8 uip_reassflags;
|
|||
****************************************************************************/
|
||||
|
||||
#if UIP_REASSEMBLY && !defined(CONFIG_NET_IPv6)
|
||||
static uint8 uip_reass(void)
|
||||
static uint8_t uip_reass(void)
|
||||
{
|
||||
struct uip_ip_hdr *pbuf = BUF;
|
||||
struct uip_ip_hdr *pfbuf = FBUF;
|
||||
uint16 offset;
|
||||
uint16 len;
|
||||
uint16 i;
|
||||
uint16_t offset;
|
||||
uint16_t len;
|
||||
uint16_t i;
|
||||
|
||||
/* If uip_reasstmr is zero, no packet is present in the buffer, so we
|
||||
* write the IP header of the fragment into the reassembly
|
||||
|
@ -250,7 +249,7 @@ static uint8 uip_reass(void)
|
|||
* right amount of bits.
|
||||
*/
|
||||
|
||||
if (uip_reassbitmap[uip_reasslen / (8 * 8)] != (uint8)~bitmap_bits[uip_reasslen / 8 & 7])
|
||||
if (uip_reassbitmap[uip_reasslen / (8 * 8)] != (uint8_t)~bitmap_bits[uip_reasslen / 8 & 7])
|
||||
{
|
||||
goto nullreturn;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* net/uip/uip_internal.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>
|
||||
*
|
||||
* This logic was leveraged from uIP which also has a BSD-style license:
|
||||
|
@ -46,7 +46,8 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
#include <arch/irq.h>
|
||||
#include <net/uip/uip.h>
|
||||
|
@ -68,12 +69,12 @@ extern const uip_ipaddr_t g_allzeroaddr;
|
|||
|
||||
/* Increasing number used for the IP ID field. */
|
||||
|
||||
extern uint16 g_ipid;
|
||||
extern uint16_t g_ipid;
|
||||
|
||||
/* Reassembly timer (units: deci-seconds) */
|
||||
|
||||
#if UIP_REASSEMBLY && !defined(CONFIG_NET_IPv6)
|
||||
extern uint8 uip_reasstmr;
|
||||
extern uint8_t uip_reasstmr;
|
||||
#endif
|
||||
|
||||
/* List of applications waiting for ICMP ECHO REPLY */
|
||||
|
@ -98,8 +99,8 @@ extern "C" {
|
|||
EXTERN void uip_callbackinit(void);
|
||||
EXTERN FAR struct uip_callback_s *uip_callbackalloc(struct uip_callback_s **list);
|
||||
EXTERN void uip_callbackfree(FAR struct uip_callback_s *cb, struct uip_callback_s **list);
|
||||
EXTERN uint16 uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn,
|
||||
uint16 flags, FAR struct uip_callback_s *list);
|
||||
EXTERN uint16_t uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn,
|
||||
uint16_t flags, FAR struct uip_callback_s *list);
|
||||
|
||||
#ifdef CONFIG_NET_TCP
|
||||
/* Defined in uip_tcpconn.c *************************************************/
|
||||
|
@ -107,7 +108,7 @@ EXTERN uint16 uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn,
|
|||
EXTERN void uip_tcpinit(void);
|
||||
EXTERN struct uip_conn *uip_tcpactive(struct uip_tcpip_hdr *buf);
|
||||
EXTERN struct uip_conn *uip_nexttcpconn(struct uip_conn *conn);
|
||||
EXTERN struct uip_conn *uip_tcplistener(uint16 portno);
|
||||
EXTERN struct uip_conn *uip_tcplistener(uint16_t portno);
|
||||
EXTERN struct uip_conn *uip_tcpaccept(struct uip_tcpip_hdr *buf);
|
||||
EXTERN void uip_tcpnextsequence(void);
|
||||
|
||||
|
@ -122,23 +123,23 @@ EXTERN void uip_tcptimer(struct uip_driver_s *dev, struct uip_conn *conn, int hs
|
|||
/* Defined in uip_listen.c **************************************************/
|
||||
|
||||
EXTERN void uip_listeninit(void);
|
||||
EXTERN boolean uip_islistener(uint16 port);
|
||||
EXTERN int uip_accept(struct uip_driver_s *dev, struct uip_conn *conn, uint16 portno);
|
||||
EXTERN bool uip_islistener(uint16_t port);
|
||||
EXTERN int uip_accept(struct uip_driver_s *dev, struct uip_conn *conn, uint16_t portno);
|
||||
|
||||
/* Defined in uip_tcpsend.c *************************************************/
|
||||
|
||||
EXTERN void uip_tcpsend(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16 flags, uint16 len);
|
||||
uint16_t flags, uint16_t len);
|
||||
EXTERN void uip_tcpreset(struct uip_driver_s *dev);
|
||||
EXTERN void uip_tcpack(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint8 ack);
|
||||
uint8_t ack);
|
||||
|
||||
/* Defined in uip_tcpappsend.c **********************************************/
|
||||
|
||||
EXTERN void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16 result);
|
||||
uint16_t result);
|
||||
EXTERN void uip_tcprexmit(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16 result);
|
||||
uint16_t result);
|
||||
|
||||
/* Defined in uip_tcpinput.c ************************************************/
|
||||
|
||||
|
@ -146,8 +147,8 @@ EXTERN void uip_tcpinput(struct uip_driver_s *dev);
|
|||
|
||||
/* Defined in uip_tcpcallback.c *********************************************/
|
||||
|
||||
EXTERN uint16 uip_tcpcallback(struct uip_driver_s *dev,
|
||||
struct uip_conn *conn, uint16 flags);
|
||||
EXTERN uint16_t uip_tcpcallback(struct uip_driver_s *dev,
|
||||
struct uip_conn *conn, uint16_t flags);
|
||||
|
||||
/* Defined in uip_tcpreadahead.c ********************************************/
|
||||
|
||||
|
@ -181,7 +182,7 @@ EXTERN void uip_udpinput(struct uip_driver_s *dev);
|
|||
/* Defined in uip_udpcallback.c *********************************************/
|
||||
|
||||
EXTERN void uip_udpcallback(struct uip_driver_s *dev,
|
||||
struct uip_udp_conn *conn, uint16 flags);
|
||||
struct uip_udp_conn *conn, uint16_t flags);
|
||||
#endif /* CONFIG_NET_UDP */
|
||||
|
||||
#ifdef CONFIG_NET_ICMP
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -74,7 +75,7 @@ static struct uip_conn *uip_listenports[CONFIG_NET_MAX_LISTENPORTS];
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct uip_conn *uip_findlistener(uint16 portno)
|
||||
struct uip_conn *uip_findlistener(uint16_t portno)
|
||||
{
|
||||
int ndx;
|
||||
|
||||
|
@ -221,14 +222,14 @@ int uip_listen(struct uip_conn *conn)
|
|||
* Function: uip_islistener
|
||||
*
|
||||
* Description:
|
||||
* Return TRUE is there is a listener for the specified port
|
||||
* Return true is there is a listener for the specified port
|
||||
*
|
||||
* Assumptions:
|
||||
* Called at interrupt level
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
boolean uip_islistener(uint16 portno)
|
||||
bool uip_islistener(uint16_t portno)
|
||||
{
|
||||
return uip_findlistener(portno) != NULL;
|
||||
}
|
||||
|
@ -244,7 +245,8 @@ boolean uip_islistener(uint16 portno)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int uip_accept(struct uip_driver_s *dev, struct uip_conn *conn, uint16 portno)
|
||||
int uip_accept(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16_t portno)
|
||||
{
|
||||
struct uip_conn *listener;
|
||||
int ret = ERROR;
|
||||
|
|
|
@ -49,7 +49,7 @@ struct neighbor_entry
|
|||
{
|
||||
uip_ipaddr_t ipaddr;
|
||||
struct uip_neighbor_addr addr;
|
||||
uint8 time;
|
||||
uint8_t time;
|
||||
};
|
||||
static struct neighbor_entry entries[ENTRIES];
|
||||
|
||||
|
@ -78,8 +78,9 @@ void uip_neighbor_periodic(void)
|
|||
|
||||
void uip_neighbor_add(uip_ipaddr_t ipaddr, struct uip_neighbor_addr *addr)
|
||||
{
|
||||
int i, oldest;
|
||||
uint8 oldest_time;
|
||||
uint8_t oldest_time;
|
||||
int oldest;
|
||||
int i;
|
||||
|
||||
nlldbg("Add neighbor: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
addr->addr.ether_addr_octet[0], addr->addr.ether_addr_octet[1],
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
/* uip_neighbor.h
|
||||
/* net/uip/uip_neighbor.h
|
||||
* Header file for database of link-local neighbors, used by IPv6 code and
|
||||
* to be used by future ARP code.
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
* Copyright (c) 2006, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* A direct leverage of logic from uIP which also has b BSD style license
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
* Copyright (c) 2006, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -34,6 +39,7 @@
|
|||
#ifndef __UIP_NEIGHBOR_H__
|
||||
#define __UIP_NEIGHBOR_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <net/uip/uip.h>
|
||||
#include <net/ethernet.h>
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* net/uip/uip_setipid.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
*
|
||||
|
@ -41,7 +41,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#ifdef CONFIG_NET
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
|
@ -70,7 +70,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_setipid(uint16 id)
|
||||
void uip_setipid(uint16_t id)
|
||||
{
|
||||
g_ipid = id;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -92,7 +92,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 result)
|
||||
void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16_t result)
|
||||
{
|
||||
/* Handle the result based on the application response */
|
||||
|
||||
|
@ -200,7 +201,8 @@ void uip_tcpappsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 resu
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_tcprexmit(struct uip_driver_s *dev, struct uip_conn *conn, uint16 result)
|
||||
void uip_tcprexmit(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16_t result)
|
||||
{
|
||||
nllvdbg("result: %04x\n", result);
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@
|
|||
#include <net/uip/uipopt.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && defined(CONFIG_NET_TCPBACKLOG)
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <queue.h>
|
||||
#include <debug.h>
|
||||
|
@ -122,7 +122,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg)
|
|||
|
||||
/* Then add all of the pre-allocated containers to the free list */
|
||||
|
||||
blc = (FAR struct uip_blcontainer_s*)(((FAR ubyte*)bls) + offset);
|
||||
blc = (FAR struct uip_blcontainer_s*)(((FAR uint8_t*)bls) + offset);
|
||||
for (i = 0; i < nblg; i++)
|
||||
{
|
||||
sq_addfirst(&blc->bc_node, &bls->bl_free);
|
||||
|
@ -275,7 +275,7 @@ int uip_backlogadd(FAR struct uip_conn *conn, FAR struct uip_conn *blconn)
|
|||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
boolean uip_backlogavailable(FAR struct uip_conn *conn)
|
||||
bool uip_backlogavailable(FAR struct uip_conn *conn)
|
||||
{
|
||||
return (conn && conn->backlog && !sq_empty(&conn->backlog->bl_pending));
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -70,7 +70,8 @@
|
|||
****************************************************************************/
|
||||
|
||||
#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
|
||||
static int uip_readahead(struct uip_readahead_s *readahead, uint8 *buf, int len)
|
||||
static int uip_readahead(struct uip_readahead_s *readahead, uint8_t *buf,
|
||||
int len)
|
||||
{
|
||||
int available = CONFIG_NET_TCP_READAHEAD_BUFSIZE - readahead->rh_nbytes;
|
||||
int recvlen = 0;
|
||||
|
@ -111,10 +112,10 @@ static int uip_readahead(struct uip_readahead_s *readahead, uint8 *buf, int len)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint16
|
||||
uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags)
|
||||
static inline uint16_t
|
||||
uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16_t flags)
|
||||
{
|
||||
uint16 ret;
|
||||
uint16_t ret;
|
||||
|
||||
/* Assume that we will ACK the data. The data will be ACKed if it is
|
||||
* placed in the read-ahead buffer -OR- if it zero length
|
||||
|
@ -131,9 +132,9 @@ uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags)
|
|||
#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0
|
||||
struct uip_readahead_s *readahead1;
|
||||
struct uip_readahead_s *readahead2 = NULL;
|
||||
uint16 recvlen = 0;
|
||||
uint8 *buf = dev->d_appdata;
|
||||
int buflen = dev->d_len;
|
||||
uint16_t recvlen = 0;
|
||||
uint8_t *buf = dev->d_appdata;
|
||||
int buflen = dev->d_len;
|
||||
#endif
|
||||
|
||||
nllvdbg("No listener on connection\n");
|
||||
|
@ -223,7 +224,8 @@ uip_dataevent(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint16 uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags)
|
||||
uint16_t uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16_t flags)
|
||||
{
|
||||
/* Preserve the UIP_ACKDATA, UIP_CLOSE, and UIP_ABORT in the response.
|
||||
* These is needed by uIP to handle responses and buffer state. The
|
||||
|
@ -231,7 +233,7 @@ uint16 uip_tcpcallback(struct uip_driver_s *dev, struct uip_conn *conn, uint16 f
|
|||
* explicitly set in the callback.
|
||||
*/
|
||||
|
||||
uint16 ret = flags;
|
||||
uint16_t ret = flags;
|
||||
|
||||
nllvdbg("flags: %04x\n", flags);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
@ -82,11 +82,11 @@ static dq_queue_t g_active_tcp_connections;
|
|||
|
||||
/* Last port used by a TCP connection connection. */
|
||||
|
||||
static uint16 g_last_tcp_port;
|
||||
static uint16_t g_last_tcp_port;
|
||||
|
||||
/* g_tcp_sequence[] is used to generate TCP sequence numbers */
|
||||
|
||||
static uint8 g_tcp_sequence[4];
|
||||
static uint8_t g_tcp_sequence[4];
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -117,7 +117,7 @@ static uint8 g_tcp_sequence[4];
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static int uip_selectport(uint16 portno)
|
||||
static int uip_selectport(uint16_t portno)
|
||||
{
|
||||
if (portno == 0)
|
||||
{
|
||||
|
@ -418,7 +418,7 @@ struct uip_conn *uip_nexttcpconn(struct uip_conn *conn)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct uip_conn *uip_tcplistener(uint16 portno)
|
||||
struct uip_conn *uip_tcplistener(uint16_t portno)
|
||||
{
|
||||
struct uip_conn *conn;
|
||||
int i;
|
||||
|
@ -634,7 +634,7 @@ int uip_tcpconnect(struct uip_conn *conn, const struct sockaddr_in *addr)
|
|||
conn->rto = UIP_RTO;
|
||||
conn->sa = 0;
|
||||
conn->sv = 16; /* Initial value of the RTT variance. */
|
||||
conn->lport = htons((uint16)port);
|
||||
conn->lport = htons((uint16_t)port);
|
||||
|
||||
/* The sockaddr port is 16 bits and already in network order */
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BUF ((struct uip_tcpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
@ -98,12 +98,12 @@ void uip_tcpinput(struct uip_driver_s *dev)
|
|||
{
|
||||
struct uip_conn *conn = NULL;
|
||||
struct uip_tcpip_hdr *pbuf = BUF;
|
||||
uint16 tmp16;
|
||||
uint16 flags;
|
||||
uint8 opt;
|
||||
uint8 result;
|
||||
int len;
|
||||
int i;
|
||||
uint16_t tmp16;
|
||||
uint16_t flags;
|
||||
uint8_t opt;
|
||||
uint8_t result;
|
||||
int len;
|
||||
int i;
|
||||
|
||||
dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN];
|
||||
dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN];
|
||||
|
@ -220,8 +220,8 @@ void uip_tcpinput(struct uip_driver_s *dev)
|
|||
{
|
||||
/* An MSS option with the right option length. */
|
||||
|
||||
tmp16 = ((uint16)dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + i] << 8) |
|
||||
(uint16)dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + i];
|
||||
tmp16 = ((uint16_t)dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + i] << 8) |
|
||||
(uint16_t)dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + i];
|
||||
conn->initialmss = conn->mss =
|
||||
tmp16 > UIP_TCP_MSS? UIP_TCP_MSS: tmp16;
|
||||
|
||||
|
@ -330,7 +330,7 @@ found:
|
|||
{
|
||||
/* Temporary variables. */
|
||||
|
||||
uint8 acc32[4];
|
||||
uint8_t acc32[4];
|
||||
uip_add32(conn->snd_nxt, conn->len, acc32);
|
||||
|
||||
if (memcmp(pbuf->ackno, acc32, 4) == 0)
|
||||
|
@ -570,7 +570,7 @@ found:
|
|||
dev->d_urglen = 0;
|
||||
#else /* CONFIG_NET_TCPURGDATA */
|
||||
dev->d_appdata =
|
||||
((uint8*)dev->d_appdata) + ((pbuf->urgp[0] << 8) | pbuf->urgp[1]);
|
||||
((uint8_t*)dev->d_appdata) + ((pbuf->urgp[0] << 8) | pbuf->urgp[1]);
|
||||
dev->d_len -=
|
||||
(pbuf->urgp[0] << 8) | pbuf->urgp[1];
|
||||
#endif /* CONFIG_NET_TCPURGDATA */
|
||||
|
@ -602,7 +602,7 @@ found:
|
|||
* "persistent timer" and uses the retransmission mechanim.
|
||||
*/
|
||||
|
||||
tmp16 = ((uint16)pbuf->wnd[0] << 8) + (uint16)pbuf->wnd[1];
|
||||
tmp16 = ((uint16_t)pbuf->wnd[0] << 8) + (uint16_t)pbuf->wnd[1];
|
||||
if (tmp16 > conn->initialmss || tmp16 == 0)
|
||||
{
|
||||
tmp16 = conn->initialmss;
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -55,7 +55,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -94,7 +94,7 @@
|
|||
|
||||
void uip_tcppoll(struct uip_driver_s *dev, struct uip_conn *conn)
|
||||
{
|
||||
uint8 result;
|
||||
uint8_t result;
|
||||
|
||||
/* Verify that the connection is established */
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <net/uip/uipopt.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP) && (CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <queue.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BUF ((struct uip_tcpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
@ -232,7 +232,8 @@ static void uip_tcpsendcommon(struct uip_driver_s *dev, struct uip_conn *conn)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_tcpsend(struct uip_driver_s *dev, struct uip_conn *conn, uint16 flags, uint16 len)
|
||||
void uip_tcpsend(struct uip_driver_s *dev, struct uip_conn *conn,
|
||||
uint16_t flags, uint16_t len)
|
||||
{
|
||||
struct uip_tcpip_hdr *pbuf = BUF;
|
||||
|
||||
|
@ -263,8 +264,8 @@ void uip_tcpreset(struct uip_driver_s *dev)
|
|||
{
|
||||
struct uip_tcpip_hdr *pbuf = BUF;
|
||||
|
||||
uint16 tmp16;
|
||||
uint8 seqbyte;
|
||||
uint16_t tmp16;
|
||||
uint8_t seqbyte;
|
||||
|
||||
#ifdef CONFIG_NET_STATISTICS
|
||||
uip_stat.tcp.rst++;
|
||||
|
@ -343,7 +344,7 @@ void uip_tcpreset(struct uip_driver_s *dev)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void uip_tcpack(struct uip_driver_s *dev, struct uip_conn *conn, uint8 ack)
|
||||
void uip_tcpack(struct uip_driver_s *dev, struct uip_conn *conn, uint8_t ack)
|
||||
{
|
||||
struct uip_tcpip_hdr *pbuf = BUF;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_TCP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -55,7 +55,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -95,7 +95,7 @@
|
|||
|
||||
void uip_tcptimer(struct uip_driver_s *dev, struct uip_conn *conn, int hsec)
|
||||
{
|
||||
uint8 result;
|
||||
uint8_t result;
|
||||
|
||||
dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN];
|
||||
dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN];
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_UDP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -73,7 +73,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
void uip_udpcallback(struct uip_driver_s *dev, struct uip_udp_conn *conn,
|
||||
uint16 flags)
|
||||
uint16_t flags)
|
||||
{
|
||||
nllvdbg("flags: %04x\n", flags);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_UDP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <semaphore.h>
|
||||
#include <assert.h>
|
||||
|
@ -81,7 +81,7 @@ static dq_queue_t g_active_udp_connections;
|
|||
|
||||
/* Last port used by a UDP connection connection. */
|
||||
|
||||
static uint16 g_last_udp_port;
|
||||
static uint16_t g_last_udp_port;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
@ -120,7 +120,7 @@ static inline void _uip_semtake(sem_t *sem)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static struct uip_udp_conn *uip_find_conn(uint16 portno)
|
||||
static struct uip_udp_conn *uip_find_conn(uint16_t portno)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -157,9 +157,9 @@ static struct uip_udp_conn *uip_find_conn(uint16 portno)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static uint16 uip_selectport(void)
|
||||
static uint16_t uip_selectport(void)
|
||||
{
|
||||
uint16 portno;
|
||||
uint16_t portno;
|
||||
|
||||
/* Find an unused local port number. Loop until we find a valid
|
||||
* listen port number that is not being used by any other connection.
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_UDP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -55,7 +54,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define UDPBUF ((struct uip_udpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* net/uip/uip_udppoll.c
|
||||
* Poll for the availability of UDP TX data
|
||||
*
|
||||
* 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>
|
||||
*
|
||||
* Adapted for NuttX from logic in uIP which also has a BSD-like license:
|
||||
|
@ -45,7 +45,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_UDP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -55,7 +54,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include <nuttx/config.h>
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_UDP)
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uipopt.h>
|
||||
|
@ -54,7 +53,7 @@
|
|||
#include "uip_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define UDPBUF ((struct uip_udpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
|
||||
|
|
Loading…
Reference in a new issue