0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00
Commit Graph

1770 Commits

Author SHA1 Message Date
Vojtech Vilimek
3b87af96f3 Merge branch 'vv-test' into proto-snmp 2023-10-19 16:32:38 +02:00
Vojtech Vilimek
e15f38e082 SNMP: Bare support for agentx-TestSet-PDU 2023-10-19 16:27:04 +02:00
Vojtech Vilimek
faa6262573 SNMP: Code improvements 2023-10-19 16:20:37 +02:00
Vojtech Vilimek
6c59bcdfbb SNMP: Remove old code 2023-10-19 16:15:15 +02:00
Vojtech Vilimek
f2f9810b86 fixup! An unexpected NULL pilgrim 2023-10-19 16:03:22 +02:00
Vojtech Vilimek
728e968ba7 SNMP: Refactoring - Comments, Logging 2023-10-19 15:59:13 +02:00
Vojtech Vilimek
3488d0e0a7 SNMP: Refactoring - Comments, Logging 2023-10-18 18:17:58 +02:00
Vojtech Vilimek
7b79f55ae9 SNMP: Add bgp trie cleanup 2023-10-18 17:39:36 +02:00
Vojtech Vilimek
9f4a68be73 SNMP: Minor changes in get, get_next handling 2023-10-18 13:31:35 +02:00
Vojtech Vilimek
778906d168 SNMP: BGP4-MIB add LocalIdentifier 2023-10-11 11:21:19 +02:00
Vojtech Vilimek
2211644ed3 SNMP: Context support and improved registering 2023-09-11 13:41:39 +02:00
Vojtech Vilimek
14bcba7040 SNMP: Refactoring 2023-09-04 14:01:08 +02:00
Vojtech Vilimek
730666be7f SNMP: Add timeout config option, refactoring 2023-09-04 13:58:59 +02:00
Vojtech Vilimek
8a1f2dba66 SNMP: BGP4-MIB notifications 2023-09-04 13:53:45 +02:00
Vojtech Vilimek
c765faef17 SNMP: Refactoring (readability) 2023-09-04 13:51:29 +02:00
Vojtech Vilimek
eb5bd00de4 SNMP: Refactoring (order) 2023-09-04 13:48:28 +02:00
Vojtech Vilimek
7543da15d8 SNMP: Remove transmit hook, new macros 2023-09-04 13:46:02 +02:00
Vojtech Vilimek
df28d1cbe8 Testing Notify-PDU 2023-09-04 09:25:51 +02:00
Vojtech Vilimek
3c718d162c Minor bugfix 2023-08-30 17:22:52 +02:00
Vojtech Vilimek
4c29a3911e Big code cleanup 2023-08-08 21:51:38 +02:00
Vojtech Vilimek
b3f8b3124d Bugfixes 2023-08-08 20:47:30 +02:00
Vojtech Vilimek
c6bcdf8687 Fix BGP identifier values in BGP4-MIB 2023-08-08 19:54:40 +02:00
Vojtech Vilimek
5f936b4442 Register-PDU distinguish between instance/tree reg.
Other changes include simplification of large TX buffer when it's insufficient
and purge of additional_buffer.
2023-08-08 19:00:54 +02:00
Vojtech Vilimek
bdf68b3240 Extension for varbind TimeTicks, varbind type sizes 2023-08-08 17:00:20 +02:00
Vojtech Vilimek
c8cda68762 fixed snmp_test.c test suite 2023-07-26 14:34:55 +02:00
Vojtech Vilimek
4c7828779e mainly visual tweaks 2023-07-26 14:34:01 +02:00
Vojtech Vilimek
3c26f49107 changes in subagent.c API 2023-07-26 14:30:34 +02:00
Vojtech Vilimek
9f8950d4d7 changes in bgp_mib.c API (mainly) 2023-07-26 14:02:23 +02:00
Vojtech Vilimek
972c717c56 tmp: minor changes 2023-03-31 09:56:39 +02:00
Vojtech Vilimek
14a4535cf0 tmp: minor changes 2023-03-31 09:56:03 +02:00
Vojtech Vilimek
ed676cd1c5 tmp: minor changes + fixed tests 2023-03-24 15:02:23 +01:00
Vojtech Vilimek
3ec802e7f0 tmp: add new bgp mib entry support (bgpPeerTable) 2023-03-24 15:01:35 +01:00
Vojtech Vilimek
d4d925cbea tmp: add new helper function 2023-03-24 15:00:54 +01:00
Vojtech Vilimek
fb2e47d566 tmp: fix parsing multiple in rx buffer 2023-03-14 14:10:08 +01:00
Vojtech Vilimek
908aa67e1c tmp: minor changes 2023-03-14 14:09:45 +01:00
Vojtech Vilimek
29da25c2d0 code cleanup 2022-12-17 18:24:05 +01:00
Vojtech Vilimek
23b467318c tmp 2022-12-17 18:16:19 +01:00
Vojtech Vilimek
2a4fedb6e0 tmp: compiles and runs 2022-12-10 18:08:00 +01:00
Vojtech Vilimek
721524abb8 snmp reconnect 2022-12-10 13:23:50 +01:00
Vojtech Vilimek
8d4926b0f5 snmp_log() wrapper 2022-12-10 13:22:37 +01:00
Vojtech Vilimek
74c68fc89e tmp 2022-12-06 16:32:26 +01:00
Vojtech Vilimek
9a11ec8d83 tmp: compiles 2022-11-29 16:30:20 +01:00
Vojtech Vilimek
6f74f4a663 moving shared parts to snmp_utils 2022-11-22 14:16:09 +01:00
Vojtech Vilimek
ad9833e4f1 tmp: compiles 2022-11-19 23:00:02 +01:00
Vojtech Vilimek
508a420327 fix the Get and GetNext
missing some functionality around GetBulk
2022-11-15 16:29:03 +01:00
Vojtech Vilimek
9a75af4573 tmp: compiles, first tests 2022-11-05 16:29:00 +01:00
Vojtech Vilimek
03ab2a89c0 TMP: compiles and runs 2022-09-30 09:36:09 +02:00
Vojtech Vilimek
8ea2e991fa TMP: work on Get-PDU and GetNext-PDU 2022-09-20 14:28:57 +02:00
Vojtech Vilimek
eb5a749046 TMP new snmp PDUs 2022-09-06 18:04:29 +02:00
Vojtech Vilimek
7961bbb26a TMP: compiles, some pdus working 2022-08-10 17:31:32 +02:00
Vojtech Vilimek
a5bdba428b TMP: code cleanup - remove trailing whitespace 2022-08-02 16:12:09 +02:00
Vojtech Vilimek
e5a88b584e TMP: proto-snmp compiles and connects to master 2022-08-02 16:06:00 +02:00
Vojtech Vilimek
f4dc719f14 Refactor of struct channel and channel_config
Element struct channel_class *channel was renamed to *class in struct channel
and struct channel_config. New pointers were added to structures above
in both directions. This can simplify and speedup the proces of finding
channel (configuration).
2022-08-01 13:03:20 +02:00
Vojtech Vilimek
203c63ad5d Initial commit for new protocol `snmp' 2022-08-01 13:01:49 +02:00
Maria Matejka
08c8484608 Merge commit '94eb0858' into thread-next 2022-07-18 12:33:00 +02:00
Maria Matejka
4b6f5ee870 Merge commit 'a4451535' into thread-next 2022-07-18 11:11:46 +02:00
Maria Matejka
05673b16a8 Merge commit 'c70b3198' into thread-next [lots of conflicts]
There were more conflicts that I'd like to see, most notably in route
export. If a bisect identifies this commit with something related, it
may be simply true that this commit introduces that bug. Let's hope it
doesn't happen.
2022-07-15 14:57:02 +02:00
Maria Matejka
1c2851ecfa Fixed invalid routes handling
The invalid routes were filtered out before they could ever get
exported, yet some of the routines need them available, e.g. for
display or import reload.

Now the invalid routes are properly exported and dropped in channel
export routines instead.
2022-07-14 12:13:18 +02:00
Maria Matejka
68a2c9d4c9 Merge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-next 2022-07-13 14:14:37 +02:00
Maria Matejka
af0d5ec279 Merge commit 'd429bc5c841a8e9d4c81786973edfa56d20a407e' into thread-next 2022-07-13 12:54:20 +02:00
Maria Matejka
5be34f5ab4 Merge commit '7e9cede1fd1878fb4c00e793bccd0ca6c18ad452' into thread-next 2022-07-13 12:02:34 +02:00
Maria Matejka
bc2ce4aaa8 Removing the rte_modify API
For BGP LLGR purposes, there was an API allowing a protocol to directly
modify their stale routes in table before flushing them. This API was
called by the table prune routine which violates the future locking
requirements.

Instead of this, BGP now requests a special route export and reimports
these routes into the table, allowing for asynchronous execution without
locking the table on export.
2022-07-12 14:45:27 +02:00
Maria Matejka
080cbd1219 Route refresh in tables uses a stale counter.
Until now, we were marking routes as REF_STALE and REF_DISCARD to
cleanup old routes after route refresh. This needed a synchronous route
table walk at both beginning and the end of route refresh routine,
marking the routes by the flags.

We avoid these walks by using a stale counter. Every route contains:
  u8 stale_cycle;
Every import hook contains:
  u8 stale_set;
  u8 stale_valid;
  u8 stale_pruned;
  u8 stale_pruning;

In base_state, stale_set == stale_valid == stale_pruned == stale_pruning
and all routes' stale_cycle also have the same value.

The route refresh looks like follows:
+ ----------- + --------- + ----------- + ------------- + ------------ +
|             | stale_set | stale_valid | stale_pruning | stale_pruned |
| Base        |     x     |      x      |        x      |       x      |
| Begin       |    x+1    |      x      |        x      |       x      |
  ... now routes are being inserted with stale_cycle == (x+1)
| End         |    x+1    |     x+1     |        x      |       x      |
  ... now table pruning routine is scheduled
| Prune begin |    x+1    |     x+1     |       x+1     |       x      |
  ... now routes with stale_cycle not between stale_set and stale_valid
      are deleted
| Prune end   |    x+1    |     x+1     |       x+1     |      x+1     |
+ ----------- + --------- + ----------- + ------------- + ------------ +

The pruning routine is asynchronous and may have high latency in
high-load environments. Therefore, multiple route refresh requests may
happen before the pruning routine starts, leading to this situation:

| Prune begin |    x+k    |     x+k     |    x -> x+k   |       x      |
  ... or even
| Prune begin |   x+k+1   |     x+k     |    x -> x+k   |       x      |
  ... if the prune event starts while another route refresh is running.

In such a case, the pruning routine still deletes routes not fitting
between stale_set and and stale_valid, effectively pruning the remnants
of all unpruned route refreshes from before:

| Prune end   |    x+k    |     x+k     |       x+k     |      x+k     |

In extremely rare cases, there may happen too many route refreshes
before any route prune routine finishes. If the difference between
stale_valid and stale_pruned becomes more than 128 when requesting for
another route refresh, the routine walks the table synchronously and
resets all the stale values to a base state, while logging a warning.
2022-07-12 12:22:41 +02:00
Maria Matejka
6b0368cc2c Export tables merged with BGP prefix hash
Until now, if export table was enabled, Nest was storing exactly the
route before rt_notify() was called on it. This was quite sloppy and
spooky and it also wasn't reflecting the changes BGP does before
sending. And as BGP is storing the routes to be sent anyway, we are
simply keeping the already-sent routes in there to better rule out
unneeded reexports.

Some of the route attributes (IGP metric, preference) make no sense in
BGP, therefore these will be probably replaced by something sensible.
Also the nexthop shown in the short output is the BGP nexthop.
2022-07-11 16:07:09 +02:00
Maria Matejka
2e5bfeb73a Merge remote-tracking branch 'origin/master' into backport 2022-07-11 11:08:10 +02:00
Maria Matejka
d429bc5c84 Merge commit 'beb5f78a' into backport 2022-07-11 10:41:17 +02:00
Maria Matejka
7e9cede1fd Merge version 2.0.10 into backport 2022-07-10 14:19:24 +02:00
Ondrej Zajicek (work)
a2527ee53d Filter: Improve handling of stack frames in filter bytecode
When f_line is done, we have to pop the stack frame. The old code just
removed nominal number of args/vars. Change it to use stored ventry value
modified by number of returned values. This allows to allocate variables
on a stack frame during execution of f_lines instead of just at start.

But we need to know the number of returned values for a f_line. It is 1
for term, 0 for cmd. Store that to f_line during linearization.
2022-06-27 21:13:32 +02:00
Maria Matejka
beb5f78ada Preexport callback now takes the channel instead of protocol as argument
Passing protocol to preexport was in fact a historical relic from the
old times when channels weren't a thing. Refactoring that to match
current extensibility needs.
2022-06-27 19:04:24 +02:00
Maria Matejka
bdd6f72839 Moved nexthop + hostentry display to other eattrs 2022-06-27 13:39:28 +02:00
Maria Matejka
d2142ad405 Fixed displaying BGP and RIP attributes after recent reworks 2022-06-27 12:32:47 +02:00
Maria Matejka
13ef5e53dd The show-route CLI command now uses the route export API
In the multithreaded environment, it is not supposed that anybody
traverses the routing table as the CLI show-route was doing. Now the
routing table traversal is gone and CLI won't hold the table locked
while computing filters.
2022-06-27 12:32:47 +02:00
Maria Matejka
9c9059fd17 Allowed optimized exporting of a subprefix tree
Added an option for export filter to allow for prefiltering based on the
prefix. Routes outside the given prefix are completely ignored. Config
is simple:

	export in <net> <filter>;
2022-06-24 15:49:08 +02:00
Maria Matejka
becab5072d Import tables are stored as an attribute layer inside the main tables.
The separate import tables were too memory-greedy, there is no need for
them being stored as full-sized tables.
2022-06-20 11:56:38 +02:00
Maria Matejka
8c92f47ac7 Route attribute storage keeps the previous layers 2022-06-17 10:55:23 +02:00
Maria Matejka
54d94f4b1a Showing the nexthop resolution target in import tables 2022-06-16 12:39:08 +02:00
Maria Matejka
4364ee9b6f Merge commit '938742decc6e1d6d3a0375dd012b75172e747bbc' into haugesund 2022-06-08 15:31:28 +02:00
Maria Matejka
cae5979871 Merge commit '950775f6fa3d569a9d7cd05e33538d35e895d688' into haugesund
There were quite a lot of conflicts in flowspec validation code which
ultimately led to some code being a bit rewritten, not only adapted from
this or that branch, yet it is still in a limit of a merge.
2022-06-08 11:47:49 +02:00
Maria Matejka
8fd3811d9d Fixing FlowSpec validation for v3 internal API
Validation is called internally from route table at the same place where
nexthop resolution is done. Also accounting for rte->sender semantics
change (not a channel but the import hook instead).
2022-06-07 12:18:25 +02:00
Ondrej Zajicek
ad686c55c3 Babel: Do not try to remove multicast seqno request objects from neighbour list
The Babel seqno request code keeps track of which seqno requests are
outstanding for a neighbour by putting them onto a per-neighbour list. When
reusing a seqno request, it will try to remove this node, but if the seqno
request in question was a multicast request with no neighbour attached this
will result in a crash because it tries to remove a list node that wasn't
added to any list.

Fix this by making the list remove conditional. Also fix neighbor removal
which were changing seqno requests to multicast ones instead of removing
them.

Fixes: ebd5751cde ("Babel: Seqno requests are properly decoupled from
neighbors when the underlying interface disappears").

Based on the patch from Toke Høiland-Jørgensen <toke@toke.dk>,
bug reported by Stefan Haller <stefan.haller@stha.de>, thanks.
2022-06-05 04:11:32 +02:00
Maria Matejka
ea109ce3e3 Merge commit '4fe9881d625f10e44109a649e369a413bd98de71' into haugesund 2022-05-31 12:51:34 +02:00
Maria Matejka
1493695c6b Merge commit 'f15f2fcee7eeb5a100bd204a0e67018e25953420' into haugesund 2022-05-30 17:37:08 +02:00
Maria Matejka
7b0c89a47f Merge commit 'f2e725a76882ba6b75c3ce4fb3c760bd83462410' into haugesund 2022-05-30 17:27:03 +02:00
Maria Matejka
41508ceac3 Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesund 2022-05-30 17:26:25 +02:00
Maria Matejka
65254128e1 Merge commit '702c04fbef222e802ca4dfac645dc75ede522db6' into haugesund 2022-05-30 17:18:46 +02:00
Maria Matejka
1a92ee9d4d Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesund 2022-05-30 17:18:03 +02:00
Maria Matejka
674587d9c8 Merge commit 'd8661a4397e4576ac404661b192dd99d928e7890' into haugesund 2022-05-30 17:11:30 +02:00
Maria Matejka
5051e3c4af Merge commit '17f91f9e6e70f7e3f29502e854823c0d48571eaa' into haugesund 2022-05-30 16:59:24 +02:00
Maria Matejka
b7e2edd441 Merge commit '1d309c4ce6e95b68c64a8f007f6dd2f1830a5707' into haugesund 2022-05-30 16:48:17 +02:00
Maria Matejka
d7bec897ab Merge commit 'ef4313e1667a8745c8d8813ac78342ec7c035895' into haugesund 2022-05-30 16:47:30 +02:00
Maria Matejka
e16e1e4138 Merge commit 'f2f3163f6c3fba7f9ef03640d7b2f6323873d2cc' into haugesund 2022-05-30 16:41:15 +02:00
Maria Matejka
0097f24e2e Merge commit 'de86040b2cf4ec9bfbb64f0e208a19d4d7e51adc' into haugesund 2022-05-30 16:21:48 +02:00
Maria Matejka
86ac1045d7 Merge commit '3fb70b26faca6788aa0bdf1d558414f9f777c6cd' into haugesund 2022-05-30 16:21:02 +02:00
Maria Matejka
b3649ec77e Merge commit 'ef6a903e6f44b467f9606018446095521ad01ef1' into haugesund 2022-05-30 16:20:35 +02:00
Maria Matejka
54344f15f8 Merge commit '0d0f6554a5c233bf2bf830ae319191c4b1808d49' into haugesund 2022-05-30 15:43:13 +02:00
Maria Matejka
3752654852 Merge commit '80272d4b64a38ee6f04a1c4e8566cac3a2293176' into haugesund 2022-05-30 15:39:32 +02:00
Maria Matejka
45af19dd99 Merge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund 2022-05-30 15:36:54 +02:00
Maria Matejka
ef3a8138c9 Merge commit '98fd158e28d89f10ee7a41b4f6a14fbd0021ef35' into haugesund 2022-05-30 15:35:29 +02:00
Maria Matejka
81aeccbb00 Merge commit 'd39ef961d1dde230c55fcc931b53f44cb34a1e63' into haugesund 2022-05-30 15:32:11 +02:00
Maria Matejka
d7b077f5d6 Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesund 2022-05-30 15:31:19 +02:00