diff options
Diffstat (limited to 'doc/developer')
| -rw-r--r-- | doc/developer/cli.rst | 14 | ||||
| -rw-r--r-- | doc/developer/library.rst | 1 | ||||
| -rw-r--r-- | doc/developer/lists.rst | 2 | ||||
| -rw-r--r-- | doc/developer/locking.rst | 2 | ||||
| -rw-r--r-- | doc/developer/logging.rst | 2 | ||||
| -rw-r--r-- | doc/developer/lua.rst | 65 | ||||
| -rw-r--r-- | doc/developer/modules.rst | 2 | ||||
| -rw-r--r-- | doc/developer/static-linking.rst | 4 | ||||
| -rw-r--r-- | doc/developer/subdir.am | 1 |
9 files changed, 85 insertions, 8 deletions
diff --git a/doc/developer/cli.rst b/doc/developer/cli.rst index cf35b03f0c..edabe61d92 100644 --- a/doc/developer/cli.rst +++ b/doc/developer/cli.rst @@ -101,7 +101,7 @@ Definition Grammar FRR uses its own grammar for defining CLI commands. The grammar draws from syntax commonly seen in \*nix manpages and should be fairly intuitive. The parser is implemented in Bison and the lexer in Flex. These may be found in -``lib/command_lex.l`` and ``lib/command_parse.y``, respectively. +``lib/command_parse.y`` and ``lib/command_lex.l``, respectively. **ProTip**: if you define a new command and find that the parser is throwing syntax or other errors, the parser is the last place you want @@ -371,11 +371,11 @@ Type rules +----------------------------+--------------------------------+--------------------------+ | ``A.B.C.D + X:X::X:X`` | ``const union sockunion *`` | ``NULL`` | +----------------------------+--------------------------------+--------------------------+ -| ``A.B.C.D/M`` | ``const struct prefix_ipv4 *`` | ``NULL`` | +| ``A.B.C.D/M`` | ``const struct prefix_ipv4 *`` | ``all-zeroes struct`` | +----------------------------+--------------------------------+--------------------------+ -| ``X:X::X:X/M`` | ``const struct prefix_ipv6 *`` | ``NULL`` | +| ``X:X::X:X/M`` | ``const struct prefix_ipv6 *`` | ``all-zeroes struct`` | +----------------------------+--------------------------------+--------------------------+ -| ``A.B.C.D/M + X:X::X:X/M`` | ``const struct prefix *`` | ``NULL`` | +| ``A.B.C.D/M + X:X::X:X/M`` | ``const struct prefix *`` | ``all-zeroes struct`` | +----------------------------+--------------------------------+--------------------------+ | ``(0-9)`` | ``long`` | ``0`` | +----------------------------+--------------------------------+--------------------------+ @@ -395,8 +395,10 @@ Note the following details: ``word`` tokens (e.g. constant words). This is useful if some parts of a command are optional. The type will be ``const char *``. - ``[no]`` will be passed as ``const char *no``. -- Pointers will be ``NULL`` when the argument is optional and the user did not - use it. +- Most pointers will be ``NULL`` when the argument is optional and the + user did not supply it. As noted in the table above, some prefix + struct type arguments are passed as pointers to all-zeroes structs, + not as ``NULL`` pointers. - If a parameter is not a pointer, but is optional and the user didn't use it, the default value will be passed. Check the ``_str`` argument if you need to determine whether the parameter was omitted. diff --git a/doc/developer/library.rst b/doc/developer/library.rst index a904a4e778..3d5c6a2a15 100644 --- a/doc/developer/library.rst +++ b/doc/developer/library.rst @@ -15,5 +15,6 @@ Library Facilities (libfrr) hooks cli modules + lua diff --git a/doc/developer/lists.rst b/doc/developer/lists.rst index 5f020060ce..853c65ddf3 100644 --- a/doc/developer/lists.rst +++ b/doc/developer/lists.rst @@ -1,3 +1,5 @@ +.. _lists: + List implementations ==================== diff --git a/doc/developer/locking.rst b/doc/developer/locking.rst index aee05aae06..d698789f9f 100644 --- a/doc/developer/locking.rst +++ b/doc/developer/locking.rst @@ -1,3 +1,5 @@ +.. _locking: + Locking ======= diff --git a/doc/developer/logging.rst b/doc/developer/logging.rst index e393fe6fba..db577c9216 100644 --- a/doc/developer/logging.rst +++ b/doc/developer/logging.rst @@ -1,3 +1,5 @@ +.. _logging: + Developer's Guide to Logging ============================ diff --git a/doc/developer/lua.rst b/doc/developer/lua.rst new file mode 100644 index 0000000000..23eb35fc58 --- /dev/null +++ b/doc/developer/lua.rst @@ -0,0 +1,65 @@ +.. _lua: + +Lua +=== + +Lua is currently experimental within FRR and has very limited +support. If you would like to compile FRR with Lua you must +follow these steps: + +1. Installation of Relevant Libraries + + .. code-block:: shell + + apt-get install lua5.3 liblua5-3 liblua5.3-dev + + These are the Debian libraries that are needed. There should + be equivalent RPM's that can be found + +2. Compilation + + Configure needs these options + + .. code-block:: shell + + ./configure --enable-dev-build --enable-lua <all other interesting options> + + Typically you just include the two new enable lines to build with it. + +3. Using Lua + + * Copy tools/lua.scr into /etc/frr + + * Create a route-map match command + + .. code-block:: console + + ! + router bgp 55 + neighbor 10.50.11.116 remote-as external + address-family ipv4 unicast + neighbor 10.50.11.116 route-map TEST in + exit-address-family + ! + route-map TEST permit 10 + match command mooey + ! + + * In the lua.scr file make sure that you have a function named 'mooey' + + .. code-block:: console + + function mooey () + zlog_debug(string.format("afi: %d: %s %d ifdx: %d aspath: %s localpref: %d", + prefix.family, prefix.route, nexthop.metric, + nexthop.ifindex, nexthop.aspath, nexthop.localpref)) + + nexthop.metric = 33 + nexthop.localpref = 13 + return 3 + end + +4. General Comments + + Please be aware that this is extremely experimental and needs a ton of work + to get this up into a state that is usable. diff --git a/doc/developer/modules.rst b/doc/developer/modules.rst index 763d8b1b8d..02330ddfe4 100644 --- a/doc/developer/modules.rst +++ b/doc/developer/modules.rst @@ -1,3 +1,5 @@ +.. _modules: + Modules ======= diff --git a/doc/developer/static-linking.rst b/doc/developer/static-linking.rst index bc33207b38..1e45c48dc3 100644 --- a/doc/developer/static-linking.rst +++ b/doc/developer/static-linking.rst @@ -10,7 +10,7 @@ likely to be present on a given platform - libfrr and libyang. The resultant binaries should still be fairly portable. For example, here is the DSO dependency list for `bgpd` after using these steps: -.. code-block:: +.. code-block:: shell $ ldd bgpd linux-vdso.so.1 (0x00007ffe3a989000) @@ -56,7 +56,7 @@ usable for our purposes. So download ``libpcre`` from `SourceForge <https://sourceforge.net/projects/pcre/>`_, and build it like this: -.. code-block:: +.. code-block:: shell ./configure --with-pic make diff --git a/doc/developer/subdir.am b/doc/developer/subdir.am index 791f7679a6..538a290c34 100644 --- a/doc/developer/subdir.am +++ b/doc/developer/subdir.am @@ -34,6 +34,7 @@ dev_RSTFILES = \ doc/developer/lists.rst \ doc/developer/locking.rst \ doc/developer/logging.rst \ + doc/developer/lua.rst \ doc/developer/memtypes.rst \ doc/developer/modules.rst \ doc/developer/next-hop-tracking.rst \ |
