summaryrefslogtreecommitdiffstats
path: root/libbsd.txt
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-05-18 14:17:20 +1000
committerChris Johns <chrisj@rtems.org>2016-05-18 14:17:20 +1000
commitc67debb2dbbe0e5283c11b1f3a79c0140def1975 (patch)
tree40687c03d971b6fb38f34083c738ba4ed5fdf913 /libbsd.txt
parentAdd support for rc.conf(5) initialisation. (diff)
downloadrtems-libbsd-c67debb2dbbe0e5283c11b1f3a79c0140def1975.tar.bz2
Add rc.conf documentation.
Diffstat (limited to 'libbsd.txt')
-rw-r--r--libbsd.txt51
1 files changed, 50 insertions, 1 deletions
diff --git a/libbsd.txt b/libbsd.txt
index 63c641b1..7ee54361 100644
--- a/libbsd.txt
+++ b/libbsd.txt
@@ -143,7 +143,56 @@ NET_TAP_INTERFACE = tap0
=== BSD Library Initialization ===
-Use the following code to initialize the BSD library:
+To initialise the BSD Library create a suitable rc.conf file. The FreeBSD man
+page rc.conf(5) provides the details needed to create a suitable format file:
+
+ https://www.freebsd.org/cgi/man.cgi?rc.conf
+
+You can call one of three functions to run the initialisation once BSD has
+initialised:
+
+ - rtems_bsd_run_etc_rc_conf: Run /etc/rc.conf.
+ - rtems_bsd_run_rc_conf: Run a user supplied file.
+ - rtems_bsd_run_rc_conf_script: Run the in memory line feed separated text string.
+
+For exapmle:
+
+ void
+ network_init(void)
+ {
+ rtems_status_code sc;
+
+ sc = rtems_bsd_initialize();
+ assert(sc == RTEMS_SUCCESSFUL);
+
+ rtems_bsd_run_etc_rc_conf(true); /* verbose = true */
+
+}
+
+By default the networking support is builtin. Other directives can be added and
+are found in 'machine/rtems-bsd-rc-conf-directives.h'. Please check the file
+for the list.
+
+The following network names are supported:
+
+ cloned_interfaces
+ ifconfig_'interface'
+ defaultrouter
+ hostname
+
+For example:
+
+ #
+ # My BSD initialisation.
+ #
+ hostname="myhost"
+ cloned_interfaces="vlan0 vlan1"
+ ifconfig_re0="inet inet 10.10.10.10 netmask 255.255.255.0"
+ fconfig_vlan0="inet 10.11.10.10 255.255.255.0 vlan 101 vlandev re0"
+ defaultrouter="10.10.10.1"
+
+You can also intialise the BSD library using code. The following code to
+initialize the BSD library:
-------------------------------------------------------------------------------
#include <assert.h>