[PATCH] Improved readability of the operator documentation
Hi! Every now and then I have to look up what the ~ operator does exactly. Finding the right combination of types in the long running text is always quite hard. I think that formatting that as a list would make this easier. I also put different kinds of operators into different paragraphs, because I think this also makes it easier to find what you are looking for in this section. For reference: This is the block I am talking about: https://bird.network.cz/?get_doc&v=20&f=bird-5.html#ss5.3 Kind Regards Jo From 08c1e50a97b0afd6522d52ba0f9488c8cc3cb9f8 Mon Sep 17 00:00:00 2001 From: Johannes Erwerle <jo@swagspace.org> Date: Sat, 12 Oct 2024 09:07:42 +0200 Subject: [PATCH] Improved readability of the operator documentation --- doc/bird.sgml | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index 6857452d..7ee066bb 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -1897,21 +1897,31 @@ in the foot). <label id="operators"> <p>The filter language supports common integer operators <cf>(+,-,*,/)</cf>, -parentheses <cf/(a*(b+c))/, comparison <cf/(a=b, a!=b, a<b, a>=b)/. -Logical operations include unary not (<cf/!/), and (<cf/&&/), and or -(<cf/||/). Special operators include (<cf/˜/, -<cf/!˜/) for "is (not) element of a set" operation - it can be used on -element and set of elements of the same type (returning true if element is -contained in the given set), or on two strings (returning true if first string -matches a shell-like pattern stored in second string) or on IP and prefix -(returning true if IP is within the range defined by that prefix), or on prefix -and prefix (returning true if first prefix is more specific than second one) or -on bgppath and bgpmask (returning true if the path matches the mask) or on -number and bgppath (returning true if the number is in the path) or on bgppath -and int (number) set (returning true if any ASN from the path is in the set) or -on pair/quad and clist (returning true if the pair/quad is element of the -clist) or on clist and pair/quad set (returning true if there is an element of -the clist that is also a member of the pair/quad set). +parentheses <cf/(a*(b+c))/, comparison <cf/(a=b, a!=b, a<b, a>=b)/.</p> + +<p>Logical operations include unary not (<cf/!/), and (<cf/&&/), and or +(<cf/||/).</p> + +<p>Special operators include (<cf/˜/, +<cf/!˜/) for "is (not) element of a set" operation - it can be used on: +<itemize> + <item>element and set of elements of the same type (returning true if + element is contained in the given set) + <item>two strings (returning true if first string matches a shell-like + pattern stored in second string) + <item>IP and prefix (returning true if IP is within the range defined by + that prefix), + <item>prefix and prefix (returning true if first prefix is more specific + than second one) + <item>bgppath and bgpmask (returning true if the path matches the mask) + <item>number and bgppath (returning true if the number is in the path) + <item>bgppath and int (number) set (returning true if any ASN from the + path is in the set) + <item>pair/quad and clist (returning true if the pair/quad is element of + the clist) + <item>clist and pair/quad set (returning true if there is an element of the + clist that is also a member of the pair/quad set). +</itemize> <p>There is one operator related to ROA infrastructure - <cf/roa_check()/. It examines a ROA table and does <rfc id="6483"> route origin validation for a -- 2.46.0
On Sat, Oct 12, 2024 at 09:29:19AM +0200, Johannes Erwerle wrote:
Hi!
Every now and then I have to look up what the ~ operator does exactly. Finding the right combination of types in the long running text is always quite hard. I think that formatting that as a list would make this easier.
Hi Yes, the old version was an ugly wall of text. Thanks, merged. Documentation patches are also welcome! -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Johannes Erwerle -
Ondrej Zajicek