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@2346 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
b0e87ce2fe
commit
05d9fdd61e
@ -43,6 +43,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
@ -71,12 +72,12 @@ struct tcp_connect_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static void connection_event(struct uip_conn *conn, uint16 flags);
|
static void connection_event(struct uip_conn *conn, uint16_t flags);
|
||||||
static inline int tcp_setup_callbacks(FAR struct socket *psock,
|
static inline int tcp_setup_callbacks(FAR struct socket *psock,
|
||||||
FAR struct tcp_connect_s *pstate);
|
FAR struct tcp_connect_s *pstate);
|
||||||
static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int status);
|
static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int status);
|
||||||
static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16_t tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvpriv, uint16 flags);
|
void *pvpriv, uint16_t flags);
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in6 *inaddr);
|
static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in6 *inaddr);
|
||||||
#else
|
#else
|
||||||
@ -107,7 +108,7 @@ static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static void connection_event(struct uip_conn *conn, uint16 flags)
|
static void connection_event(struct uip_conn *conn, uint16_t flags)
|
||||||
{
|
{
|
||||||
FAR struct socket *psock = (FAR struct socket *)conn->connection_private;
|
FAR struct socket *psock = (FAR struct socket *)conn->connection_private;
|
||||||
|
|
||||||
@ -222,8 +223,8 @@ static inline void tcp_teardown_callbacks(struct tcp_connect_s *pstate, int stat
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16 tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16_t tcp_connect_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvpriv, uint16 flags)
|
void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvpriv;
|
struct tcp_connect_s *pstate = (struct tcp_connect_s *)pvpriv;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/getsockopt.c
|
* net/getsockopt.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/net_arptimer.c
|
* net/net_arptimer.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,6 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <wdog.h>
|
#include <wdog.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
@ -49,7 +50,7 @@
|
|||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* ARP timer interval = 10 seconds. CLK_TCK is the number of clock ticks
|
/* ARP timer interval = 10 seconds. CLK_TCK is the number of clock ticks
|
||||||
@ -85,7 +86,7 @@ static WDOG_ID g_arptimer; /* ARP timer */
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void arptimer_poll(int argc, uint32 arg, ...)
|
static void arptimer_poll(int argc, uint32_t arg, ...)
|
||||||
{
|
{
|
||||||
/* Call the ARP timer function every 10 seconds. */
|
/* Call the ARP timer function every 10 seconds. */
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
@ -87,8 +87,8 @@ struct tcp_close_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16 netclose_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16_t netclose_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvpriv, uint16 flags)
|
void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct tcp_close_s *pstate = (struct tcp_close_s *)pvpriv;
|
struct tcp_close_s *pstate = (struct tcp_close_s *)pvpriv;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/net_dsec2timeval.c
|
* net/net_dsec2timeval.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,8 +40,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
|
|
||||||
@ -69,9 +69,9 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void net_dsec2timeval(uint16 dsec, struct timeval *tv)
|
void net_dsec2timeval(uint16_t dsec, struct timeval *tv)
|
||||||
{
|
{
|
||||||
uint16 remainder;
|
uint16_t remainder;
|
||||||
tv->tv_sec = dsec / DSEC_PER_SEC;
|
tv->tv_sec = dsec / DSEC_PER_SEC;
|
||||||
remainder = dsec - tv->tv_sec * DSEC_PER_SEC;
|
remainder = dsec - tv->tv_sec * DSEC_PER_SEC;
|
||||||
tv->tv_usec = remainder * USEC_PER_DSEC;
|
tv->tv_usec = remainder * USEC_PER_DSEC;
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -43,7 +43,10 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <nuttx/net.h>
|
#include <nuttx/net.h>
|
||||||
#include <net/uip/uip.h>
|
#include <net/uip/uip.h>
|
||||||
|
|
||||||
@ -159,9 +162,9 @@ EXTERN int net_closesocket(FAR struct socket *psock);
|
|||||||
/* sockopt support ***********************************************************/
|
/* sockopt support ***********************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
EXTERN int net_timeo(uint32 start_time, socktimeo_t timeo);
|
EXTERN int net_timeo(uint32_t start_time, socktimeo_t timeo);
|
||||||
EXTERN socktimeo_t net_timeval2dsec(struct timeval *tv);
|
EXTERN socktimeo_t net_timeval2dsec(struct timeval *tv);
|
||||||
EXTERN void net_dsec2timeval(uint16 dsec, struct timeval *tv);
|
EXTERN void net_dsec2timeval(uint16_t dsec, struct timeval *tv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* net_register.c ************************************************************/
|
/* net_register.c ************************************************************/
|
||||||
|
@ -40,9 +40,9 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && !defined(CONFIG_DISABLE_POLL)
|
#if defined(CONFIG_NET) && !defined(CONFIG_DISABLE_POLL)
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -101,8 +101,8 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef HAVE_NETPOLL
|
#ifdef HAVE_NETPOLL
|
||||||
static uint16 poll_interrupt(struct uip_driver_s *dev, FAR void *conn,
|
static uint16_t poll_interrupt(struct uip_driver_s *dev, FAR void *conn,
|
||||||
FAR void *pvpriv, uint16 flags)
|
FAR void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
FAR struct pollfd *fds = (FAR struct pollfd *)pvpriv;
|
FAR struct pollfd *fds = (FAR struct pollfd *)pvpriv;
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds)
|
|||||||
* fd - The socket descriptor of interest
|
* fd - The socket descriptor of interest
|
||||||
* fds - The structure describing the events to be monitored, OR NULL if
|
* fds - The structure describing the events to be monitored, OR NULL if
|
||||||
* this is a request to stop monitoring events.
|
* this is a request to stop monitoring events.
|
||||||
* setup - TRUE: Setup up the poll; FALSE: Teardown the poll
|
* setup - true: Setup up the poll; false: Teardown the poll
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* 0: Success; Negated errno on failure
|
* 0: Success; Negated errno on failure
|
||||||
@ -301,7 +301,7 @@ static inline int net_pollteardown(FAR struct socket *psock, struct pollfd *fds)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_POLL
|
#ifndef CONFIG_DISABLE_POLL
|
||||||
int net_poll(int sockfd, struct pollfd *fds, boolean setup)
|
int net_poll(int sockfd, struct pollfd *fds, bool setup)
|
||||||
{
|
{
|
||||||
#ifndef HAVE_NETPOLL
|
#ifndef HAVE_NETPOLL
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net_sockets.c
|
* net/net_sockets.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007- 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/net_timeo.c
|
* net/net_timeo.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,7 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <stdint.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
@ -69,10 +69,10 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int net_timeo(uint32 start_time, socktimeo_t timeo)
|
int net_timeo(uint32_t start_time, socktimeo_t timeo)
|
||||||
{
|
{
|
||||||
uint32 timeo_ticks = DSEC2TICK(timeo);
|
uint32_t timeo_ticks = DSEC2TICK(timeo);
|
||||||
uint32 elapsed = g_system_timer - start_time;
|
uint32_t elapsed = g_system_timer - start_time;
|
||||||
|
|
||||||
if (elapsed >= timeo_ticks)
|
if (elapsed >= timeo_ticks)
|
||||||
{
|
{
|
||||||
|
@ -40,8 +40,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <nuttx/clock.h>
|
#include <nuttx/clock.h>
|
||||||
|
|
||||||
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
socktimeo_t net_timeval2dsec(struct timeval *tv)
|
socktimeo_t net_timeval2dsec(struct timeval *tv)
|
||||||
{
|
{
|
||||||
return (uint16)(tv->tv_sec* DSEC_PER_SEC + tv->tv_usec / USEC_PER_DSEC);
|
return (uint16_t)(tv->tv_sec* DSEC_PER_SEC + tv->tv_usec / USEC_PER_DSEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NET && CONFIG_NET_SOCKOPTS && !CONFIG_DISABLE_CLOCK */
|
#endif /* CONFIG_NET && CONFIG_NET_SOCKOPTS && !CONFIG_DISABLE_CLOCK */
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
|
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/netdev_count.c
|
* net/netdev_count.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -49,7 +48,7 @@
|
|||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -73,9 +73,9 @@
|
|||||||
* Function: netdev_maskcmp
|
* Function: netdev_maskcmp
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline boolean netdev_maskcmp(const uip_ipaddr_t *ipaddr,
|
static inline bool netdev_maskcmp(const uip_ipaddr_t *ipaddr,
|
||||||
const uip_ipaddr_t *raddr,
|
const uip_ipaddr_t *raddr,
|
||||||
const uip_ipaddr_t *netmask)
|
const uip_ipaddr_t *netmask)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_NET_IPv6
|
#ifndef CONFIG_NET_IPv6
|
||||||
return (*ipaddr & *netmask) == (*raddr & *netmask);
|
return (*ipaddr & *netmask) == (*raddr & *netmask);
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
@ -49,7 +48,7 @@
|
|||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/netdev_foreach.c
|
* net/netdev_foreach.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <nuttx/net.h>
|
#include <nuttx/net.h>
|
||||||
#include <net/uip/uip-arch.h>
|
#include <net/uip/uip-arch.h>
|
||||||
@ -48,7 +47,7 @@
|
|||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/netdev_ioctl.c
|
* net/netdev_ioctl.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
@ -58,7 +57,7 @@
|
|||||||
#include "net_internal.h"
|
#include "net_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/netdev_register.c
|
* net/netdev_register.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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
@ -72,7 +72,7 @@ struct recvfrom_s
|
|||||||
{
|
{
|
||||||
FAR struct socket *rf_sock; /* The parent socket structure */
|
FAR struct socket *rf_sock; /* The parent socket structure */
|
||||||
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
uint32 rf_starttime; /* rcv start time for determining timeout */
|
uint32_t rf_starttime; /* rcv start time for determining timeout */
|
||||||
#endif
|
#endif
|
||||||
FAR struct uip_callback_s *rf_cb; /* Reference to callback instance */
|
FAR struct uip_callback_s *rf_cb; /* Reference to callback instance */
|
||||||
sem_t rf_sem; /* Semaphore signals recv completion */
|
sem_t rf_sem; /* Semaphore signals recv completion */
|
||||||
@ -358,8 +358,8 @@ static inline void recvfrom_tcpsender(struct uip_driver_s *dev, struct recvfrom_
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP
|
#ifdef CONFIG_NET_TCP
|
||||||
static uint16 recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
static uint16_t recvfrom_tcpinterrupt(struct uip_driver_s *dev, void *conn,
|
||||||
void *pvpriv, uint16 flags)
|
void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
||||||
|
|
||||||
@ -541,8 +541,8 @@ static inline void recvfrom_udpsender(struct uip_driver_s *dev, struct recvfrom_
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_UDP
|
#ifdef CONFIG_NET_UDP
|
||||||
static uint16 recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16_t recvfrom_udpinterrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvpriv, uint16 flags)
|
void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
struct recvfrom_s *pstate = (struct recvfrom_s *)pvpriv;
|
||||||
|
|
||||||
|
24
net/send.c
24
net/send.c
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
@ -73,13 +73,13 @@ struct send_s
|
|||||||
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
FAR struct socket *snd_sock; /* Points to the parent socket structure */
|
||||||
FAR struct uip_callback_s *snd_cb; /* Reference to callback instance */
|
FAR struct uip_callback_s *snd_cb; /* Reference to callback instance */
|
||||||
sem_t snd_sem; /* Used to wake up the waiting thread */
|
sem_t snd_sem; /* Used to wake up the waiting thread */
|
||||||
FAR const uint8 *snd_buffer; /* Points to the buffer of data to send */
|
FAR const uint8_t *snd_buffer; /* Points to the buffer of data to send */
|
||||||
size_t snd_buflen; /* Number of bytes in the buffer to send */
|
size_t snd_buflen; /* Number of bytes in the buffer to send */
|
||||||
ssize_t snd_sent; /* The number of bytes sent */
|
ssize_t snd_sent; /* The number of bytes sent */
|
||||||
uint32 snd_isn; /* Initial sequence number */
|
uint32_t snd_isn; /* Initial sequence number */
|
||||||
uint32 snd_acked; /* The number of bytes acked */
|
uint32_t snd_acked; /* The number of bytes acked */
|
||||||
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
#if defined(CONFIG_NET_SOCKOPTS) && !defined(CONFIG_DISABLE_CLOCK)
|
||||||
uint32 snd_time; /* last send time for determining timeout */
|
uint32_t snd_time; /* last send time for determining timeout */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -104,9 +104,9 @@ struct send_s
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint32 send_getisn(struct uip_conn *conn)
|
static uint32_t send_getisn(struct uip_conn *conn)
|
||||||
{
|
{
|
||||||
uint32 tmp;
|
uint32_t tmp;
|
||||||
memcpy(&tmp, conn->snd_nxt, 4);
|
memcpy(&tmp, conn->snd_nxt, 4);
|
||||||
return ntohl(tmp);
|
return ntohl(tmp);
|
||||||
}
|
}
|
||||||
@ -128,9 +128,9 @@ static uint32 send_getisn(struct uip_conn *conn)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint32 send_getackno(struct uip_driver_s *dev)
|
static uint32_t send_getackno(struct uip_driver_s *dev)
|
||||||
{
|
{
|
||||||
uint32 tmp;
|
uint32_t tmp;
|
||||||
memcpy(&tmp, TCPBUF->ackno, 4);
|
memcpy(&tmp, TCPBUF->ackno, 4);
|
||||||
return ntohl(tmp);
|
return ntohl(tmp);
|
||||||
}
|
}
|
||||||
@ -195,8 +195,8 @@ static inline int send_timeout(struct send_s *pstate)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn,
|
static uint16_t send_interrupt(struct uip_driver_s *dev, void *pvconn,
|
||||||
void *pvpriv, uint16 flags)
|
void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct uip_conn *conn = (struct uip_conn*)pvconn;
|
struct uip_conn *conn = (struct uip_conn*)pvconn;
|
||||||
struct send_s *pstate = (struct send_s *)pvpriv;
|
struct send_s *pstate = (struct send_s *)pvpriv;
|
||||||
@ -283,7 +283,7 @@ static uint16 send_interrupt(struct uip_driver_s *dev, void *pvconn,
|
|||||||
{
|
{
|
||||||
/* Get the amount of data that we can send in the next packet */
|
/* Get the amount of data that we can send in the next packet */
|
||||||
|
|
||||||
uint32 sndlen = pstate->snd_buflen - pstate->snd_sent;
|
uint32_t sndlen = pstate->snd_buflen - pstate->snd_sent;
|
||||||
if (sndlen > uip_mss(conn))
|
if (sndlen > uip_mss(conn))
|
||||||
{
|
{
|
||||||
sndlen = uip_mss(conn);
|
sndlen = uip_mss(conn);
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
@ -63,7 +64,7 @@ struct sendto_s
|
|||||||
{
|
{
|
||||||
FAR struct uip_callback_s *st_cb; /* Reference to callback instance */
|
FAR struct uip_callback_s *st_cb; /* Reference to callback instance */
|
||||||
sem_t st_sem; /* Semaphore signals sendto completion */
|
sem_t st_sem; /* Semaphore signals sendto completion */
|
||||||
uint16 st_buflen; /* Length of send buffer (error if <0) */
|
uint16_t st_buflen; /* Length of send buffer (error if <0) */
|
||||||
const char *st_buffer; /* Pointer to send buffer */
|
const char *st_buffer; /* Pointer to send buffer */
|
||||||
int st_sndlen; /* Result of the send (length sent or negated errno) */
|
int st_sndlen; /* Result of the send (length sent or negated errno) */
|
||||||
};
|
};
|
||||||
@ -94,7 +95,8 @@ struct sendto_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_UDP
|
#ifdef CONFIG_NET_UDP
|
||||||
static uint16 sendto_interrupt(struct uip_driver_s *dev, void *conn, void *pvpriv, uint16 flags)
|
static uint16_t sendto_interrupt(struct uip_driver_s *dev, void *conn,
|
||||||
|
void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct sendto_s *pstate = (struct sendto_s *)pvpriv;
|
struct sendto_s *pstate = (struct sendto_s *)pvpriv;
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#ifdef CONFIG_NET
|
#ifdef CONFIG_NET
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user