source: rtems-libbsd/rtemsbsd/include/machine/rtems-bsd-rc-conf-directives.h @ f5c6651

55-freebsd-126-freebsd-12freebsd-9.3
Last change on this file since f5c6651 was f5c6651, checked in by Chris Johns <chrisj@…>, on 05/18/16 at 03:49:17

Add support for rc.conf(5) initialisation.

Provide user support for rc.conf(5) so a user can create a suitable
/etc/rc.conf file to initialise libbsd.

This patch by default adds basic networking support:

cloned_interfaces
ifconfig_'interface'
defaultrouter
hostname

Refer to FreeBSD documentation for examples.

Users can make a single call to have /etc/rc.conf processed, or pass a
file name to a specific configuration file or a text string with line
feeds can be passed to the scripting version of the interface.

The rc.conf support is implemented in terms of directive handlers that
are called based on a regular expression. The design allows new handlers
to be added as needed.

Line concatenation is still to be implemented.

  • Property mode set to 100644
File size: 2.0 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 * The directives available with rc.conf. You define the list you wish
28 * to have available in your application and they will be available.
29 */
30
31#ifndef _RTEMS_BSP_RC_CONF_DIRECTIVES_h
32#define _RTEMS_BSP_RC_CONF_DIRECTIVES_h
33
34#ifdef __cplusplus
35extern "C" {
36#endif /* __cplusplus */
37
38#include <sys/queue.h>
39#include <sys/kernel.h>
40
41/*
42 * Use the same SYSINT for all directives.
43 */
44#define RTEMS_BSD_RC_CONF_SYSINT(_n) \
45  SYSINIT(_n, SI_SUB_CREATE_INIT, SI_ORDER_ANY, _n ## _init, NULL)
46
47/*
48 * Decls for the handlers.
49 */
50void rc_conf_net_init(void* arg);   /* Installed by default. */
51
52/*
53 * The user available directives.
54 */
55/* add here */
56
57#ifdef __cplusplus
58}
59#endif /* __cplusplus */
60
61#endif
Note: See TracBrowser for help on using the repository browser.