]> git.puffer.fish Git - matthieu/frr.git/commitdiff
doc: correct ip prefix token mapping table
authorMark Stapp <mjs@voltanet.io>
Tue, 18 Feb 2020 19:08:21 +0000 (14:08 -0500)
committerMark Stapp <mjs@voltanet.io>
Wed, 19 Feb 2020 14:08:22 +0000 (09:08 -0500)
Fix the table that shows the mapping between ip network cli
tokens and the data struct that the cli handler will see.
Optional network/subnet types appear as a pointer to an
all-zeroes struct, not a NULL pointer.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
doc/developer/cli.rst

index cf35b03f0c64c21c296a721c0eb310dc3fb5424a..12fcb7a325dadf4d5a0afc6c31990427ca38a40d 100644 (file)
@@ -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.