networking: Move a little more to the inet/ subdirectory.
This commit is contained in:
parent
2ada7d5892
commit
835ae2999d
@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# net/devif/Make.defs
|
# net/inet/Make.defs
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007, 2009-2010, 2014-2015 Gregory Nutt. All rights reserved.
|
# Copyright (C) 2007, 2009-2010, 2014-2015, 2017 Gregory Nutt. All rights reserved.
|
||||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -35,8 +35,7 @@
|
|||||||
|
|
||||||
# Network device interface source files
|
# Network device interface source files
|
||||||
|
|
||||||
NET_CSRCS += devif_initialize.c net_setipid.c devif_send.c devif_poll.c
|
NET_CSRCS += devif_initialize.c devif_send.c devif_poll.c devif_callback.c
|
||||||
NET_CSRCS += devif_callback.c
|
|
||||||
|
|
||||||
# Device driver IP packet receipt interfaces
|
# Device driver IP packet receipt interfaces
|
||||||
|
|
||||||
|
@ -274,25 +274,9 @@ struct devif_callback_s
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* Increasing number used for the IP ID field. */
|
|
||||||
|
|
||||||
extern uint16_t g_ipid;
|
#undef EXTERN
|
||||||
|
#if defined(__cplusplus)
|
||||||
#if defined(CONFIG_NET_TCP_REASSEMBLY) && !defined(CONFIG_NET_IPv6)
|
|
||||||
/* Reassembly timer (units: deci-seconds) */
|
|
||||||
|
|
||||||
extern uint8_t g_reassembly_timer;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Time of last poll */
|
|
||||||
|
|
||||||
extern systime_t g_polltime;
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Function Prototypes
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define EXTERN extern "C"
|
#define EXTERN extern "C"
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@ -300,6 +284,20 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_TCP_REASSEMBLY)
|
||||||
|
/* Reassembly timer (units: deci-seconds) */
|
||||||
|
|
||||||
|
EXTERN uint8_t g_reassembly_timer;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Time of last poll */
|
||||||
|
|
||||||
|
EXTERN systime_t g_polltime;
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: devif_initialize
|
* Name: devif_initialize
|
||||||
*
|
*
|
||||||
|
@ -65,9 +65,6 @@
|
|||||||
struct net_stats_s g_netstats;
|
struct net_stats_s g_netstats;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Increasing number used for the IP ID field. */
|
|
||||||
|
|
||||||
uint16_t g_ipid;
|
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_TCP_REASSEMBLY)
|
#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_TCP_REASSEMBLY)
|
||||||
/* Reassembly timer (units: deci-seconds) */
|
/* Reassembly timer (units: deci-seconds) */
|
||||||
|
@ -93,6 +93,7 @@
|
|||||||
#include <nuttx/net/netstats.h>
|
#include <nuttx/net/netstats.h>
|
||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
|
|
||||||
|
#include "inet/inet.h"
|
||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
#include "pkt/pkt.h"
|
#include "pkt/pkt.h"
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
|
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
#include "inet/inet.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include "icmp/icmp.h"
|
#include "icmp/icmp.h"
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
#include <nuttx/net/igmp.h>
|
#include <nuttx/net/igmp.h>
|
||||||
|
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
#include "inet/inet.h"
|
||||||
#include "igmp/igmp.h"
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
|
@ -37,16 +37,18 @@
|
|||||||
|
|
||||||
ifeq ($(CONFIG_NET_IPv4),y)
|
ifeq ($(CONFIG_NET_IPv4),y)
|
||||||
SOCK_CSRCS += inet_sockif.c inet_recvfrom.c inet_connect.c inet_close.c
|
SOCK_CSRCS += inet_sockif.c inet_recvfrom.c inet_connect.c inet_close.c
|
||||||
|
SOCK_CSRCS += inet_globals.c
|
||||||
else ifeq ($(CONFIG_NET_IPv6),y)
|
else ifeq ($(CONFIG_NET_IPv6),y)
|
||||||
SOCK_CSRCS += inet_sockif.c inet_recvfrom.c inet_connect.c inet_close.c
|
SOCK_CSRCS += inet_sockif.c inet_recvfrom.c inet_connect.c inet_close.c
|
||||||
|
SOCK_CSRCS += inet_globals.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET_IPv4),y)
|
ifeq ($(CONFIG_NET_IPv4),y)
|
||||||
SOCK_CSRCS += ipv4_getsockname.c
|
SOCK_CSRCS += ipv4_getsockname.c inet_setipid.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET_IPv6),y)
|
ifeq ($(CONFIG_NET_IPv6),y)
|
||||||
SOCK_CSRCS += ipv6_getsockname.c inet_globals.c
|
SOCK_CSRCS += ipv6_getsockname.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NET_SENDFILE),y)
|
ifeq ($(CONFIG_NET_SENDFILE),y)
|
||||||
|
@ -82,7 +82,13 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Well-known IP addresses */
|
#ifdef CONFIG_NET_IPv4
|
||||||
|
/* Increasing number used for the IP ID field. */
|
||||||
|
|
||||||
|
EXTERN uint16_t g_ipid;
|
||||||
|
#endif /* CONFIG_NET_IPv4 */
|
||||||
|
|
||||||
|
/* Well-known IPv6 addresses */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IPv6
|
#ifdef CONFIG_NET_IPv6
|
||||||
EXTERN const net_ipv6addr_t g_ipv6_allzeroaddr; /* An address of all zeroes */
|
EXTERN const net_ipv6addr_t g_ipv6_allzeroaddr; /* An address of all zeroes */
|
||||||
@ -93,7 +99,7 @@ EXTERN const net_ipv6addr_t g_ipv6_allrouters; /* All link local routers */
|
|||||||
EXTERN const net_ipv6addr_t g_ipv6_llnetmask; /* Netmask for local link address */
|
EXTERN const net_ipv6addr_t g_ipv6_llnetmask; /* Netmask for local link address */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif /* CONFIG_NET_IPv6 */
|
||||||
|
|
||||||
/* PF_INET/PF_INET6 socket address family interface */
|
/* PF_INET/PF_INET6 socket address family interface */
|
||||||
|
|
||||||
@ -110,6 +116,18 @@ struct tcp_conn_s; /* Forward reference */
|
|||||||
#endif
|
#endif
|
||||||
struct socket; /* Forward reference */
|
struct socket; /* Forward reference */
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: inet_setipid
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* This function may be used at boot time to set the initial ip_id.
|
||||||
|
*
|
||||||
|
* Assumptions:
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void inet_setipid(uint16_t id);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: net_startmonitor
|
* Name: net_startmonitor
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/devif/net_setipid.c
|
* net/inet/net_setipid.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007, 2009, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -43,22 +43,14 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include "devif/devif.h"
|
#include "inet/inet.h"
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Data
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Private Functions
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: net_setipid
|
* Name: inet_setipid
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function may be used at boot time to set the initial ip_id.
|
* This function may be used at boot time to set the initial ip_id.
|
||||||
@ -67,7 +59,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void net_setipid(uint16_t id)
|
void inet_setipid(uint16_t id)
|
||||||
{
|
{
|
||||||
g_ipid = id;
|
g_ipid = id;
|
||||||
}
|
}
|
@ -55,6 +55,7 @@
|
|||||||
#include <nuttx/net/tcp.h>
|
#include <nuttx/net/tcp.h>
|
||||||
|
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
#include "inet/inet.h"
|
||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
|
|
||||||
|
@ -378,11 +378,11 @@ static inline FAR struct udp_conn_s *
|
|||||||
* If all of the above are true then the newly received UDP packet
|
* If all of the above are true then the newly received UDP packet
|
||||||
* is destined for this UDP connection.
|
* is destined for this UDP connection.
|
||||||
*
|
*
|
||||||
* To send and receive broadcast packets, the application should:
|
* To send and receive multicast packets, the application should:
|
||||||
*
|
*
|
||||||
* - Bind socket to INADDR6_ANY
|
* - Bind socket to INADDR6_ANY or to a specific <multicast-address>
|
||||||
* - setsockopt to SO_BROADCAST
|
* - setsockopt to SO_BROADCAST (for all-nodes address)
|
||||||
* - call sendto with sendaddr.sin_addr.s_addr = <broadcast-address>
|
* - call sendto with sendaddr.sin_addr.s_addr = <multicast-address>
|
||||||
* - call recvfrom.
|
* - call recvfrom.
|
||||||
*
|
*
|
||||||
* REVIST: SO_BROADCAST flag is currently ignored.
|
* REVIST: SO_BROADCAST flag is currently ignored.
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
#include <nuttx/net/udp.h>
|
#include <nuttx/net/udp.h>
|
||||||
|
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
#include "inet/inet.h"
|
||||||
#include "utils/utils.h"
|
#include "utils/utils.h"
|
||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user