0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 12:48:43 +00:00
Commit Graph

1002 Commits

Author SHA1 Message Date
Katerina Kubecova
1c4995f9d2 marking time with 1 and 4 tag 2024-01-12 10:09:45 +01:00
Katerina Kubecova
cbd5e4b415 cbor_test.c, fixing reading big nums 2024-01-11 14:50:12 +01:00
Katerina Kubecova
f8bc20a211 show protocols all in cbor works, added header 2024-01-11 08:57:50 +01:00
Katerina Kubecova
85d3eb7ebf show protocols all from cbor - problems with buffer 2024-01-09 10:20:15 +01:00
Maria Matejka
fc8e454fb6 little makefile fix 2024-01-04 11:54:47 +01:00
Katerina Kubecova
fca9fca3d9 includes still broken 2024-01-04 11:46:34 +01:00
Maria Matejka
a214035951 minor example update 2024-01-04 11:22:09 +01:00
Katerina Kubecova
9fb61e6034 broken includes for cbors 2024-01-04 10:57:16 +01:00
Katerina Kubecova
b7bc3d195a print_cbor: ospf show topology somehow works 2023-12-22 16:42:14 +01:00
Katerina Kubecova
0d74089e9a client.c: show memory somehow works in cbor, bird command prompt for cbor has little bugs 2023-12-20 16:17:12 +01:00
Katerina Kubecova
b0f148b86c client does not work for yi sock 2023-12-08 10:27:37 +01:00
Katerina Kubecova
17b08668a1 cmds.c, cbor_cmds.c (, config.Y): 'show symbols constant', 'show symbols variable' work 2023-12-07 13:42:23 +01:00
Katerina Kubecova
c200b7972b cbor ip addresses stored with 52/54 tag, but without yang changes 2023-12-07 10:28:44 +01:00
Katerina Kubecova
78750e197f birdc.py: first complete cbor to cbor commands, cbor saving int64 fix 2023-12-06 08:40:40 +01:00
Katerina Kubecova
ff7f5df4c5 fixup! cbor_cmds.c, ospf_for_cbor.c: ospf show topology looks working 2023-12-01 15:00:26 +01:00
Katerina Kubecova
5a079e8eae cbor_cmds.c, ospf_for_cbor.c: ospf show topology looks working 2023-12-01 14:43:24 +01:00
Katerina Kubecova
c27d43bf4c cbor_parse, cbor_cmds: looks like show_status and show_symbols work (show_symbols args included) 2023-11-29 15:14:16 +01:00
Katerina Kubecova
d91390e2d2 cbor_parse: parsing command, can show memory 2023-11-28 11:57:40 +01:00
Katerina Kubecova
10afb161bd second socket does not work 2023-11-24 13:57:27 +01:00
Maria Matejka
af8a604b43 fixup! fixup! fixup! fixup! various fices 2023-11-23 10:00:33 +01:00
Katerina Kubecova
6ba81eb8b8 fixup! fixup! fixup! various fices 2023-11-23 09:57:36 +01:00
Katerina Kubecova
d54ef3e310 fixup! fixup! various fices 2023-11-23 09:56:35 +01:00
Katerina Kubecova
6ab2f0fa54 fixup! various fices 2023-11-23 09:51:48 +01:00
Katerina Kubecova
52921062b8 cbor.c: primitive tools for writing cbor 2023-11-23 08:52:51 +01:00
Ondrej Zajicek
a740054db5 Nest: Minor fixes in MPLS 2023-10-25 18:25:46 +02:00
Ondrej Zajicek
63f1c4d918 Use RTA_MAX_SIZE in rta_do_cow()
This allows to modify MPLS label stack in filters. Fixes a bug in
handling of 'gw_mpls' attribute.
2023-10-24 14:25:18 +02:00
Ondrej Zajicek
b5e9e5197b 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.
2023-10-16 15:21:36 +02:00
Ondrej Zajicek
ba01a6f2e6 MPLS: Handle compatibility with old configs
Old configs do not define MPLS domains and may use a static protocol
to define static MPLS routes.

When MPLS channel is the only channel of static protocol, handle it
as a main channel. Also, define implicit MPLS domain if needed and
none is defined.
2023-10-05 17:54:43 +02:00
Ondrej Zajicek
be09b030ed MPLS: Update to support and use 64bit source id 2023-10-04 15:00:24 +02:00
Ondrej Zajicek
a7a9df8639 MPLS: Implement FEC map reconfiguration
This allows changing label policy or label range without restart.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
9b775859cd MPLS: Handle label allocation failures 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
b6385decb3 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.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
81a20ca5d8 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;
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
3572605151 MPLS: Label range non-intersection check 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
fcf2258620 MPLS: Improve label range reconfiguration
Allow to shorten label range over unused area.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
8e9e013b0d MPLS: Add command 'show mpls ranges'
Add command to show MPLS label ranges and their stats.
2023-10-04 13:12:05 +02:00
Ondrej Zajicek
3397ca51f8 Nest: Fix missing RTS_* values in filters 2023-10-04 13:12:05 +02:00
Ondrej Zajicek
bcff3ae79a 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.
2023-10-04 13:07:28 +02:00
Ondrej Zajicek
9ca86ef69c 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.
2023-10-04 13:01:21 +02:00
Ondrej Zajicek
333ddd4f98 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.
2023-10-04 13:01:21 +02:00
Ondrej Zajicek
21213be523 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.
2023-10-02 15:09:30 +02:00
Igor Putovny
977b82fba4 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.
2023-09-26 15:46:24 +02:00
Maria Matejka
51f2e7afaf Conf: Symbol manipulation gets its context explicitly 2023-09-12 15:36:46 +02:00
Maria Matejka
8e177cf35b Conf: Symbol hashes for all scopes
This is a backport cherry-pick of commits
  165156beeb
  cce974e8ea

from the v3.0 branch as we need symbol hashes directly inside their
scopes for more general usage than before.
2023-09-12 15:20:50 +02:00
Ondrej Zajicek
f5140d1027 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.
2023-08-25 23:50:44 +02:00
Ondrej Zajicek
32427c9ce1 Nest: Fix missing bar in kw_sym
Thanks to Alexander Zubkov for the notice.
2023-08-25 04:29:32 +02:00
Ondrej Zajicek
f411a19bb0 Conf: Use nonterminal bytestring instead of BYTETEXT
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-24 16:59:23 +02:00
Alexander Zubkov
0dbcc92726 Filter: Use more generic approach for intra-config expressions
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-24 04:45:55 +02:00
Alexander Zubkov
fc3547880a Filter: Add bytestring type
- 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-24 04:33:33 +02:00
Ondrej Zajicek
e3c0eca956 Nest: Treat VRF interfaces as inside respective VRFs
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-23 16:08:40 +02:00