]> git.ipfire.org Git - thirdparty/bird.git/log
thirdparty/bird.git
21 months agoMerge branch 'vv-test' into proto-snmp
Vojtech Vilimek [Thu, 19 Oct 2023 14:32:38 +0000 (16:32 +0200)] 
Merge branch 'vv-test' into proto-snmp

21 months agoSNMP: Bare support for agentx-TestSet-PDU
Vojtech Vilimek [Thu, 19 Oct 2023 14:27:04 +0000 (16:27 +0200)] 
SNMP: Bare support for agentx-TestSet-PDU

21 months agoSNMP: Code improvements
Vojtech Vilimek [Thu, 19 Oct 2023 14:20:37 +0000 (16:20 +0200)] 
SNMP: Code improvements

21 months agoSNMP: Remove old code
Vojtech Vilimek [Thu, 19 Oct 2023 14:08:13 +0000 (16:08 +0200)] 
SNMP: Remove old code

21 months agofixup! An unexpected NULL pilgrim
Vojtech Vilimek [Thu, 19 Oct 2023 14:03:22 +0000 (16:03 +0200)] 
fixup! An unexpected NULL pilgrim

21 months agoSNMP: Refactoring - Comments, Logging
Vojtech Vilimek [Wed, 18 Oct 2023 16:06:24 +0000 (18:06 +0200)] 
SNMP: Refactoring - Comments, Logging

21 months agoSNMP: Refactoring - Comments, Logging
Vojtech Vilimek [Wed, 18 Oct 2023 16:06:24 +0000 (18:06 +0200)] 
SNMP: Refactoring - Comments, Logging

21 months agoSNMP: Add bgp trie cleanup
Vojtech Vilimek [Wed, 18 Oct 2023 14:51:21 +0000 (16:51 +0200)] 
SNMP: Add bgp trie cleanup

21 months agoSNMP: Minor changes in get, get_next handling
Vojtech Vilimek [Wed, 18 Oct 2023 11:30:14 +0000 (13:30 +0200)] 
SNMP: Minor changes in get, get_next handling

21 months agoSNMP: BGP4-MIB add LocalIdentifier
Vojtech Vilimek [Wed, 11 Oct 2023 08:44:18 +0000 (10:44 +0200)] 
SNMP: BGP4-MIB add LocalIdentifier

22 months agoSNMP: Context support and improved registering
Vojtech Vilimek [Mon, 11 Sep 2023 11:06:20 +0000 (13:06 +0200)] 
SNMP: Context support and improved registering

23 months agoSNMP: Refactoring
Vojtech Vilimek [Mon, 4 Sep 2023 12:01:08 +0000 (14:01 +0200)] 
SNMP: Refactoring

23 months agoSNMP: Add timeout config option, refactoring
Vojtech Vilimek [Mon, 4 Sep 2023 11:58:59 +0000 (13:58 +0200)] 
SNMP: Add timeout config option, refactoring

23 months agoSNMP: BGP4-MIB notifications
Vojtech Vilimek [Mon, 4 Sep 2023 11:53:45 +0000 (13:53 +0200)] 
SNMP: BGP4-MIB notifications

23 months agoSNMP: Refactoring (readability)
Vojtech Vilimek [Mon, 4 Sep 2023 11:51:29 +0000 (13:51 +0200)] 
SNMP: Refactoring (readability)

23 months agoSNMP: Refactoring (order)
Vojtech Vilimek [Mon, 4 Sep 2023 11:48:28 +0000 (13:48 +0200)] 
SNMP: Refactoring (order)

23 months agoSNMP: Remove transmit hook, new macros
Vojtech Vilimek [Mon, 4 Sep 2023 11:46:02 +0000 (13:46 +0200)] 
SNMP: Remove transmit hook, new macros

23 months agoTesting Notify-PDU
Vojtech Vilimek [Mon, 4 Sep 2023 07:25:51 +0000 (09:25 +0200)] 
Testing Notify-PDU

23 months agoMinor bugfix
Vojtech Vilimek [Wed, 30 Aug 2023 15:22:52 +0000 (17:22 +0200)] 
Minor bugfix

23 months agoBig code cleanup
Vojtech Vilimek [Tue, 8 Aug 2023 19:51:38 +0000 (21:51 +0200)] 
Big code cleanup

23 months agoBugfixes
Vojtech Vilimek [Tue, 8 Aug 2023 18:47:30 +0000 (20:47 +0200)] 
Bugfixes

23 months agoFix BGP identifier values in BGP4-MIB
Vojtech Vilimek [Tue, 8 Aug 2023 17:45:50 +0000 (19:45 +0200)] 
Fix BGP identifier values in BGP4-MIB

23 months agoRegister-PDU distinguish between instance/tree reg.
Vojtech Vilimek [Tue, 8 Aug 2023 17:00:54 +0000 (19:00 +0200)] 
Register-PDU distinguish between instance/tree reg.

Other changes include simplification of large TX buffer when it's insufficient
and purge of additional_buffer.

23 months agoExtension for varbind TimeTicks, varbind type sizes
Vojtech Vilimek [Tue, 8 Aug 2023 15:00:20 +0000 (17:00 +0200)] 
Extension for varbind TimeTicks, varbind type sizes

2 years agofixed snmp_test.c test suite
Vojtech Vilimek [Wed, 26 Jul 2023 12:34:55 +0000 (14:34 +0200)] 
fixed snmp_test.c test suite

2 years agomainly visual tweaks
Vojtech Vilimek [Wed, 26 Jul 2023 12:34:01 +0000 (14:34 +0200)] 
mainly visual tweaks

2 years agochanges in subagent.c API
Vojtech Vilimek [Wed, 26 Jul 2023 12:30:34 +0000 (14:30 +0200)] 
changes in subagent.c API

2 years agochanges in bgp_mib.c API (mainly)
Vojtech Vilimek [Wed, 26 Jul 2023 12:02:23 +0000 (14:02 +0200)] 
changes in bgp_mib.c API (mainly)

2 years agoAdd missing prefix file
Vojtech Vilimek [Tue, 11 Jul 2023 12:44:49 +0000 (14:44 +0200)] 
Add missing prefix file

2 years agocode cleanup
Vojtech Vilimek [Tue, 11 Jul 2023 12:32:27 +0000 (14:32 +0200)] 
code cleanup

2 years agoCompleted trie API changes
Vojtech Vilimek [Tue, 11 Jul 2023 12:23:07 +0000 (14:23 +0200)] 
Completed trie API changes

Minor bug fixes in trie_walk_init() with associated tests.

2 years agochanges in trie_walk_init() - preview
Vojtech Vilimek [Thu, 6 Jul 2023 10:02:42 +0000 (12:02 +0200)] 
changes in trie_walk_init() - preview

2 years agotests pass (several times)
Vojtech Vilimek [Wed, 5 Jul 2023 09:59:10 +0000 (11:59 +0200)] 
tests pass (several times)

2 years agotemporal
Vojtech Vilimek [Tue, 4 Jul 2023 08:07:40 +0000 (10:07 +0200)] 
temporal

2 years agotmp: tmp progress on trie API
Vojtech Vilimek [Fri, 28 Apr 2023 09:10:01 +0000 (11:10 +0200)] 
tmp: tmp progress on trie API

2 years agotmp: enhancements in trie api changes
Vojtech Vilimek [Fri, 14 Apr 2023 09:30:55 +0000 (11:30 +0200)] 
tmp: enhancements in trie api changes

2 years agoExtend the trie_walk_init api + test
Vojtech Vilimek [Fri, 7 Apr 2023 15:27:20 +0000 (17:27 +0200)] 
Extend the trie_walk_init api + test

The trie_walk_init() function now supports also searching whole trie
subnet and all successor subnets (in lexicographic order). This behavior
can be accomplished by setting @net, and @include_successors to subnet,
and non-zero respectivelly.

2 years agotmp: minor changes
Vojtech Vilimek [Fri, 31 Mar 2023 07:56:39 +0000 (09:56 +0200)] 
tmp: minor changes

2 years agotmp: minor changes
Vojtech Vilimek [Fri, 31 Mar 2023 07:56:03 +0000 (09:56 +0200)] 
tmp: minor changes

2 years agotmp: minor changes + fixed tests
Vojtech Vilimek [Fri, 24 Mar 2023 14:02:23 +0000 (15:02 +0100)] 
tmp: minor changes + fixed tests

2 years agotmp: add new bgp mib entry support (bgpPeerTable)
Vojtech Vilimek [Fri, 24 Mar 2023 14:01:35 +0000 (15:01 +0100)] 
tmp: add new bgp mib entry support (bgpPeerTable)

2 years agotmp: add new helper function
Vojtech Vilimek [Fri, 24 Mar 2023 14:00:54 +0000 (15:00 +0100)] 
tmp: add new helper function

2 years agotmp: fix parsing multiple in rx buffer
Vojtech Vilimek [Tue, 14 Mar 2023 13:10:08 +0000 (14:10 +0100)] 
tmp: fix parsing multiple in rx buffer

2 years agotmp: minor changes
Vojtech Vilimek [Tue, 14 Mar 2023 13:09:45 +0000 (14:09 +0100)] 
tmp: minor changes

2 years agocode cleanup
Vojtech Vilimek [Sat, 17 Dec 2022 17:24:05 +0000 (18:24 +0100)] 
code cleanup

2 years agotmp
Vojtech Vilimek [Sat, 17 Dec 2022 17:16:19 +0000 (18:16 +0100)] 
tmp

2 years agotmp: compiles and runs
Vojtech Vilimek [Sat, 10 Dec 2022 17:08:00 +0000 (18:08 +0100)] 
tmp: compiles and runs

2 years agosnmp reconnect
Vojtech Vilimek [Sat, 10 Dec 2022 12:23:50 +0000 (13:23 +0100)] 
snmp reconnect

2 years agosnmp_log() wrapper
Vojtech Vilimek [Sat, 10 Dec 2022 12:22:37 +0000 (13:22 +0100)] 
snmp_log() wrapper

2 years agotmp
Vojtech Vilimek [Tue, 6 Dec 2022 15:32:26 +0000 (16:32 +0100)] 
tmp

2 years agotmp: compiles
Vojtech Vilimek [Tue, 29 Nov 2022 15:30:20 +0000 (16:30 +0100)] 
tmp: compiles

2 years agomoving shared parts to snmp_utils
Vojtech Vilimek [Tue, 22 Nov 2022 13:16:09 +0000 (14:16 +0100)] 
moving shared parts to snmp_utils

2 years agotmp: compiles
Vojtech Vilimek [Sat, 19 Nov 2022 22:00:02 +0000 (23:00 +0100)] 
tmp: compiles

2 years agofix the Get and GetNext
Vojtech Vilimek [Tue, 15 Nov 2022 15:29:03 +0000 (16:29 +0100)] 
fix the Get and GetNext

missing some functionality around GetBulk

2 years agotmp: compiles, first tests
Vojtech Vilimek [Sat, 5 Nov 2022 15:29:00 +0000 (16:29 +0100)] 
tmp: compiles, first tests

2 years agoTMP: compiles and runs
Vojtech Vilimek [Fri, 30 Sep 2022 07:36:09 +0000 (09:36 +0200)] 
TMP: compiles and runs

2 years agoTMP: work on Get-PDU and GetNext-PDU
Vojtech Vilimek [Tue, 20 Sep 2022 12:28:57 +0000 (14:28 +0200)] 
TMP: work on Get-PDU and GetNext-PDU

2 years agoTMP new snmp PDUs
Vojtech Vilimek [Tue, 6 Sep 2022 16:04:29 +0000 (18:04 +0200)] 
TMP new snmp PDUs

2 years agoTMP: compiles, some pdus working
Vojtech Vilimek [Wed, 10 Aug 2022 15:31:32 +0000 (17:31 +0200)] 
TMP: compiles, some pdus working

3 years agoTMP: code cleanup - remove trailing whitespace
Vojtech Vilimek [Tue, 2 Aug 2022 14:12:09 +0000 (16:12 +0200)] 
TMP: code cleanup - remove trailing whitespace

3 years agoTMP: proto-snmp compiles and connects to master
Vojtech Vilimek [Tue, 2 Aug 2022 14:04:25 +0000 (16:04 +0200)] 
TMP: proto-snmp compiles and connects to master

3 years agoRefactor of struct channel and channel_config
Vojtech Vilimek [Wed, 20 Jul 2022 10:25:20 +0000 (12:25 +0200)] 
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).

3 years agoInitial commit for new protocol `snmp'
Vojtech Vilimek [Mon, 1 Aug 2022 11:01:49 +0000 (13:01 +0200)] 
Initial commit for new protocol `snmp'

3 years agoSending an event must also ping the target IO loop
Maria Matejka [Thu, 28 Jul 2022 17:52:19 +0000 (19:52 +0200)] 
Sending an event must also ping the target IO loop

3 years agoMoved the thread starting code to IO loop code
Maria Matejka [Thu, 28 Jul 2022 17:49:03 +0000 (19:49 +0200)] 
Moved the thread starting code to IO loop code

3 years agoMerge commit '03bf6b90' into thread-next
Maria Matejka [Thu, 28 Jul 2022 17:22:58 +0000 (19:22 +0200)] 
Merge commit '03bf6b90' into thread-next

3 years agoRevert "Adding a generic cork mechanism for events"
Maria Matejka [Thu, 28 Jul 2022 17:22:48 +0000 (19:22 +0200)] 
Revert "Adding a generic cork mechanism for events"

This reverts commit 6e841b3153565632b6753f6b1fe74850c37f2808.

3 years agoEvent lists rewritten to a single linked list
Maria Matejka [Fri, 24 Jun 2022 17:53:34 +0000 (19:53 +0200)] 
Event lists rewritten to a single linked list

In multithreaded environment, we need to pass messages between workers.
This is done by queuing events to their respective queues. The
double-linked list is not really useful for that as it needs locking
everywhere.

This commit rewrites the event subsystem to use a single-linked list
where events are enqueued by a single atomic instruction and the queue
is processed after atomically moving the whole queue aside.

3 years agoMerge commit '94eb0858' into thread-next
Maria Matejka [Mon, 18 Jul 2022 10:33:00 +0000 (12:33 +0200)] 
Merge commit '94eb0858' into thread-next

3 years agoMerge commit 'a4451535' into thread-next
Maria Matejka [Mon, 18 Jul 2022 09:11:46 +0000 (11:11 +0200)] 
Merge commit 'a4451535' into thread-next

3 years agoFixed an annoying warning in ea_get_storage()
Maria Matejka [Mon, 18 Jul 2022 08:56:20 +0000 (10:56 +0200)] 
Fixed an annoying warning in ea_get_storage()

3 years agoFixing build issues caused by a nonportable Makefile rule
Maria Matejka [Mon, 18 Jul 2022 08:26:55 +0000 (10:26 +0200)] 
Fixing build issues caused by a nonportable Makefile rule

3 years agoMerge commit 'a845651b' into thread-next
Maria Matejka [Mon, 18 Jul 2022 08:19:59 +0000 (10:19 +0200)] 
Merge commit 'a845651b' into thread-next

3 years agoMerge commit 'c70b3198' into thread-next [lots of conflicts]
Maria Matejka [Fri, 15 Jul 2022 12:57:02 +0000 (14:57 +0200)] 
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.

3 years agoFixed invalid routes handling
Maria Matejka [Thu, 14 Jul 2022 09:09:23 +0000 (11:09 +0200)] 
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.

3 years agoMerge branch 'backport' into thread-next
Maria Matejka [Wed, 13 Jul 2022 12:46:36 +0000 (14:46 +0200)] 
Merge branch 'backport' into thread-next

3 years agoMerge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-next
Maria Matejka [Wed, 13 Jul 2022 12:14:37 +0000 (14:14 +0200)] 
Merge commit '2e5bfeb73ac25e236a24b6c1a88d0f2221ca303f' into thread-next

3 years agoMerge commit 'd429bc5c841a8e9d4c81786973edfa56d20a407e' into thread-next
Maria Matejka [Wed, 13 Jul 2022 10:54:20 +0000 (12:54 +0200)] 
Merge commit 'd429bc5c841a8e9d4c81786973edfa56d20a407e' into thread-next

3 years agoMerge commit '7e9cede1fd1878fb4c00e793bccd0ca6c18ad452' into thread-next
Maria Matejka [Wed, 13 Jul 2022 10:02:34 +0000 (12:02 +0200)] 
Merge commit '7e9cede1fd1878fb4c00e793bccd0ca6c18ad452' into thread-next

3 years agoFixed bug in repeated show route command
Maria Matejka [Wed, 13 Jul 2022 09:19:00 +0000 (11:19 +0200)] 
Fixed bug in repeated show route command

Introduced by 13ef5e53dd4a98c80261139b4c9ce4b1074cac40, the CLI was not
properly cleaned up when the command finished, causing BIRD to not parse
any other command after "show route".

3 years agoMerge commit 'f18968f5' into thread-next
Maria Matejka [Tue, 12 Jul 2022 13:05:04 +0000 (15:05 +0200)] 
Merge commit 'f18968f5' into thread-next

3 years agoMerge commit '1df20989' into thread-next
Maria Matejka [Tue, 12 Jul 2022 12:46:17 +0000 (14:46 +0200)] 
Merge commit '1df20989' into thread-next

3 years agoRevert "Special table hooks rectified."
Maria Matejka [Tue, 12 Jul 2022 12:46:06 +0000 (14:46 +0200)] 
Revert "Special table hooks rectified."

This reverts commit 44f26c49f966ca842ff9af55468de0b98c44b73e.

3 years agoRemoving the rte_modify API
Maria Matejka [Tue, 12 Jul 2022 10:40:18 +0000 (12:40 +0200)] 
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.

3 years agoRoute refresh in tables uses a stale counter.
Maria Matejka [Tue, 12 Jul 2022 08:36:10 +0000 (10:36 +0200)] 
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.

3 years agoThere are now no internal tables at all.
Maria Matejka [Mon, 11 Jul 2022 15:08:59 +0000 (17:08 +0200)] 
There are now no internal tables at all.

3 years agoDropped the internal kernel protocol table for learnt routes.
Maria Matejka [Mon, 11 Jul 2022 15:04:52 +0000 (17:04 +0200)] 
Dropped the internal kernel protocol table for learnt routes.

The learnt routes are now pushed all into the connected table, not only
the best one. This shouldn't do any damage in well managed setups, yet
it should be noted that it is a change of behavior.

If anybody misses a feature which they implemented by misusing this
internal learn table, let us know, we'll consider implementing it in a
better way.

3 years agoExport tables merged with BGP prefix hash
Maria Matejka [Mon, 20 Jun 2022 17:10:49 +0000 (19:10 +0200)] 
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.

3 years agoHash: iterable now per partes by an iterator
Maria Matejka [Wed, 29 Jun 2022 11:22:40 +0000 (13:22 +0200)] 
Hash: iterable now per partes by an iterator

It's now possible to pause iteration through hash. This requires
struct hash_iterator to be allocated somewhere handy.

The iteration itself is surrounded by HASH_WALK_ITER and
HASH_WALK_ITER_END. Call HASH_WALK_ITER_PUT to ask for pausing; it may
still do some more iterations until it comes to a suitable pausing
point. The iterator must be initalized to an empty structure. No cleanup
is needed if iteration is abandoned inbetween.

3 years agoDo not try to check flowspec validity for piped routes
Maria Matejka [Wed, 29 Jun 2022 10:51:07 +0000 (12:51 +0200)] 
Do not try to check flowspec validity for piped routes

3 years agoFixed bad import table attributes freeing
Maria Matejka [Tue, 28 Jun 2022 10:57:18 +0000 (12:57 +0200)] 
Fixed bad import table attributes freeing

3 years agoAttribute lists split to storage headers and data to save BGP memory
Maria Matejka [Tue, 28 Jun 2022 08:51:00 +0000 (10:51 +0200)] 
Attribute lists split to storage headers and data to save BGP memory

3 years agoShow route uses the export request also for one-net queries
Maria Matejka [Mon, 27 Jun 2022 17:53:06 +0000 (19:53 +0200)] 
Show route uses the export request also for one-net queries

3 years agoAdded forgotten route source locking in flowspec validation
Maria Matejka [Mon, 11 Jul 2022 11:04:01 +0000 (13:04 +0200)] 
Added forgotten route source locking in flowspec validation

3 years agoMerge remote-tracking branch 'origin/master' into backport
Maria Matejka [Mon, 11 Jul 2022 09:08:10 +0000 (11:08 +0200)] 
Merge remote-tracking branch 'origin/master' into backport

3 years agoMerge commit 'beb5f78a' into backport
Maria Matejka [Mon, 11 Jul 2022 08:41:17 +0000 (10:41 +0200)] 
Merge commit 'beb5f78a' into backport

3 years agoMerge version 2.0.10 into backport
Maria Matejka [Sun, 10 Jul 2022 12:19:24 +0000 (14:19 +0200)] 
Merge version 2.0.10 into backport

3 years agoFilter: Implement for loops
Ondrej Zajicek (work) [Mon, 14 Mar 2022 19:36:20 +0000 (20:36 +0100)] 
Filter: Implement for loops

For loops allow to iterate over elements in compound data like BGP paths
or community lists. The syntax is:

  for [ <type> ] <variable> in <expr> do <command-body>

3 years agoFilter: Implement mixed declarations of local variables
Ondrej Zajicek (work) [Thu, 10 Mar 2022 00:02:45 +0000 (01:02 +0100)] 
Filter: Implement mixed declarations of local variables

Allow variable declarations mixed with code, also in nested blocks with
proper scoping, and with variable initializers. E.g:

function fn(int a)
{
  int b;
  int c = 10;

  if a > 20 then
  {
    b = 30;
    int d = c * 2;
    print a, b, c, d;
  }

  string s = "Hello";
}

3 years agoFilter: Improve handling of stack frames in filter bytecode
Ondrej Zajicek (work) [Wed, 9 Mar 2022 01:32:29 +0000 (02:32 +0100)] 
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.