]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
19 months agoMerge commit 'bb094fb6' into mq-aggregator-for-v3 mq-aggregator-for-v3
Maria Matejka [Fri, 8 Dec 2023 11:09:17 +0000 (12:09 +0100)] 
Merge commit 'bb094fb6' into mq-aggregator-for-v3

19 months agoRefactoring also net_roa_check
Maria Matejka [Fri, 8 Dec 2023 11:07:46 +0000 (12:07 +0100)] 
Refactoring also net_roa_check

Having 4 functions doing almost the same is more mess than three macros.

19 months agoMerge commit '54ddf90f6370f06efc71c3ffd6e02d031a86866f' into mq-aggregator-for-v3
Maria Matejka [Fri, 8 Dec 2023 08:08:38 +0000 (09:08 +0100)] 
Merge commit '54ddf90f6370f06efc71c3ffd6e02d031a86866f' into mq-aggregator-for-v3

19 months agoConf: debug tables
Maria Matejka [Thu, 7 Dec 2023 13:38:05 +0000 (14:38 +0100)] 
Conf: debug tables

For now just a dummy config but it is needed for forward
compatibility with v3.

19 months agoRefactoring of net_route
Maria Matejka [Thu, 7 Dec 2023 13:10:11 +0000 (14:10 +0100)] 
Refactoring of net_route

19 months agoTable: Adding route refresh begin and end debug messages
Maria Matejka [Thu, 7 Dec 2023 12:54:41 +0000 (13:54 +0100)] 
Table: Adding route refresh begin and end debug messages

20 months agoC Compiler Attribute Cleanup Test
Maria Matejka [Thu, 26 Oct 2023 21:09:20 +0000 (23:09 +0200)] 
C Compiler Attribute Cleanup Test

There is a long-known CC attribute cleanup which allows to call a custom
cleanup function when an auto-storage variable ceases to exist. We're
gonna use it for end-of-loop and leave-locked-block macros.

This commit adds a static unit test for this compiler feature to be sure
that it really does what we want. We're looking forward to the next ISO
C norm where this may finally get a nice syntax and standardization.

20 months agoMerge commit '8f5511da' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 15:53:45 +0000 (16:53 +0100)] 
Merge commit '8f5511da' into mq-aggregator-for-v3

20 months agoMerge commit 'd8130da8' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 15:36:54 +0000 (16:36 +0100)] 
Merge commit 'd8130da8' into mq-aggregator-for-v3

20 months agoMerge commit 'a7a9df86' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 15:34:20 +0000 (16:34 +0100)] 
Merge commit 'a7a9df86' into mq-aggregator-for-v3

20 months agoMerge commit '9b775859' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 15:00:44 +0000 (16:00 +0100)] 
Merge commit '9b775859' into mq-aggregator-for-v3

20 months agoMerge commit 'e915f99e' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 15:00:09 +0000 (16:00 +0100)] 
Merge commit 'e915f99e' into mq-aggregator-for-v3

20 months agoMerge commit 'b6385dec' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:58:58 +0000 (15:58 +0100)] 
Merge commit 'b6385dec' into mq-aggregator-for-v3

20 months agoMerge commit '81a20ca5' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:50:39 +0000 (15:50 +0100)] 
Merge commit '81a20ca5' into mq-aggregator-for-v3

20 months agoMerge commit '35726051' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:50:28 +0000 (15:50 +0100)] 
Merge commit '35726051' into mq-aggregator-for-v3

20 months agoMerge commit 'fcf22586' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:50:02 +0000 (15:50 +0100)] 
Merge commit 'fcf22586' into mq-aggregator-for-v3

20 months agoMerge commit '8e9e013b' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:35:18 +0000 (15:35 +0100)] 
Merge commit '8e9e013b' into mq-aggregator-for-v3

20 months agoMerge commit '3397ca51' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:35:08 +0000 (15:35 +0100)] 
Merge commit '3397ca51' into mq-aggregator-for-v3

20 months agoMerge commit 'e338c4b6' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 14:34:54 +0000 (15:34 +0100)] 
Merge commit 'e338c4b6' into mq-aggregator-for-v3

20 months agoMerge commit 'bcff3ae7' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 10:06:07 +0000 (11:06 +0100)] 
Merge commit 'bcff3ae7' into mq-aggregator-for-v3

20 months agoMerge commit '9ca86ef6' into mq-aggregator-for-v3
Maria Matejka [Thu, 9 Nov 2023 09:52:53 +0000 (10:52 +0100)] 
Merge commit '9ca86ef6' into mq-aggregator-for-v3

20 months agoMerge commit '9d456d53' into mq-aggregator-for-v3
Maria Matejka [Wed, 8 Nov 2023 21:14:58 +0000 (22:14 +0100)] 
Merge commit '9d456d53' into mq-aggregator-for-v3

20 months agoMerge commit '15c86ed0' into mq-aggregator-for-v3
Maria Matejka [Wed, 8 Nov 2023 20:56:58 +0000 (21:56 +0100)] 
Merge commit '15c86ed0' into mq-aggregator-for-v3

20 months agoMPLS: Fix issue with recursive MPLS routes
Ondrej Zajicek [Mon, 16 Oct 2023 13:21:36 +0000 (15:21 +0200)] 
MPLS: Fix issue with recursive MPLS routes

Recursive MPLS routes used hostentry from the original route, which
triggered different table than MPLS table, and therefore were not
updated.

21 months agoMerge commit '333ddd4f' into mq-aggregator-for-v3
Maria Matejka [Wed, 1 Nov 2023 17:34:06 +0000 (18:34 +0100)] 
Merge commit '333ddd4f' into mq-aggregator-for-v3

21 months agoMerge commit 'e55696a4' into mq-aggregator-for-v3
Maria Matejka [Wed, 1 Nov 2023 17:08:34 +0000 (18:08 +0100)] 
Merge commit 'e55696a4' into mq-aggregator-for-v3

21 months agoMerge commit '21213be5' into mq-aggregator-for-v3
Maria Matejka [Wed, 1 Nov 2023 16:49:12 +0000 (17:49 +0100)] 
Merge commit '21213be5' into mq-aggregator-for-v3

21 months agoMerge commit '8ad9c4bb' into mq-aggregator-for-v3
Maria Matejka [Wed, 1 Nov 2023 16:46:52 +0000 (17:46 +0100)] 
Merge commit '8ad9c4bb' into mq-aggregator-for-v3

21 months agoAggregator: fixed route source unlocking on shutdown and withdraw
Maria Matejka [Wed, 1 Nov 2023 13:30:46 +0000 (14:30 +0100)] 
Aggregator: fixed route source unlocking on shutdown and withdraw

21 months agoAggregator: Fixed bugs in filter usage
Maria Matejka [Wed, 1 Nov 2023 09:57:43 +0000 (10:57 +0100)] 
Aggregator: Fixed bugs in filter usage

21 months agoMerge commit 'a4adb09f5a5c3806488fb121eafc0e6c969135e7' into HEAD
Maria Matejka [Wed, 1 Nov 2023 09:15:32 +0000 (10:15 +0100)] 
Merge commit 'a4adb09f5a5c3806488fb121eafc0e6c969135e7' into HEAD

21 months agoAggregator: Expressed most of the attribute logic in filter language
Maria Matejka [Tue, 31 Oct 2023 10:37:54 +0000 (11:37 +0100)] 
Aggregator: Expressed most of the attribute logic in filter language

21 months agoBasic route aggregation
Igor Putovny [Wed, 21 Jun 2023 11:15:07 +0000 (13:15 +0200)] 
Basic route aggregation

Add a new protocol offering route aggregation.

User can specify list of route attributes in the configuration file and
run route aggregation on the export side of the pipe protocol. Routes are
sorted and for every group of equivalent routes new route is created and
exported to the routing table. It is also possible to specify filter
which will run for every route before aggregation.

Furthermore, it will be possible to set attributes of new routes
according to attributes of the aggregated routes.

This is a work in progress.

Original work by Igor Putovny, subsequent cleanups and finalization by
Maria Matejka.

This is a split-commit of the neighboring aggregator branch
with a bit improved lvalue handling, to have easier merge into v3.

21 months agoFilters: allowing to return any number of values
Maria Matejka [Tue, 31 Oct 2023 11:03:49 +0000 (12:03 +0100)] 
Filters: allowing to return any number of values

21 months agoFilter: value hashing
Maria Matejka [Tue, 31 Oct 2023 10:52:30 +0000 (11:52 +0100)] 
Filter: value hashing

Added a code for computing hash of filter values.

This is a split-commit of the neighboring aggregator branch
with improved lvalue and attribute handling.

21 months agoFilter: predefined variables for specific blocks
Maria Matejka [Mon, 30 Oct 2023 09:44:45 +0000 (10:44 +0100)] 
Filter: predefined variables for specific blocks

This is a split-commit of the neighboring aggregator branch
with a bit improved lvalue handling, to have easier merge into v3.

21 months agoFilter: adding explicit route-block type
Maria Matejka [Mon, 30 Oct 2023 08:49:20 +0000 (09:49 +0100)] 
Filter: adding explicit route-block type

This is a split-commit of the neighboring aggregator branch
with a bit improved lvalue handling, to have easier merge into v3.

21 months agoFilter: adding explicit route type
Maria Matejka [Sun, 29 Oct 2023 18:53:09 +0000 (19:53 +0100)] 
Filter: adding explicit route type

This is a split-commit of the neighboring aggregator branch
with a bit improved lvalue handling, to have easier merge into v3.

22 months agoL3VPN: Import/export target reconfiguration
Ondrej Zajicek [Sun, 1 Oct 2023 03:02:46 +0000 (05:02 +0200)] 
L3VPN: Import/export target reconfiguration

22 months agoBGP, L3VPN: Fix MPLS channel reload mq-master-merged-to-v3
Ondrej Zajicek [Sat, 30 Sep 2023 21:18:04 +0000 (23:18 +0200)] 
BGP, L3VPN: Fix MPLS channel reload

When a MPLS channel is reloaded, it should reload all regular MPLS-aware
channels. This causes re-evaluation of routes in FEC map and possibly
reannouncement of MPLS routes.

22 months agoMPLS: Implement FEC map reconfiguration
Ondrej Zajicek [Sat, 30 Sep 2023 18:07:40 +0000 (20:07 +0200)] 
MPLS: Implement FEC map reconfiguration

This allows changing label policy or label range without restart.

22 months agoMPLS: Handle label allocation failures
Ondrej Zajicek [Tue, 26 Sep 2023 16:50:20 +0000 (18:50 +0200)] 
MPLS: Handle label allocation failures

22 months agoL3VPN: Fix bug in reconfiguration
Ondrej Zajicek [Sat, 23 Sep 2023 22:24:50 +0000 (00:24 +0200)] 
L3VPN: Fix bug in reconfiguration

Fields import_target / export_target link to config structures, must be
updated during reconfiguration.

22 months agoMPLS: Improve handling of static label allocations
Ondrej Zajicek [Sat, 23 Sep 2023 15:55:01 +0000 (17:55 +0200)] 
MPLS: Improve handling of static label allocations

Use mpls_new_label() / mpls_free_label() also for static labels, to keep
track of allocated labels and to enforce label ranges.

Static label allocations always use static label range, regardless of
configured label range.

22 months agoStatic: Add syntax for static MPLS labels
Ondrej Zajicek [Fri, 22 Sep 2023 17:49:15 +0000 (19:49 +0200)] 
Static: Add syntax for static MPLS labels

Instead of just using route attributes, static routes with
static MPLS labels can be defined just by e.g.:

  route 10.1.1.0/24 mpls 100 via 10.1.2.1 mpls 200;

22 months agoMPLS: Label range non-intersection check
Ondrej Zajicek [Fri, 22 Sep 2023 13:47:48 +0000 (15:47 +0200)] 
MPLS: Label range non-intersection check

22 months agoMPLS: Improve label range reconfiguration
Ondrej Zajicek [Mon, 18 Sep 2023 15:47:17 +0000 (17:47 +0200)] 
MPLS: Improve label range reconfiguration

Allow to shorten label range over unused area.

22 months agoMPLS: Add command 'show mpls ranges'
Ondrej Zajicek [Mon, 18 Sep 2023 15:32:24 +0000 (17:32 +0200)] 
MPLS: Add command 'show mpls ranges'

Add command to show MPLS label ranges and their stats.

22 months agoNest: Fix missing RTS_* values in filters
Ondrej Zajicek [Mon, 18 Sep 2023 12:19:20 +0000 (14:19 +0200)] 
Nest: Fix missing RTS_* values in filters

22 months agoLib: Extend MPLS label allocator bitmap
Ondrej Zajicek [Mon, 18 Sep 2023 12:12:22 +0000 (14:12 +0200)] 
Lib: Extend MPLS label allocator bitmap

Add function lmap_last_one_in_range() for finding the last active label
in a label range.

22 months agoL3VPN: BGP/MPLS VPNs using MPLS backbone
Ondrej Zajicek [Mon, 3 Oct 2022 18:06:13 +0000 (20:06 +0200)] 
L3VPN: BGP/MPLS VPNs using MPLS backbone

The L3VPN protocol implements RFC 4364 BGP/MPLS VPNs using MPLS backbone.
It works similarly to pipe. It connects IP table (one per VRF) with (global)
VPN table. Routes passed from VPN table to IP table are stripped of RD and
filtered by import targets, routes passed in the other direction are extended
with RD, MPLS labels and export targets in extended communities. A separate
MPLS channel is used to announce MPLS routes for the labels.

22 months agoMPLS: Add support for per-VRF labeling policy
Ondrej Zajicek [Sat, 1 Oct 2022 20:38:49 +0000 (22:38 +0200)] 
MPLS: Add support for per-VRF labeling policy

The new labeling policy MPLS_POLICY_VRF assigns one label to all routes
(from the same FEC map associated with one VRF), while replaces their
next hops with a lookup to a VRF table. This is useful for L3VPN
protocol.

22 months agoBGP: Add MPLS support
Ondrej Zajicek [Thu, 15 Sep 2022 00:30:15 +0000 (02:30 +0200)] 
BGP: Add MPLS support

When MPLS is active, received routes on MPLS-aware SAFIs (ipvX-mpls,
vpnX-mpls) are automatically labeled according to active label policy and
corresponding MPLS routes are automatically generated. Also routes sent
on MPLS-aware SAFIs announce local labels when it should be done.

22 months agoStatic: Add MPLS support
Ondrej Zajicek [Thu, 15 Sep 2022 00:29:12 +0000 (02:29 +0200)] 
Static: Add MPLS support

When MPLS is active, static IP/VPN routes are automatically labeled
according to active label policy and corresponding MPLS routes are
automatically generated.

22 months agoMPLS subsystem
Ondrej Zajicek [Wed, 14 Sep 2022 23:38:18 +0000 (01:38 +0200)] 
MPLS subsystem

The MPLS subsystem manages MPLS labels and handles their allocation to
MPLS-aware routing protocols. These labels are then attached to IP or VPN
routes representing label switched paths -- LSPs.

There was already a preliminary MPLS support consisting of MPLS label
net_addr, MPLS routing tables with static MPLS routes, remote labels in
next hops, and kernel protocol support.

This patch adds the MPLS domain as a basic structure representing local
label space with dynamic label allocator and configurable label ranges.
To represent LSPs, allocated local labels can be attached as route
attributes to IP or VPN routes with local labels as attributes.

There are several steps for handling LSP routes in routing protocols --
deciding to which forwarding equivalence class (FEC) the LSP route
belongs, allocating labels for new FECs, announcing MPLS routes for new
FECs, attaching labels to LSP routes. The FEC map structure implements
basic code for managing FECs in routing protocols, therefore existing
protocols can be made MPLS-aware by adding FEC map and delegating
most work related to local label management to it.

22 months agoLib: Indirect bitmap for MPLS label allocator
Ondrej Zajicek (work) [Sat, 22 May 2021 10:31:47 +0000 (12:31 +0200)] 
Lib: Indirect bitmap for MPLS label allocator

22 months agoNest: Expand rte_src.private_id to u64
Ondrej Zajicek [Mon, 2 Oct 2023 13:09:30 +0000 (15:09 +0200)] 
Nest: Expand rte_src.private_id to u64

In general, private_id is sparse and protocols may want to map some
internal values directly into it. For example, L3VPN needs to
map VPN route discriminators to private_id.

OTOH, u32 is enough for global_id, as these identifiers are dense.

22 months agoBGP config: Splitting Route Refresh and Enhanced Route Refresh
Maria Matejka [Wed, 27 Sep 2023 10:51:55 +0000 (12:51 +0200)] 
BGP config: Splitting Route Refresh and Enhanced Route Refresh

Both toggles are on by default but if some implementation needs one or
another to be switched off separately, then it's possible now.

22 months agoAggregator: brief documentation
Maria Matejka [Fri, 22 Sep 2023 13:10:45 +0000 (15:10 +0200)] 
Aggregator: brief documentation

22 months agoAggregator: Forbidden dangerous filter computations
Maria Matejka [Fri, 22 Sep 2023 12:21:21 +0000 (14:21 +0200)] 
Aggregator: Forbidden dangerous filter computations

22 months agoAggregator: Fixed hashing of adata
Maria Matejka [Wed, 12 Jul 2023 13:11:00 +0000 (15:11 +0200)] 
Aggregator: Fixed hashing of adata

22 months agoBasic route aggregation
Igor Putovny [Wed, 21 Jun 2023 11:15:07 +0000 (13:15 +0200)] 
Basic route aggregation

Add a new protocol offering route aggregation.

User can specify list of route attributes in the configuration file and
run route aggregation on the export side of the pipe protocol. Routes are
sorted and for every group of equivalent routes new route is created and
exported to the routing table. It is also possible to specify filter
which will run for every route before aggregation.

Furthermore, it will be possible to set attributes of new routes
according to attributes of the aggregated routes.

This is a work in progress.

Original work by Igor Putovny, subsequent cleanups and finalization by
Maria Matejka.

22 months agoSimple testing of reconfiguration to a slightly different one
Maria Matejka [Fri, 23 Jun 2023 07:05:48 +0000 (09:05 +0200)] 
Simple testing of reconfiguration to a slightly different one

22 months agoBGP: Setting and unsetting unknown attributes kk-bgp-unknown-attributes
katerina.kubecova [Tue, 19 Sep 2023 09:11:24 +0000 (11:11 +0200)] 
BGP: Setting and unsetting unknown attributes

All these must be declared as bytestring. Allows operators to delete
unwanted attributes breaking the Internet:

    https://blog.benjojo.co.uk/post/bgp-path-attributes-grave-error-handling

22 months agoAttributes declared in config can be bytestrings
katerina.kubecova [Mon, 18 Sep 2023 12:07:59 +0000 (14:07 +0200)] 
Attributes declared in config can be bytestrings

22 months agoFilter: Function unset() accepts attributes declared in config
katerina.kubecova [Wed, 20 Sep 2023 07:50:22 +0000 (09:50 +0200)] 
Filter: Function unset() accepts attributes declared in config

22 months agoStructures bytestring and adata merged into adata.
katerina.kubecova [Mon, 18 Sep 2023 12:43:58 +0000 (14:43 +0200)] 
Structures bytestring and adata merged into adata.

22 months agoConf: Move definition of struct keyword to conf.h
Ondrej Zajicek [Thu, 14 Sep 2023 15:24:09 +0000 (17:24 +0200)] 
Conf: Move definition of struct keyword to conf.h

22 months agoFilter: Use common initializer for undefined variables and eattrs. mq-func-types
Ondrej Zajicek [Wed, 13 Sep 2023 04:21:26 +0000 (06:21 +0200)] 
Filter: Use common initializer for undefined variables and eattrs.

Undefined paths and clists should use typed f_val with empty adata
instead of just void f_val. Use common initializer to handle both
variables and eattrs.

22 months agoFilter: Minor updates to methods
Ondrej Zajicek [Tue, 12 Sep 2023 16:44:20 +0000 (18:44 +0200)] 
Filter: Minor updates to methods

Remove warning when function-like syntax is used for calling
add/remove/... methods.

Fix argument offset in error messages for function-like syntax.

22 months agoFilter: Split clist add/delete operations to multiple methods
Ondrej Zajicek [Tue, 25 Jul 2023 17:33:51 +0000 (19:33 +0200)] 
Filter: Split clist add/delete operations to multiple methods

22 months agoFilter: Implement constant promotion for multiple dispatch methods
Ondrej Zajicek [Tue, 25 Jul 2023 15:43:52 +0000 (17:43 +0200)] 
Filter: Implement constant promotion for multiple dispatch methods

22 months agoFilter: Print proper error response in multiple method dispatch
Ondrej Zajicek [Wed, 12 Jul 2023 18:11:34 +0000 (20:11 +0200)] 
Filter: Print proper error response in multiple method dispatch

When no matching method is found, print an error response containing
position and type of infringing argument and a set of expected types.

22 months agoFilter: Move argument list reversal from function_call to var_list
Ondrej Zajicek [Wed, 12 Jul 2023 18:01:03 +0000 (20:01 +0200)] 
Filter: Move argument list reversal from function_call to var_list

List of arguments for function calls is constructed in reverse and then
reverted. This was done in function_call grammar rule. Do the reverse
directly in var_list grammar rule. This fixes reverse order of arguments
in method calls.

22 months agoFilter: Better syntax for function return types
Ondrej Zajicek [Tue, 4 Jul 2023 17:07:30 +0000 (19:07 +0200)] 
Filter: Better syntax for function return types

The C-style syntax does not really fit into rest of our syntax.

22 months agoFilter: Implement multiple dispatch for methods
Ondrej Zajicek [Mon, 3 Jul 2023 15:00:58 +0000 (17:00 +0200)] 
Filter: Implement multiple dispatch for methods

 - Extend method descriptors with type signature
 - Daisy chain method descriptors for the same symbol
 - Dispatch methods for same symbol based on type signature
 - Split add/delete/filter operations to multiple methods
 - Replace ad-hoc dispatch of old-style syntax with scope-based dispatch
 - Also change method->arg_num to count initial arg

It still needs some improvements, like better handling of untyped
expressions and better error reporting when no dispatch can be done.

The multiple dispatch could also be extended to dispatch regular
function-like expressions in a uniform way.

22 months agoFilter: Make f_method_call_*() usage symmetric
Ondrej Zajicek [Tue, 27 Jun 2023 23:21:23 +0000 (01:21 +0200)] 
Filter: Make f_method_call_*() usage symmetric

22 months agoFilter: Convert more methods to use METHOD_R()
Ondrej Zajicek [Tue, 27 Jun 2023 19:38:05 +0000 (21:38 +0200)] 
Filter: Convert more methods to use METHOD_R()

22 months agoFilter: Remove number of args from METHOD_R()
Ondrej Zajicek [Tue, 27 Jun 2023 19:16:11 +0000 (21:16 +0200)] 
Filter: Remove number of args from METHOD_R()

Macro METHOD_R() is used for simplest methods, there is no place to
define argument types, so let's force it to be 0.

22 months agoConf: Remove toksym from symbol_known
Ondrej Zajicek [Tue, 27 Jun 2023 12:49:28 +0000 (14:49 +0200)] 
Conf: Remove toksym from symbol_known

No need to have toksym in symbol_known, as defined symbols are preferred
(by scope) to keywords anyway. Adding it just creates grammar conflicts.

22 months agoFilter: Print instructions take only one value (simplification)
Maria Matejka [Mon, 19 Jun 2023 15:24:30 +0000 (17:24 +0200)] 
Filter: Print instructions take only one value (simplification)

22 months agoFilter: Shortened method declarations
Maria Matejka [Mon, 19 Jun 2023 13:49:51 +0000 (15:49 +0200)] 
Filter: Shortened method declarations

22 months agoFilter: The for loop uses the method system for type dispatch
Maria Matejka [Sun, 18 Jun 2023 20:50:45 +0000 (22:50 +0200)] 
Filter: The for loop uses the method system for type dispatch

22 months agoRemoving unused terminals from filter config
Maria Matejka [Sat, 17 Jun 2023 11:05:23 +0000 (13:05 +0200)] 
Removing unused terminals from filter config

22 months agoFilter: Methods rework
Maria Matejka [Fri, 16 Jun 2023 15:35:37 +0000 (17:35 +0200)] 
Filter: Methods rework

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.

22 months agoUninitialized filter variables of path/[el]?clist types are now explicitly empty
Maria Matejka [Sat, 17 Jun 2023 08:16:28 +0000 (10:16 +0200)] 
Uninitialized filter variables of path/[el]?clist types are now explicitly empty

22 months agoConf: config warnings show the file position
Maria Matejka [Fri, 16 Jun 2023 20:11:03 +0000 (22:11 +0200)] 
Conf: config warnings show the file position

22 months agoFilter: functions can and should have typed return values
Maria Matejka [Thu, 15 Jun 2023 11:25:40 +0000 (13:25 +0200)] 
Filter: functions can and should have typed return values

22 months agoFilter/Conf: Method names have their own keyword hash
Maria Matejka [Tue, 13 Jun 2023 07:39:29 +0000 (09:39 +0200)] 
Filter/Conf: Method names have their own keyword hash

To allow for future dynamic method definition, parsing method names is
done via a dedicated keyword hash/scope.

22 months agoConf: Allowing conf scope to be explicitly read only
Maria Matejka [Tue, 13 Jun 2023 09:09:41 +0000 (11:09 +0200)] 
Conf: Allowing conf scope to be explicitly read only

22 months agoConf: Symbol manipulation gets its context explicitly
Maria Matejka [Tue, 13 Jun 2023 08:51:03 +0000 (10:51 +0200)] 
Conf: Symbol manipulation gets its context explicitly

22 months agoFilter: any lvalue can get its methods called
Maria Matejka [Mon, 12 Jun 2023 09:37:50 +0000 (11:37 +0200)] 
Filter: any lvalue can get its methods called

22 months agoFilter: split out dot-notation methods to separate targets
Maria Matejka [Mon, 12 Jun 2023 09:20:49 +0000 (11:20 +0200)] 
Filter: split out dot-notation methods to separate targets

This is just a preparationary refactoring to allow type-based method
tables.

22 months agoConf: Keywords have their default symbols
Maria Matejka [Fri, 9 Jun 2023 10:49:19 +0000 (12:49 +0200)] 
Conf: Keywords have their default symbols

This avoids unnecessary collapsed soft scopes caused by keyword symbol multiallocation.

22 months agoConf: Symbol hashes for all scopes
Maria Matejka [Mon, 2 May 2022 18:29:03 +0000 (20:29 +0200)] 
Conf: Symbol hashes for all scopes

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.

22 months agoDropping empty-type const f_vals, they were copied anyway
Maria Matejka [Fri, 9 Jun 2023 09:02:05 +0000 (11:02 +0200)] 
Dropping empty-type const f_vals, they were copied anyway

22 months agoConf: Adding dummy thread-number setting for easier sharing of configuration between...
Maria Matejka [Fri, 9 Jun 2023 11:49:17 +0000 (13:49 +0200)] 
Conf: Adding dummy thread-number setting for easier sharing of configuration between v2 and v3

23 months agoBFD: Improve handling of AdminDown
Ondrej Zajicek [Tue, 29 Aug 2023 16:23:29 +0000 (18:23 +0200)] 
BFD: Improve handling of AdminDown

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.

23 months agoConf: Allow keywords to be redefined by user symbols
Ondrej Zajicek [Tue, 13 Dec 2022 18:31:46 +0000 (19:31 +0100)] 
Conf: Allow keywords to be redefined by user symbols

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.

23 months agoFilter: Add separate instruction for uninitialized variable declaration
Ondrej Zajicek [Fri, 25 Aug 2023 21:14:36 +0000 (23:14 +0200)] 
Filter: Add separate instruction for uninitialized variable declaration

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.