IP forwaring: Rename some files to get closer to other naming conventions.
This commit is contained in:
parent
7258f1cbfc
commit
803235ad4b
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
#include "icmp/icmp.h"
|
#include "icmp/icmp.h"
|
||||||
#include "igmp/igmp.h"
|
#include "igmp/igmp.h"
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
#include "icmpv6/icmpv6.h"
|
#include "icmpv6/icmpv6.h"
|
||||||
|
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
#include <nuttx/net/netstats.h>
|
#include <nuttx/net/netstats.h>
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
@ -246,7 +246,7 @@ static uint16_t icmp_forward_interrupt(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
/* And release the forwarding state structure */
|
/* And release the forwarding state structure */
|
||||||
|
|
||||||
ip_forward_free(fwd);
|
ipfwd_free(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
#include <nuttx/net/netstats.h>
|
#include <nuttx/net/netstats.h>
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
@ -242,7 +242,7 @@ static uint16_t icmpv6_forward_interrupt(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
/* And release the forwarding state structure */
|
/* And release the forwarding state structure */
|
||||||
|
|
||||||
ip_forward_free(fwd);
|
ipfwd_free(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
|
@ -46,7 +46,7 @@ NET_CSRCS += ipv6_forward.c
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_NETDEV_MULTINIC),y)
|
ifeq ($(CONFIG_NETDEV_MULTINIC),y)
|
||||||
NET_CSRCS += ip_forward.c
|
NET_CSRCS += ipfwd_alloc.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Include IP forwaring build support
|
# Include IP forwaring build support
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/ipforward/ip_forward.h
|
* net/ipforward/ipforward.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@ -33,8 +33,8 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __NET_IPFORWARD_IP_FORWARD_H
|
#ifndef __NET_IPFORWARD_IPFORWARD_H
|
||||||
#define __NET_IPFORWARD_IP_FORWARD_H
|
#define __NET_IPFORWARD_IPFORWARD_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
@ -173,7 +173,7 @@ struct forward_s
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ip_forward_initialize
|
* Name: ipfwd_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize the struct forward_s allocator.
|
* Initialize the struct forward_s allocator.
|
||||||
@ -183,10 +183,10 @@ struct forward_s
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void ip_forward_initialize(void);
|
void ipfwd_initialize(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ip_forward_alloc
|
* Name: ipfwd_alloc
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate a forwarding structure by removing a pre-allocated entry from
|
* Allocate a forwarding structure by removing a pre-allocated entry from
|
||||||
@ -198,10 +198,10 @@ void ip_forward_initialize(void);
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct forward_s *ip_forward_alloc(void);
|
FAR struct forward_s *ipfwd_alloc(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ip_forward_free
|
* Name: ipfwd_free
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Free a forwarding structure by adding it to a free list.
|
* Free a forwarding structure by adding it to a free list.
|
||||||
@ -212,7 +212,7 @@ FAR struct forward_s *ip_forward_alloc(void);
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void ip_forward_free(FAR struct forward_s *fwd);
|
void ipfwd_free(FAR struct forward_s *fwd);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ipv4_forward_broadcast
|
* Name: ipv4_forward_broadcast
|
||||||
@ -359,4 +359,4 @@ int ipv6_forward(FAR struct net_driver_s *dev, FAR struct ipv6_hdr_s *ipv6);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_NET_IPFORWARD */
|
#endif /* CONFIG_NET_IPFORWARD */
|
||||||
#endif /* __NET_IPFORWARD_IP_FORWARD_H */
|
#endif /* __NET_IPFORWARD_IPFORWARD_H */
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* net/ipforward/ip_forward.c
|
* net/ipforward/ipfwd_alloc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NETDEV_MULTINIC)
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ static FAR struct forward_s *g_fwdfree;
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ip_forward_initialize
|
* Name: ipfwd_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize the struct forward_s allocator.
|
* Initialize the struct forward_s allocator.
|
||||||
@ -75,7 +75,7 @@ static FAR struct forward_s *g_fwdfree;
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void ip_forward_initialize(void)
|
void ipfwd_initialize(void)
|
||||||
{
|
{
|
||||||
FAR struct forward_s *fwd;
|
FAR struct forward_s *fwd;
|
||||||
int i;
|
int i;
|
||||||
@ -99,7 +99,7 @@ void ip_forward_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ip_forward_alloc
|
* Name: ipfwd_alloc
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allocate a forwarding structure by removing a pre-allocated entry from
|
* Allocate a forwarding structure by removing a pre-allocated entry from
|
||||||
@ -111,7 +111,7 @@ void ip_forward_initialize(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR struct forward_s *ip_forward_alloc(void)
|
FAR struct forward_s *ipfwd_alloc(void)
|
||||||
{
|
{
|
||||||
FAR struct forward_s *fwd;
|
FAR struct forward_s *fwd;
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ FAR struct forward_s *ip_forward_alloc(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ip_forward_free
|
* Name: ipfwd_free
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Free a forwarding structure by adding it to a free list.
|
* Free a forwarding structure by adding it to a free list.
|
||||||
@ -137,7 +137,7 @@ FAR struct forward_s *ip_forward_alloc(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void ip_forward_free(FAR struct forward_s *fwd)
|
void ipfwd_free(FAR struct forward_s *fwd)
|
||||||
{
|
{
|
||||||
fwd->f_flink = g_fwdfree;
|
fwd->f_flink = g_fwdfree;
|
||||||
g_fwdfree = fwd;
|
g_fwdfree = fwd;
|
@ -54,7 +54,7 @@
|
|||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "icmp/icmp.h"
|
#include "icmp/icmp.h"
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv4)
|
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv4)
|
||||||
@ -287,7 +287,7 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev,
|
|||||||
* completely zeroed when we receive it.
|
* completely zeroed when we receive it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fwd = ip_forward_alloc();
|
fwd = ipfwd_alloc();
|
||||||
if (fwd == NULL)
|
if (fwd == NULL)
|
||||||
{
|
{
|
||||||
nwarn("WARNING: Failed to allocate forwarding structure\n");
|
nwarn("WARNING: Failed to allocate forwarding structure\n");
|
||||||
@ -426,7 +426,7 @@ errout_with_iobchain:
|
|||||||
errout_with_fwd:
|
errout_with_fwd:
|
||||||
if (fwd != NULL)
|
if (fwd != NULL)
|
||||||
{
|
{
|
||||||
ip_forward_free(fwd);
|
ipfwd_free(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
#include "udp/udp.h"
|
#include "udp/udp.h"
|
||||||
#include "tcp/tcp.h"
|
#include "tcp/tcp.h"
|
||||||
#include "icmpv6/icmpv6.h"
|
#include "icmpv6/icmpv6.h"
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
|
|
||||||
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6)
|
#if defined(CONFIG_NET_IPFORWARD) && defined(CONFIG_NET_IPv6)
|
||||||
@ -398,7 +398,7 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev,
|
|||||||
* completely zeroed when we receive it.
|
* completely zeroed when we receive it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fwd = ip_forward_alloc();
|
fwd = ipfwd_alloc();
|
||||||
if (fwd == NULL)
|
if (fwd == NULL)
|
||||||
{
|
{
|
||||||
nwarn("WARNING: Failed to allocate forwarding structure\n");
|
nwarn("WARNING: Failed to allocate forwarding structure\n");
|
||||||
@ -538,7 +538,7 @@ errout_with_iobchain:
|
|||||||
errout_with_fwd:
|
errout_with_fwd:
|
||||||
if (fwd != NULL)
|
if (fwd != NULL)
|
||||||
{
|
{
|
||||||
ip_forward_free(fwd);
|
ipfwd_free(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include "socket/socket.h"
|
#include "socket/socket.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
#include "sixlowpan/sixlowpan.h"
|
#include "sixlowpan/sixlowpan.h"
|
||||||
#include "neighbor/neighbor.h"
|
#include "neighbor/neighbor.h"
|
||||||
@ -116,7 +116,7 @@ void net_setup(void)
|
|||||||
#ifdef HAVE_FWDALLOC
|
#ifdef HAVE_FWDALLOC
|
||||||
/* Initialize IP forwarding support */
|
/* Initialize IP forwarding support */
|
||||||
|
|
||||||
ip_forward_initialize();
|
ipfwd_initialize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NET_PKT
|
#ifdef CONFIG_NET_PKT
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
#include <nuttx/net/netstats.h>
|
#include <nuttx/net/netstats.h>
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
@ -340,7 +340,7 @@ static uint16_t tcp_forward_interrupt(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
/* And release the forwarding state structure */
|
/* And release the forwarding state structure */
|
||||||
|
|
||||||
ip_forward_free(fwd);
|
ipfwd_free(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
#include <nuttx/net/netstats.h>
|
#include <nuttx/net/netstats.h>
|
||||||
|
|
||||||
#include "ipforward/ip_forward.h"
|
#include "ipforward/ipforward.h"
|
||||||
#include "devif/devif.h"
|
#include "devif/devif.h"
|
||||||
#include "netdev/netdev.h"
|
#include "netdev/netdev.h"
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
@ -334,7 +334,7 @@ static uint16_t udp_forward_interrupt(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
/* And release the forwarding state structure */
|
/* And release the forwarding state structure */
|
||||||
|
|
||||||
ip_forward_free(fwd);
|
ipfwd_free(fwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return flags;
|
return flags;
|
||||||
|
Loading…
Reference in New Issue
Block a user