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

5-freebsd-12freebsd-9.3
Last change on this file since 9510012 was 9510012, checked in by Chris Johns <chrisj@…>, on Jul 18, 2016 at 10:12:17 PM

config: Fix telnetd configuration warning.

  • Property mode set to 100644
File size: 5.6 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_NET_PF_UNIX            : Packet Filter.
33 *  RTEMS_BSD_CONFIG_NET_IF_LAGG            : Link Aggregetion and Failover.
34 *  RTEMS_BSD_CONFIG_NET_IF_VLAN            : Virtual LAN.
35 *  RTEMS_BSD_CONFIG_SERVICE_TELNETD        : Telnet Protocol (TELNET).
36 *   RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE    : Telnet shell task stack size.
37 *  RTEMS_BSD_CONFIG_SERVICE_FTPD           : File Transfer Protocol (FTP).
38 *  RTEMS_BSD_CONFIG_BSP_CONFIG             : Configure default BSP devices.
39 *  RTEMS_BSD_CONFIG_INIT                   : Configure the LibBSD support.
40 *
41 * Rules for adding to this file:
42 *  1. All user visible defines start with 'RTEMS_BSD_CONFIG_'.
43 *  2. Define an implementation define starting with 'RTEMS_BSD_CFGDECL_'.
44 *  3. Only declare anything in the 'RTEMS_BSD_CONFIG_INIT' section.
45 *  4. Do not use '#ifdef ..' or '#ifndef ..'.
46 *  5. All '#endif' statements need a comment showing the '#if ..' logic.
47 */
48
49#ifndef _RTEMS_BSD_CONFIG_h
50#define _RTEMS_BSD_CONFIG_h
51
52#include <stdbool.h>
53
54/*
55 * Include the Nexus bus.
56 */
57#include <machine/rtems-bsd-nexus-bus.h>
58
59/*
60 * Include the SYSINIT support.
61 */
62#include <machine/rtems-bsd-sysinit.h>
63
64/*
65 * Include the services.
66 */
67#include <machine/rtems-bsd-rc-conf-services.h>
68
69/*
70 * Include the RTEMS BSD support.
71 */
72#include <rtems/bsd/bsd.h>
73
74#ifdef __cplusplus
75extern "C" {
76#endif /* __cplusplus */
77
78/*
79 * BSD Kernel configuration.
80 */
81#if defined(RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE)
82  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_CONFIG_DOMAIN_PAGE_MBUFS_SIZE
83#else
84  #define RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE RTEMS_BSD_ALLOCATOR_DOMAIN_PAGE_MBUF_DEFAULT
85#endif
86
87/*
88 * BSD Kernel modules.
89 */
90
91/*
92 * Unix packet filter.
93 *  https://www.freebsd.org/doc/handbook/firewalls-pf.html
94 */
95#if defined(RTEMS_BSD_CONFIG_NET_PF_UNIX)
96  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX SYSINIT_NEED_NET_PF_UNIX
97#else
98  #define RTEMS_BSD_CFGDECL_NET_PF_UNIX
99#endif /* RTEMS_BSD_CONFIG_NET_PF_UNIX */
100
101/*
102 * Link Aggregation and Failover.
103 *  https://www.freebsd.org/doc/handbook/network-aggregation.html
104 */
105#if defined(RTEMS_BSD_CONFIG_NET_IF_LAGG)
106  #define RTEMS_BSD_CFGDECL_IF_LAGG SYSINIT_NEED_NET_IF_LAGG
107#else
108  #define RTEMS_BSD_CFGDECL_IF_LAGG
109#endif /* RTEMS_BSD_CONFIG_NET_IF_LAGG */
110
111/*
112 * Virtual LAN
113 *  https://www.freebsd.org/cgi/man.cgi?query=rc.conf then 'network_interfaces'.
114 */
115#if defined(RTEMS_BSD_CONFIG_NET_IF_VLAN)
116  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN SYSINIT_NEED_NET_IF_VLAN
117#else
118  #define RTEMS_BSD_CFGDECL_NET_IF_VLAN
119#endif /* RTEMS_BSD_CONFIG_NET_IF_VLAN */
120
121/*
122 * FTPD
123 */
124#if defined(RTEMS_BSD_CONFIG_SERVICE_FTPD)
125  #define RTEMS_BSD_CFGDECL_FTPD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_ftpd)
126#else
127  #define RTEMS_BSD_CFGDECL_FTPD
128#endif /* RTEMS_BSD_CONFIG_SERVICE_FTPD */
129
130/*
131 * Telnetd
132 */
133#if defined(RTEMS_BSD_CONFIG_SERVICE_TELNETD)
134  #if !defined(RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE)
135    #define RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE (8 * 1024)
136  #endif /* RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE */
137  #define RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE \
138    int rtems_telnetd_stack_size = RTEMS_BSD_CONFIG_TELNETD_STACK_SIZE
139  #define RTEMS_BSD_CFGDECL_TELNETD RTEMS_BSD_RC_CONF_SYSINT(rc_conf_telnetd)
140#else
141  #define RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE
142  #define RTEMS_BSD_CFGDECL_TELNETD
143#endif /* RTEMS_BSD_CONFIG_SERVICE_TELNETD */
144
145/*
146 * Configure the system.
147 */
148#if defined(RTEMS_BSD_CONFIG_INIT)
149  /*
150   * Configure the domain allocation memory size.
151   */
152  uintptr_t rtems_bsd_allocator_domain_page_mbuf_size = \
153    RTEMS_BSD_CFGDECL_DOMAIN_PAGE_MBUFS_SIZE;
154
155  /*
156   * If a BSP configuration is requested include the Nexus bus BSP
157   * configuration.
158   */
159  #if defined(RTEMS_BSD_CONFIG_BSP_CONFIG)
160    #include <bsp/nexus-devices.h>
161  #endif /* RTEMS_BSD_CONFIG_BSP_CONFIG */
162
163  /*
164   * Create the networking modules and interfaces.
165   */
166  RTEMS_BSD_CFGDECL_NET_PF_UNIX;
167  RTEMS_BSD_CFGDECL_IF_LAGG;
168  RTEMS_BSD_CFGDECL_NET_IF_VLAN;
169
170  /*
171   * Create the services.
172   */
173  RTEMS_BSD_CFGDECL_TELNETD;
174  RTEMS_BSD_CFGDECL_TELNETD_STACK_SIZE;
175  RTEMS_BSD_CFGDECL_FTPD;
176#endif /* RTEMS_BSD_CONFIG_INIT */
177
178#ifdef __cplusplus
179}
180#endif /* __cplusplus */
181
182#endif /* _RTEMS_BSD_CONFIG_h */
Note: See TracBrowser for help on using the repository browser.