source: rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-config.h @ c7eec93

5-freebsd-12
Last change on this file since c7eec93 was c7eec93, checked in by Christian Mauderer <christian.mauderer@…>, on Aug 2, 2018 at 6:44:14 AM

Add RTEMS_BSD_CONFIG_IPSEC.

  • Property mode set to 100644
File size: 8.2 KB
Line 
1/*
2 * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 *    notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 *    notice, this list of conditions and the following disclaimer in the
11 *    documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26/*
27 * Configure the LibBSD software stack.
28 *
29 * Configuration defines:
30 *
31 *  RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE : Memory in bytes for mbufs
32 *  RTEMS_BSD_CONFIG_IPSEC                  : IPSec support.
33 *  RTEMS_BSD_CONFIG_NET_PF_UNIX            : Packet Filter.
34 *  RTEMS_BSD_CONFIG_NET_IF_LAGG            : Link Aggregetion and Failover.
35 *  RTEMS_BSD_CONFIG_NET_IF_VLAN            : Virtual LAN.
36 *  RTEMS_BSD_CONFIG_SERVICE_TELNETD        : Telnet Protocol (TELNET).
37 *   RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE    : Telnet shell task stack size.
38 *  RTEMS_BSD_CONFIG_SERVICE_FTPD           : File Transfer Protocol (FTP).
39 *  RTEMS_BSD_CONFIG_BSP_CONFIG             : Configure default BSP devices.
40 *  RTEMS_BSD_CONFIG_INIT                   : Configure the LibBSD support.
41 *
42 * Rules for adding to this file:
43 *  1. All user visible defines start with 'RTEMS_BSD_CONFIG_'.
44 *  2. Define an implementation define starting with 'RTEMS_BSD_CFGDECL_'.
45 *  3. Only declare anything in the 'RTEMS_BSD_CONFIG_INIT' section.
46 *  4. Do not use '#ifdef ..' or '#ifndef ..'.
47 *  5. All '#endif' statements need a comment showing the '#if ..' logic.
48 */
49
50#ifndef _RTEMS_BSD_CONFIG_h
51#define _RTEMS_BSD_CONFIG_h
52
53#include <stdbool.h>
54
55/*
56 * Include the Nexus bus.
57 */
58#include <machine/rtems-bsd-nexus-bus.h>
59
60/*
61 * Include the SYSINIT support.
62 */
63#include <machine/rtems-bsd-sysinit.h>
64
65/*
66 * Include the services.
67 */
68#include <machine/rtems-bsd-rc-conf-services.h>
69
70/*
71 * Include the RTEMS BSD support.
72 */
73#include <rtems/bsd/bsd.h>
74
75#ifdef __cplusplus
76extern "C" {
77#endif /* __cplusplus */
78
79/*
80 * BSD Kernel configuration.
81 */
82#if defined(RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE)
83  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE
84#else
85  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT
86#endif
87
88/*
89 * BSD Kernel modules.
90 */
91
92/*
93 * Unix packet filter.
94 *  https://www.freebsd.org/doc/handbook/firewalls-pf.html
95 */
96#if defined(RTEMS_BSD_CONFIG_NET_PF_UNIX)
97  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX SYSINIT_NEED_NET_PF_UNIX
98#else
99  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX
100#endif /* RTEMS_BSD_CONFIG_NET_PF_UNIX */
101
102#if defined(RTEMS_BSD_CONFIG_NET_IP_MROUTE)
103  #define RTEMS_BSD_CFGDECL_NET_IP_MROUTE SYSINIT_NEED_NET_IP_MROUTE
104#else
105  #define RTEMS_BSD_CFGDECL_NET_IP_MROUTE
106#endif /* RTEMS_BSD_CONFIG_NET_IP_MROUTE */
107
108#if defined(RTEMS_BSD_CONFIG_NET_IP6_MROUTE)
109  #define RTEMS_BSD_CFGDECL_NET_IP6_MROUTE SYSINIT_NEED_NET_IP6_MROUTE
110#else
111  #define RTEMS_BSD_CFGDECL_NET_IP6_MROUTE
112#endif /* RTEMS_BSD_CONFIG_NET_IP6_MROUTE */
113
114/*
115 * Bridging.
116 *  https://www.freebsd.org/doc/handbook/network-bridging.html
117 */
118#if defined(RTEMS_BSD_CONFIG_NET_IF_BRIDGE)
119  #define RTEMS_BSD_CFGDECL_NET_IF_BRIDGE SYSINIT_NEED_NET_IF_BRIDGE
120#else
121  #define RTEMS_BSD_CFGDECL_NET_IF_BRIDGE
122#endif /* RTEMS_BSD_CONFIG_NET_IF_BRIDGE */
123
124/*
125 * Link Aggregation and Failover.
126 *  https://www.freebsd.org/doc/handbook/network-aggregation.html
127 */
128#if defined(RTEMS_BSD_CONFIG_NET_IF_LAGG)
129  #define RTEMS_BSD_CFGDECL_NET_IF_LAGG SYSINIT_NEED_NET_IF_LAGG
130#else
131  #define RTEMS_BSD_CFGDECL_NET_IF_LAGG
132#endif /* RTEMS_BSD_CONFIG_NET_IF_LAGG */
133
134/*
135 * Virtual LAN
136 *  https://www.freebsd.org/cgi/man.cgi?query=rc.conf then 'network_interfaces'.
137 */
138#if defined(RTEMS_BSD_CONFIG_NET_IF_VLAN)
139  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN SYSINIT_NEED_NET_IF_VLAN
140#else
141  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN
142#endif /* RTEMS_BSD_CONFIG_NET_IF_VLAN */
143
144/*
145 * Firewall PF
146 */
147#if defined(RTEMS_BSD_CONFIG_FIREWALL_PF)
148  #define RTEMS_BSD_CFGDECL_FIREWALL_PF SYSINIT_NEED_FIREWALL_PF
149  #define RTEMS_BSD_CFGDECL_FIREWALL_PF_SERVICE \
150      RTEMS_BSD_RC_CONF_SYSINT(rc_conf_firewall_pf)
151#else
152  #define RTEMS_BSD_CFGDECL_FIREWALL_PF
153  #define RTEMS_BSD_CFGDECL_FIREWALL_PF_SERVICE
154#endif /* RTEMS_BSD_CONFIG_FIREWALL_PF */
155
156#if defined(RTEMS_BSD_CONFIG_FIREWALL_PFLOG)
157  #define RTEMS_BSD_CFGDECL_FIREWALL_PFLOG SYSINIT_NEED_FIREWALL_PFLOG
158#else
159  #define RTEMS_BSD_CFGDECL_FIREWALL_PFLOG
160#endif /* RTEMS_BSD_CONFIG_FIREWALL_PFLOG */
161
162#if defined(RTEMS_BSD_CONFIG_FIREWALL_PFSYNC)
163  #define RTEMS_BSD_CFGDECL_FIREWALL_PFSYNC SYSINIT_NEED_FIREWALL_PFSYNC
164#else
165  #define RTEMS_BSD_CFGDECL_FIREWALL_PFSYNC
166#endif /* RTEMS_BSD_CONFIG_FIREWALL_PFSYNC */
167
168/*
169 * IPSec
170 */
171#if defined(RTEMS_BSD_CONFIG_IPSEC)
172  #define RTEMS_BSD_CFGDECL_IPSEC \
173      SYSINIT_NEED_NET_IF_GIF; \
174      SYSINIT_NEED_CRYPTODEV
175  #define RTEMS_BSD_CFGDECL_IPSEC_SERVICE \
176      RTEMS_BSD_RC_CONF_SYSINT(rc_conf_ipsec)
177#else
178  #define RTEMS_BSD_CFGDECL_IPSEC
179  #define RTEMS_BSD_CFGDECL_IPSEC_SERVICE
180#endif /* RTEMS_BSD_CONFIG_FIREWALL_PF */
181
182/*
183 * FTPD
184 */
185#if defined(RTEMS_BSD_CONFIG_SERVICE_FTPD)
186  #define RTEMS_BSD_CFGDECL_FTPD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_ftpd)
187#else
188  #define RTEMS_BSD_CFGDECL_FTPD
189#endif /* RTEMS_BSD_CONFIG_SERVICE_FTPD */
190
191/*
192 * Telnetd
193 */
194#if defined(RTEMS_BSD_CONFIG_SERVICE_TELNETD)
195  #if !defined(RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE)
196    #define RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE (8 * 1024)
197  #endif /* RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE */
198  #define RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE \
199    int rtems_telnetd_stack_size = RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE
200  #define RTEMS_BSD_CFGDECL_TELNETD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_telnetd)
201#else
202  #define RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE
203  #define RTEMS_BSD_CFGDECL_TELNETD
204#endif /* RTEMS_BSD_CONFIG_SERVICE_TELNETD */
205
206/*
207 * Termios
208 */
209#if defined(RTEMS_BSD_CONFIG_TERMIOS_KQUEUE_AND_POLL)
210  #define RTEMS_BSD_CFGDECL_TERMIOS_KQUEUE_AND_POLL SYSINIT_REFERENCE(termioskqueuepoll)
211#else
212  #define RTEMS_BSD_CFGDECL_TERMIOS_KQUEUE_AND_POLL
213#endif /* RTEMS_BSD_CONFIG_TERMIOS_KQUEUE_AND_POLL */
214
215/*
216 * Configure the system.
217 */
218#if defined(RTEMS_BSD_CONFIG_INIT)
219  /*
220   * Configure the domain allocation memory size.
221   */
222  uintptr_t rtems_bsd_allocator_domain_page_mbuf_size = \
223    RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE;
224
225  /*
226   * If a BSP configuration is requested include the Nexus bus BSP
227   * configuration.
228   */
229  #if defined(RTEMS_BSD_CONFIG_BSP_CONFIG)
230    #include <bsp/nexus-devices.h>
231  #endif /* RTEMS_BSD_CONFIG_BSP_CONFIG */
232
233  /*
234   * Create the networking modules and interfaces.
235   */
236  RTEMS_BSD_CFGDECL_NET_PF_UNIX;
237  RTEMS_BSD_CFGDECL_NET_IP_MROUTE;
238  RTEMS_BSD_CFGDECL_NET_IP6_MROUTE;
239  RTEMS_BSD_CFGDECL_NET_IF_BRIDGE;
240  RTEMS_BSD_CFGDECL_NET_IF_LAGG;
241  RTEMS_BSD_CFGDECL_NET_IF_VLAN;
242
243  /*
244   * Create the firewall
245   */
246  RTEMS_BSD_CFGDECL_FIREWALL_PF;
247  RTEMS_BSD_CFGDECL_FIREWALL_PF_SERVICE;
248  RTEMS_BSD_CFGDECL_FIREWALL_PFLOG;
249  RTEMS_BSD_CFGDECL_FIREWALL_PFSYNC;
250
251  /*
252   * IPSec related stuff.
253   */
254  RTEMS_BSD_CFGDECL_IPSEC;
255  RTEMS_BSD_CFGDECL_IPSEC_SERVICE;
256
257  /*
258   * Create the services.
259   */
260  RTEMS_BSD_CFGDECL_TELNETD;
261  RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE;
262  RTEMS_BSD_CFGDECL_FTPD;
263
264  RTEMS_BSD_CFGDECL_TERMIOS_KQUEUE_AND_POLL;
265#endif /* RTEMS_BSD_CONFIG_INIT */
266
267#ifdef __cplusplus
268}
269#endif /* __cplusplus */
270
271#endif /* _RTEMS_BSD_CONFIG_h */
Note: See TracBrowser for help on using the repository browser.