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.
This commit is contained in:
Chris Johns
2016-05-18 13:49:17 +10:00
parent ac7b68cd84
commit f5c6651da8
7 changed files with 1105 additions and 0 deletions

View File

@@ -977,6 +977,8 @@ def build(bld):
'rtemsbsd/rtems/rtems-bsd-get-mac-address.c',
'rtemsbsd/rtems/rtems-bsd-get-task-priority.c',
'rtemsbsd/rtems/rtems-bsd-get-task-stack-size.c',
'rtemsbsd/rtems/rtems-bsd-rc-conf-net.c',
'rtemsbsd/rtems/rtems-bsd-rc-conf.c',
'rtemsbsd/rtems/rtems-bsd-shell-dhcpcd.c',
'rtemsbsd/rtems/rtems-bsd-shell-netcmds.c',
'rtemsbsd/rtems/rtems-bsd-shell.c',
@@ -1281,6 +1283,16 @@ def build(bld):
lib = ["m", "z"],
install_path = None)
test_rcconf01 = ['testsuite/rcconf01/test_main.c']
bld.program(target = "rcconf01.exe",
features = "cprogram",
cflags = cflags,
includes = includes,
source = test_rcconf01,
use = ["bsd"],
lib = ["m", "z"],
install_path = None)
test_rwlock01 = ['testsuite/rwlock01/test_main.c']
bld.program(target = "rwlock01.exe",
features = "cprogram",