summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-09-12Filter: Convert more methods to use METHOD_R()Ondrej Zajicek
2023-09-12Filter: Remove number of args from METHOD_R()Ondrej Zajicek
Macro METHOD_R() is used for simplest methods, there is no place to define argument types, so let's force it to be 0.
2023-09-12Conf: Remove toksym from symbol_knownOndrej Zajicek
No need to have toksym in symbol_known, as defined symbols are preferred (by scope) to keywords anyway. Adding it just creates grammar conflicts.
2023-09-12Filter: Print instructions take only one value (simplification)Maria Matejka
2023-09-12Filter: Shortened method declarationsMaria Matejka
2023-09-12Filter: The for loop uses the method system for type dispatchMaria Matejka
2023-09-12Removing unused terminals from filter configMaria Matejka
2023-09-12Filter: Methods reworkMaria Matejka
Methods can now be called as x.m(y), as long as x can have its type inferred in config time. If used as a command, it modifies the object, if used as a value, it keeps the original object intact. Also functions add(x,y), delete(x,y), filter(x,y) and prepend(x,y) now spit a warning and are considered deprecated. It's also possible to call a method on a constant, see filter/test.conf for examples like bgp_path = +empty+.prepend(1). Inside instruction definitions (filter/f-inst.c), a METHOD_CONSTRUCTOR() call is added, which registers the instruction as a method for the type of its first argument. Each type has its own method symbol table and filter parser switches between them based on the inferred type of the object calling the method. Also FI_CLIST_(ADD|DELETE|FILTER) instructions have been split to allow for this method dispatch. With type inference, it's now possible.
2023-09-12Uninitialized filter variables of path/[el]?clist types are now explicitly emptyMaria Matejka
2023-09-12Conf: config warnings show the file positionMaria Matejka
2023-09-12Filter: functions can and should have typed return valuesMaria Matejka
2023-09-12Filter/Conf: Method names have their own keyword hashMaria Matejka
To allow for future dynamic method definition, parsing method names is done via a dedicated keyword hash/scope.
2023-09-12Conf: Allowing conf scope to be explicitly read onlyMaria Matejka
2023-09-12Conf: Symbol manipulation gets its context explicitlyMaria Matejka
2023-09-12Filter: any lvalue can get its methods calledMaria Matejka
2023-09-12Filter: split out dot-notation methods to separate targetsMaria Matejka
This is just a preparationary refactoring to allow type-based method tables.
2023-09-12Conf: Keywords have their default symbolsMaria Matejka
This avoids unnecessary collapsed soft scopes caused by keyword symbol multiallocation.
2023-09-12Conf: Symbol hashes for all scopesMaria Matejka
This is a backport cherry-pick of commits 165156beeb2926472bbceca3c103aacc3f81a8cc cce974e8ea992d0e6d2f649eca7880b436d91d71 from the v3.0 branch as we need symbol hashes directly inside their scopes for more general usage than before.
2023-09-12Dropping empty-type const f_vals, they were copied anywayMaria Matejka
2023-09-12Conf: Adding dummy thread-number setting for easier sharing of configuration ↵Maria Matejka
between v2 and v3
2023-08-29BFD: Improve handling of AdminDownOndrej Zajicek
According to RFC 5882, system should not interpret the local or remote session state transition to AdminDown as failure. We followed that for the local session state but not for the remote session state (which just triggered a transition of the local state to Down). The patch fixes that. We do not properly generate AdminDown on our side, so the patch is relevant just for interoperability with other systems. Thanks to Sunnat Samadov for the bugreport.
2023-08-28Wireguard: debugMikael Magnusson
2023-08-28Filter: Disable debuggingMikael Magnusson
2023-08-28Wg-user: debugMikael Magnusson
2023-08-28Unix: debugMikael Magnusson
2023-08-28Wireguard: Initial commitMikael Magnusson
Use 51820 (default wireguard port) as default tunnel type.
2023-08-28BGP: Tunnel Encapsulation attributeMikael Magnusson
Refer to RFC 9012, The BGP Tunnel Encapsulation Attribute.
2023-08-28TunnelEncaps: Initial commitMikael Magnusson
2023-08-28Wg-user: Work-around listen_port mutex dead lockMikael Magnusson
Problem with listen_port dead lock in wireguard-go.
2023-08-28Wg-user: Add wireguard unix socket implementationMikael Magnusson
Unix socket implementation for wireguard-go. Use abstract unix sockets on Android
2023-08-28Wireguard-lib: Import wireguard libraryMikael Magnusson
Add to makefile.
2023-08-28Filter: Add literal for generic empty listMikael Magnusson
Add literal for empty set "empty", which works for clist, eclist and lclist, by using existing constant promotion mechanism.
2023-08-28Bytestring: implement bytestring literals and constantsMikael Magnusson
Implement byte string literals on the format b"xxx" and b64"xxx" which can be used as literals and in constants. The format b"xxx" supports character data and octal and hexadecimal data using C escapes (\n, \nn, \nnn, \xn and \xnn). The format b64"xxx" supports base64 encoded strings (RFC1341).
2023-08-28Unix: Implement sk_connect_unixMikael Magnusson
Support abstract socket in sk_unix_connect Implement SK_UNIX_ACTIVE
2023-08-25Conf: Allow keywords to be redefined by user symbolsOndrej Zajicek
Most syntactic constructs in BIRD configuration (e.g. protocol options) are defined as keywords, which are distinct from symbols (user-defined names for protocols, variables, ...). That may cause backwards compatibility issue when a new feature is added, as it may collide with existing user names. We can allow keywords to be shadowed by symbols in almost all cases to avoid this issue. This replaces the previous mechanism, where shadowable symbols have to be explictly added to kw_syms.
2023-08-25Filter: Add separate instruction for uninitialized variable declarationOndrej Zajicek
The previous approach (use VOID constant for variable initialization) failed due to dynamic type check failure. Thanks to Alexander Zubkov <green@qrator.net> for the bugreport.
2023-08-25RPKI: Fix conflict in config grammarOndrej Zajicek
2023-08-25Nest: Fix missing bar in kw_symOndrej Zajicek
Thanks to Alexander Zubkov for the notice.
2023-08-24Doc: Document bytestring typeAlexander Zubkov
2023-08-24Doc: Document RAdv "custom option" configuration definitionAlexander Zubkov
2023-08-24Conf: Use nonterminal bytestring instead of BYTETEXTOndrej Zajicek
Nonterminal bytestring allows to provide expressions to be evaluated in places where BYTETEXT is used now: passwords, radv custom option. Based on the patch from Alexander Zubkov <green@qrator.net>, thanks!
2023-08-24Filter: Use more generic approach for intra-config expressionsAlexander Zubkov
Replace f_eval_int() function with a type-generic variant: cf_eval(). Implement similar fuction: cf_eval_int() via inline call to cf_eval().
2023-08-24Filter: Add bytestring typeAlexander Zubkov
- Rename BYTESTRING lexem to BYTETEXT, not to collide with 'bytestring' type name - Add bytestring type with id T_BYTESTRING (0x2c) - Add from_hex() filter function to create bytestring from hex string - Add filter test cases for bytestring type Minor changes by committer.
2023-08-24Lib: Add functions for reading and writing of bytestringsOndrej Zajicek
Based on patch from Alexander Zubkov, thanks!
2023-08-23Nest: Treat VRF interfaces as inside respective VRFsOndrej Zajicek
Despite not having defined 'master interface', VRF interfaces should be treated as being inside respective VRFs. They behave as a loopback for respective VRFs. Treating the VRF interface as inside the VRF allows e.g. OSPF to pick up IP addresses defined on the VRF interface. For this, we also need to tell apart VRF interfaces and regular interfaces. Extend Netlink code to parse interface type and mark VRF interfaces with IF_VRF flag. Based on the patch from Erin Shepherd, thanks!
2023-08-22Merge branch 'bmp'Ondrej Zajicek
2023-08-22RPM: Sync bird.spec from Fedora dist-gitJakub Ružička
It seems all Fedora packages are built from epel7 branch.
2023-08-22Distro: Add apkg packaging testJakub Ružička
The test was written by Maria Matejka, thanks! Run this using apkg test
2023-08-22Distro: Add apkg compat levelJakub Ružička
This will allow compatibility on future apkg config updates.
2023-08-22Debian: Fix for arm64 cross buildJakub Ružička
Mirrors debian patch.