nuttx/net/route/Kconfig
Gregory Nutt 3aa18ef56e Addes support for read-only routing tables. Prior to this change, routing tables were only support in RAM and had to be initialized with explicit logic to add the necessary routes to the routing table. With this change, routes may be defined in the pre-initialized, read-only routing table provided by the board-specific logic
This would be particularly useful, for example, in the case where there is only a single network adaptor and you want all output packets to go to the single adaptor in all cases.  So for that behavior you could add a read-only routing table to the board-specific long that contains a single entry, the default route: 0.0.0.0/0.

Squashed commit of the following:

    net/route:  RAM and ROM routing tables build correctly in all IPv4 and IPv6 configurations.

    net/route: Verify IPv6 ROM route build; Make number of ROM routes a variable, not a configuration item.

    net/route:  Add initial support for ROM-base, read-only routing tables.

    net/route:  Adjust and generalize some structures, rename some functions, and add configuration and build support that will eventually support read-only routing tables.

    net/route:  Some initial though experiments on use of a fixe, read-only routing table
2017-09-28 09:04:31 -06:00

99 lines
2.6 KiB
Plaintext

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
menu "Routing Table Configuration"
config NET_ROUTE
bool "Routing table support"
default n
depends on NET_IPv4 || NET_IPv6
---help---
Build in support for a routing table. See include/net/route.h
if NET_ROUTE
choice
prompt "IPv4 routing table"
default ROUTE_IPv4_RAMROUTE
depends on NET_IPv4
config ROUTE_IPv4_RAMROUTE
bool "In-memory"
---help---
Select to used a IPv4 routing table RAM.
config ROUTE_IPv4_ROMROUTE
bool "Read-only"
---help---
Select to used a fixed read-only IPv4 routing table in FLASH or ROM.
In this case, the board-specific logic must provide a routing table
of the form of a simple array:
FAR const struct net_route_ipv4_s g_ipv4_routes[];
const unsigned int g_ipv4_nroutes;
NOTE: The read-only variable g_ipv4_nroutes must be set to the
actual number of valid entries in the array.
config NET_ROUTE_IPv4_FILEROUTE
bool "File"
depends on EXPERIMENTAL
---help---
Select to used a IPv4 routing table in a file in a mounted file system.
endchoice # IPv4 routing table
config ROUTE_MAX_IPv4_RAMROUTES
int "Preallocated IPv4 routing table entries"
default 4
depends on ROUTE_IPv4_RAMROUTE
---help---
The number of preallocated of the IPv4 routing table entries. This
eliminates dynamica memory allocations, but limits the maximum size
of the in-memory routing table to this number.
choice
prompt "IPv6 routing table"
default ROUTE_IPv6_RAMROUTE
depends on NET_IPv6
config ROUTE_IPv6_RAMROUTE
bool "In-memory"
---help---
Select to used a IPv6 routing table RAM.
config ROUTE_IPv6_ROMROUTE
bool "Read-only"
---help---
Select to used a fixed read-only IPv6 routing table in FLASH or ROM.
In this case, the board-specific logic must provide a routing table
of the form of simply array:
FAR const struct net_route_ipv6_s g_ipv6_routes[];
const unsigned int g_ipv6_nroutes;
NOTE: The read-only variable g_ipv6_nroutes must be set to the
actual number of valid entries in the array.
config NET_ROUTE_IPv6_FILEROUTE
bool "File"
depends on EXPERIMENTAL
---help---
Select to used a IPv6 routing table in a file in a mounted file system.
endchoice # IPv6 routing table
config ROUTE_MAX_IPv6_RAMROUTES
int "Preallocated IPv6 routing table entries"
default 4
depends on ROUTE_IPv6_RAMROUTE
---help---
The number of preallocated of the IPv6 routing table entries. This
eliminates dynamica memory allocations, but limits the maximum size
of the in-memory routing table to this number.
endif # NET_ROUTE
endmenu # ARP Configuration