[rtems-libbsd commit] Add rc.conf documentation.

Chris Johns chrisj at rtems.org
Wed May 18 04:17:29 UTC 2016


Module:    rtems-libbsd
Branch:    master
Commit:    c67debb2dbbe0e5283c11b1f3a79c0140def1975
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=c67debb2dbbe0e5283c11b1f3a79c0140def1975

Author:    Chris Johns <chrisj at rtems.org>
Date:      Wed May 18 14:17:20 2016 +1000

Add rc.conf documentation.

---

 libbsd.txt | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 50 insertions(+), 1 deletion(-)

diff --git a/libbsd.txt b/libbsd.txt
index 63c641b..7ee5436 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>



More information about the vc mailing list