0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-19 11:55:21 +00:00
Commit Graph

589 Commits

Author SHA1 Message Date
Trisha Biswas
e5468d1685 Filter: Add MPLS label route attribute
Add support to set or read outgoing MPLS labels using filters. Currently
this supports the addition of one label per route for the first next hop.

Minor changes by committer.
2021-05-17 17:50:04 +02:00
Ondrej Zajicek (work)
94abefc00b Filter: Update 'gw' to handle IPv6 link-local addresses
When a link-local address is set, use the existing iface for scope.

Thanks to Marcel Krüger for the bugreport.
2021-03-15 18:37:18 +01:00
Ondrej Zajicek (work)
d06a875b04 Filter: Recursive filter iteration code
Add macros for recursive filter iteration that allows to examine
all instructions reachable from a filter.
2021-02-07 19:21:42 +01:00
Ondrej Zajicek (work)
9e2635505a Filter: Fix return on top-level
Broken detection of top-level case caused crash when return was called
from top-of-stack position. It should behave as reject/accept.

Thanks to Damian Zaremba for the bugreport.
2020-12-28 15:23:28 +01:00
Ondrej Zajicek (work)
8cc5bb09e3 Filter: Add 'weight' route attribute
Add 'weight' route attribute that allows to get and set ECMP weight of
nexthops. Similar to 'gw' attribute, it is limited to the first nexthop,
but it is useful for handling BGP multipath, where an ECMP route is
merged from multiple regular routes.
2020-12-02 05:02:26 +01:00
Ondrej Zajicek (work)
30b8468269 Minor cleanups with cfg_allocz()
Also fixes some more failed asserts due to add_tail().
2020-11-24 04:09:11 +01:00
Kazuki Yamaguchi
a948cf9a5c Filter: Improve handling of sets in BGP path masks
Compare the content of PM_ASN_SET in path masks. A reconfiguration
was not properly triggering a reload of affected protocols when the
members of a set in a path mask change.

Also, update the printing code to so that it can display sets in a path
mask.
2020-06-28 15:37:01 +02:00
Kazuki Yamaguchi
4ef0a96639 Filter: Fix comparison of BGP path mask
Add a missing return statement. Path masks with the same length were all
considered the same. Comparing two with different length would cause
out-of-bounds memory access.
2020-06-28 15:33:26 +02:00
Ondrej Zajicek (work)
ec430a7fee Nest: Implement BGP path mask loop operator
Implement regex-like '+' operator in BGP path masks to match previous
path mask item multiple times. This is useful as ASNs may appear
multiple times in paths due to path prepending for traffic engineering
purposes.
2020-05-18 16:25:08 +02:00
Ondrej Zajicek (work)
82bfee76f0 Filter: Remove quitbird command
No need for this debug filter command and it can be abused from CLI.
2020-05-02 02:47:18 +02:00
Maria Matejka
d65a926a67 Filter: Don't alloc varargs array if its length would be zero 2020-05-01 15:19:12 +02:00
Maria Matejka
30ba7c1661 Filter: Removed forgotten dead code 2020-05-01 15:19:12 +02:00
Maria Matejka
124d860f64 Filter: fixed omitted overflow check in EC constructor 2020-04-28 16:21:06 +02:00
Maria Matejka
fd9f0c0640 Configuration strings are constant.
This is merely a const propagation. There was no problem in there.
2020-04-09 15:37:14 +02:00
Ondrej Zajicek (work)
c9d11e6230 Filter: Remove mixed address tests and fix formatting 2020-03-26 04:59:15 +01:00
Ondrej Zajicek (work)
2755002890 Filter: Optimize IPv4 prefix sets
Use separate IPv4 and IPv6 implementation of prefix sets. Just this
change makes IPv4 prefix sets 60% smaller and 50% faster.
2020-03-26 03:57:48 +01:00
Ondrej Zajicek (work)
ef8c45749c Filter: Fix typecheck for AND/OR.
Do not apply dynamic type check for second argument of AND/OR, as it is
not evaluated immediately like regular argument would be.

Thanks to Mikael for the bugreport.
2020-01-07 01:24:30 +01:00
Ondrej Zajicek (work)
3dabf7b8d0 Test: Improve filter_test
Initial parsing of test.conf must be done directly in filter_test main,
while reconfiguration is handled as a regular test. Also fix several
minor issues in test code.
2019-12-17 00:01:53 +01:00
Maria Matejka
d3aa4f2aed Filter: fix filter comparison test 2019-12-12 15:42:46 +01:00
Ondrej Zajicek (work)
dfb3eb7716 Filter: Fix function comparison
Check the SYM_FLAG_SAME in new symbols. The old code checked that
in old symbols (f2).
2019-12-10 18:53:16 +01:00
Ondrej Zajicek (work)
ff2ca10cba Filter: Add support for src/dst accessors for Flowspec and SADR 2019-12-09 04:23:01 +01:00
Ondrej Zajicek (work)
10c4cd9677 Filter: Add type info for more instructions 2019-11-05 15:30:20 +01:00
Ondrej Zajicek (work)
87512e9751 Filter: Improve typecheck error messages 2019-11-05 15:30:16 +01:00
Ondrej Zajicek (work)
c00c20a799 Filter: Better constant promotion
We use constant promotion from IPv4 to Router-ID values, as they have
same literals. Instead of ad-hoc code in filter instructions, add
constant promotion code to parse-time typecheck code.
2019-11-05 15:28:47 +01:00
Ondrej Zajicek (work)
26194bd684 Filter: Improved parse-time typechecks 2019-11-05 15:28:47 +01:00
Ondrej Zajicek
6fbcd8914a Filter: Parse-time typechecks
Most expressions can be type-validated in parse time. It is not
strong enough to eliminate runtime checks, but at least one gets
errors immediately during reconfigure.
2019-11-05 15:28:47 +01:00
Ondrej Zajicek (work)
0edf0c8cd9 Support for address family constants
We already had them defined on BGP level, but they are more general.
2019-11-03 22:25:44 +01:00
Ondrej Zajicek (work)
ea0917bcba Filter: Fix eval command 2019-09-24 00:18:48 +02:00
Maria Matejka
3f477ccb03 Filters: Function body comparison result now used.
Function bodies were compared in post-parse time, yet the result was not
used and the functions were incorrectly considered the same as before.

Now the result is used to reload affected protocols.
2019-09-23 14:03:26 +02:00
Ondrej Zajicek (work)
452e90ba72 Filter: Fix crash with 'where' filters and function calls
The old 'where' code computed size value incorrectly, which leads
to invalid instruction lines and filter errors or crashes.
2019-09-10 13:45:18 +02:00
Maria Matejka
dfe63ed84d Filter: Fixing empty block and never-executed-statement bug 2019-08-13 16:45:27 +02:00
Ondrej Zajicek (work)
9f3e098320 Filter: Allow to use set constants / expressions in path masks
Allow to not only use set literals in path masks, but also existing
set constants or set expressions.
2019-08-06 18:54:19 +02:00
Ondrej Zajicek (work)
ef113c6f72 Filter: Allow to use sets in path masks 2019-08-06 16:58:13 +02:00
Maria Matejka
2de1e2062e Conf: Fixed symbol redefinition 2019-07-30 14:28:40 +02:00
Maria Matejka
efd7c87b5b Filter: further split of print & die to FI_PRINT, FI_FLUSH and FI_DIE 2019-07-15 15:46:36 +02:00
Maria Matejka
3782454e8d Filter: Simpler filter context allocation 2019-07-15 15:46:36 +02:00
Maria Matejka
f634adc7dc Filter: FID_MEMBER debug string is a C constant string 2019-07-15 15:17:04 +02:00
Maria Matejka
c0999a149c Filter: Converted FI_PRINT and FI_PATHMASK_CONSTRUCT to VARARG 2019-07-15 15:12:18 +02:00
Maria Matejka
c29d73a06a Filter: fixed excessive stack allocation in functions with args but no local vars 2019-07-15 15:06:52 +02:00
Maria Matejka
0da06b7103 Filter: lots of documentation 2019-07-15 13:19:01 +02:00
Maria Matejka
1b9db6d4a7 Filter: Don't write out when re-evaluating filter for internal purposes. 2019-07-15 12:03:47 +02:00
Maria Matejka
547be53b8c Filter: Don't fail badly when trying to access non-existent route in config time 2019-07-15 12:03:13 +02:00
Ondrej Zajicek (work)
bfa15a642f Filter: Minor cleanups 2019-07-10 16:47:17 +02:00
Maria Matejka
8816b6cdd9 Merge branch 'mq-filter-stack' of gitlab.labs.nic.cz:labs/bird into mq-filter-stack 2019-07-03 08:44:42 +02:00
Maria Matejka
84ac62d396 Filter: CLI command to dump all the linearized filters 2019-07-03 08:27:56 +02:00
Maria Matejka
0206c070ac Filter: Split printing and dying 2019-07-03 08:27:56 +02:00
Maria Matejka
78976974e7 Dynamic attributes definition split whether it is bitmask or not. 2019-07-03 00:00:11 +02:00
Maria Matejka
263fa2c4a6 Filter: Dropped some more irrelevant whitespace from generated files 2019-07-02 22:57:00 +02:00
Maria Matejka
84c58aabd0 Filter: Nicer whitespaces in generated inst-gen.h 2019-07-02 17:59:21 +02:00
Maria Matejka
550a6488c9 Filter: documentation of the M4 preprocessor 2019-07-02 17:39:56 +02:00
Maria Matejka
c376555cec Filter: GCC, don't complain about indentation in generated code. 2019-07-02 13:13:29 +02:00
Maria Matejka
b40c0f028f Filter: Pre-evaluation of constant expressions 2019-07-02 10:45:53 +02:00
Maria Matejka
30667d5041 Filter: Resolving of defined constants in config time 2019-07-01 14:12:05 +02:00
Maria Matejka
26bfe59f45 Filter: Moved singleton member definitions to f-inst.c 2019-07-01 13:13:06 +02:00
Maria Matejka
4212c0e7e5 Filter: Moved f_inst allocation to separate function 2019-07-01 12:49:02 +02:00
Maria Matejka
f74d19765e Filter: Getting rid of RESULT_OK. Adding RESULT_VOID.
This is a preparation for filter pre-evaluation.
2019-07-01 12:07:06 +02:00
Maria Matejka
236828d06f Filter: The interpreter code now shares its diversion with constructor
This is a preparation for filter pre-evaluation.
2019-07-01 11:57:35 +02:00
Maria Matejka
63f49457dc Filter: renaming pointers for consistency
The struct f_inst * is now always "what"
and the union member pointer is always "whati".
2019-06-28 11:26:36 +02:00
Maria Matejka
64bb1346c7 Filter: A little cleanup of M4 interpreter generator 2019-06-27 23:57:59 +02:00
Maria Matejka
a8ab54d18d Merge remote-tracking branch 'refs/remotes/origin/mq-filter-stack' into mq-filter-stack 2019-06-25 22:40:05 +02:00
Maria Matejka
63e7620462 Conf/Filters: Moved argument count to conf scope 2019-06-25 16:18:06 +02:00
Maria Matejka
2e0777317f Filter instructions don't confuse now v1 and res. 2019-06-21 11:33:28 +02:00
Maria Matejka
a84b8b6ebb Revert "Filter: Dropped the setter instructions in favor of direct result storage."
This reverts commit bd91338246.
2019-06-19 14:09:57 +02:00
Maria Matejka
87c82334a7 Filter: removal of semantically insane consts in filter_commit 2019-06-13 14:24:48 +02:00
Maria Matejka
bd91338246 Filter: Dropped the setter instructions in favor of direct result storage.
This should help filter performance a bit.
2019-06-03 10:41:35 +02:00
Maria Matejka
aa6c5f4d92 Filter: Just a little comments in filter structure 2019-05-30 14:42:54 +02:00
Maria Matejka
1757a6fce5 Filter: Stacks moved to thread-local storage if available. 2019-05-29 21:03:52 +02:00
Jan Maria Matejka
6479e403ef Filters: If somebody doesn't like _Thread_local, don't fail for now, just be a little slower.
When the parallel execution comes into place, we'll likely enforce this
C11 feature. It's much simpler and also faster than pthread_[sg]etspecific().
2019-05-23 11:27:24 +00:00
Jan Maria Matejka
23e3b1e665 Filter: Some people can't pronounce "postfixify" correctly. Let's try "linearize" instead.
This is just a naming change.
2019-05-22 15:20:02 +00:00
Jan Maria Matejka
96d757c13f Filter: Store variables and function arguments on stack 2019-05-21 16:33:37 +00:00
Jan Maria Matejka
20c6ea70cc Filter: Making the filter state thread local.
While having the filter code still reentrant if we really need,
the compiler can now do constant propagation and address the
thread local storage directly to save some computation time.
2019-05-20 17:53:10 +00:00
Maria Matejka
9eef9c648c Lexer now returns known sym / unknown sym / keyword 2019-05-17 22:26:21 +02:00
Maria Matejka
fe503c7c06 Filter: fixed error-checking bug in !~ operator 2019-03-23 13:32:14 +01:00
Maria Matejka
8d65add626 Merge branch 'master' into HEAD 2019-03-18 12:54:40 +01:00
Ondrej Zajicek (work)
875cc073b0 Nest: Update handling of temporary attributes
The temporary atttributes are no longer removed by ea_do_prune(), but
they are undefined by store_tmp_attrs() protocol hooks. This fixes
several bugs where temporary attributes were removed when they should
not or not removed when they should be. The flag EAF_TEMP is no longer
needed and was removed.

Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use
helper functions and to handle unset attributes properly.

Also fix some related bugs like improper handling of empty eattr list.
2019-03-14 17:31:40 +01:00
Maria Matejka
e1ac6f1e30 Faster filters: documentation on what is happening there 2019-03-06 15:01:39 +01:00
Maria Matejka
f249d0b84c Filters: comparison of functions and filters caching 2019-02-26 16:44:24 +01:00
Maria Matejka
d1039926f5 Filter: Interpreter merged into the common m4 generator.
The config-time partial evaluation of constant expressions in filters is nearby.
2019-02-20 22:30:55 +01:00
Maria Matejka
32793ab685 Filter: Fixed bugs in FI_CALL and FI_SWITCH 2019-02-20 22:30:55 +01:00
Maria Matejka
ea4f55e3dc Filter: More cleanup -- customized structures also in struct f_line_item 2019-02-20 22:30:55 +01:00
Maria Matejka
0b39b1cbb7 Conf: Symbol implementation converted from void pointers to union
... and consted some declarations.
2019-02-20 22:30:55 +01:00
Maria Matejka
132529ce89 Filter: merged filter compare functions into common M4 file 2019-02-20 22:30:55 +01:00
Maria Matejka
dd4d409551 Filter: Merged postfixify routine 2019-02-20 22:30:54 +01:00
Maria Matejka
de12cd18fb Filter: Merged filter line item dumpers into common generated source 2019-02-20 22:30:54 +01:00
Maria Matejka
b256f24145 Filter: auto-generating enum-to-string 2019-02-20 22:30:54 +01:00
Maria Matejka
041608129a Filter generator: workaround for M4 claiming all the put-around code be on one line 2019-02-20 22:30:54 +01:00
Maria Matejka
5289304519 Filter data manipulation functions separated to their file 2019-02-20 22:30:54 +01:00
Maria Matejka
87bd7cd7b0 Filter: split the constructors to a separate file 2019-02-20 22:30:54 +01:00
Maria Matejka
75206f266f Conf: Fixed makefiles 2019-02-20 22:30:54 +01:00
Maria Matejka
4f082dfa89 Filter: merged filter instruction constructors, counting line size on instruction construct 2019-02-20 22:30:54 +01:00
Maria Matejka
0a793ebc60 Test: Fixed annoying warnings (and possible obscure bugs). 2019-02-20 22:30:54 +01:00
Maria Matejka
8bdb05edb2 Filters: split the large filter.h file to smaller files.
This should be revised, there are still ugly things in the filter API.
2019-02-20 22:30:54 +01:00
Maria Matejka
c1e97169cd Filter: M4 convertors polished a bit. 2019-02-20 22:30:54 +01:00
Maria Matejka
c0e958e022 Filter + Config: Fix bugs, tests and split symbols by type 2019-02-20 22:30:54 +01:00
Maria Matejka
9b46748d5b Filter: refactoring of instruction constructors 2019-02-20 22:30:54 +01:00
Maria Matejka
4c553c5a5b Filter refactoring: dropped the recursion from the interpreter
This is a major change of how the filters are interpreted. If everything
works how it should, it should not affect you unless you are hacking the
filters themselves.

Anyway, this change should make a huge improvement in the filter performance
as previous benchmarks showed that our major problem lies in the
recursion itself.

There are also some changes in nest and protocols, related mostly to
spreading const declarations throughout the whole BIRD and also to
refactored dynamic attribute definitions. The need of these came up
during the whole work and it is too difficult to split out these
not-so-related changes.
2019-02-20 22:30:54 +01:00
Maria Matejka
967b88d938 Filter refactoring: The instructions are converted to the switch body by M4 2019-02-20 22:30:54 +01:00
Maria Matejka
8436040735 Filter refactoring: Drop the roa check specific f_inst 2019-02-20 22:30:54 +01:00
Maria Matejka
ca2ee91a80 Filter refactoring: The constant f_val is simply included inside the instruction
With 32 bits, size of the args is 12 bytes, the f_val is 20 bytes.
With 64 bits, size of the args is 24 bytes, the f_val the same.

This is not so nice on 32 bits, anyway the f_inst itself is
24 vs. 32 bytes and the overall size of filters must be 32k of
instructions to get to one megabyte of RAM eaten by f_inst.

Therefore it seems to be improbable for common user to get into
problems with this change.
2019-02-20 22:30:54 +01:00
Maria Matejka
7f0ac73724 Filter refactoring: Changed arguments from separate unions to an array 2019-02-20 22:30:54 +01:00
Maria Matejka
224b77d4f7 Filter refactoring: Converted condition to three-args instruction 2019-02-20 22:30:54 +01:00
Maria Matejka
8e8b1fe48c Filter refactoring: Some instructions eat up excessively much space. 2019-02-20 22:30:54 +01:00
Maria Matejka
c577493908 Filter refactoring: Expanded the short instructions with common code.
This will make the further changes more straightforward.
2019-02-20 22:30:54 +01:00
Maria Matejka
a8740d6c09 Filter refactoring: indentation fix 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
fc8df41ec6 Filter refactoring: The values are now saved on a custom stack.
This shall help with performance.
2019-02-20 22:30:54 +01:00
Jan Maria Matejka
7afa143886 Filter refactoring: Passing the resulting struct f_val as a pointer.
This also drops the multiplexing of errors with the f_val itself
together with the T_RETURN f_val type flag.
2019-02-20 22:30:54 +01:00
Jan Maria Matejka
f62a369fb4 Filter refactoring: Moved filter instruction definition to a separate file 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
25566c6810 Filter refactoring: Moved the bitfield bit position formula to route.h 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
aca8263926 Filter refactoring: Moved the interpret macros inside the block 2019-02-20 22:30:54 +01:00
Jan Maria Matejka
a946317fab Filter: Converted static global variables to a filter_state struct.
The static filter state was messy and blocked the planned parallel
execution of filters. Anyway, this will be also slower as the state
structure must be passed almost everywhere with us.
2019-02-20 22:30:53 +01:00
Ondrej Zajicek (work)
3a2a3c7325 Doc: Rename code documentation files back to Doc 2018-12-14 02:03:42 +01:00
Maria Matejka
265419a369 Custom route attributes
For local route marking purposes, local custom route attributes may be
defined. These attributes are seamlessly stripped after export filter to
every real protocol like Kernel, BGP or OSPF, they however pass through
pipes. We currently allow at most 256 custom attributes.

This should be much faster than currently used bgp communities
for marking routes.
2018-12-06 09:55:21 +01:00
Ondrej Zajicek (work)
f2d8e6801e Filter: Make ifname attribute modifiable
Allow to change an interface associated with a route by setting
ifname attribute. It will also change the route to a direct one.
2018-11-05 22:03:21 +01:00
Ondrej Zajicek (work)
83715aa829 Filter: Add support for VPN_RD sets 2018-10-25 11:26:58 +02:00
Ondrej Zajicek (work)
41b83e52f7 Filter: Fix minor bug in accessing bgp_path
Not relevant for regular BGP paths, just for BGP paths added by filters
to e.g. static routes.
2018-10-25 11:23:15 +02:00
Ondrej Zajicek (work)
586c1800c4 Nest: Neighbor cache cleanups
Simplify neighbor cache code, fix several minor bugs, and improve
handling of ONLINK flag.
2018-06-27 16:57:07 +02:00
Maria Matejka
c2fc4c10ac Doc: renamed progdoc files Doc -> progdoc to fix collision with doc/ folder on case-insensitive filesystems 2018-06-26 17:09:12 +02:00
Jan Maria Matejka
f851f0d7e3 Config: Dropping CF_ADDTO. 2018-06-26 14:29:03 +02:00
Jan Maria Matejka
1771f70d74 Filter: fixed eattr cached pointer
Use ACCESS_RTE to guard **f_rte, use ACCESS_EATTRS to guard **f_eattrs.
Use f_rta_cow() before writing to rta or eattrs, use f_rte_cow() before
writing preference (stored in rte).

Do not access eattrs indirectly through (*f_rte)->attrs->eattrs, it is
way too slow. The cached pointer is faster.
2018-06-19 16:51:40 +02:00
Jan Maria Matejka
13c0be19d3 Nest: Removing separate tmpa from route propagation
This is a fundamental change of an original (1999) concept of route
processing inside BIRD. During import/export, there was a temporary
ea_list created which was to be used instead of the another one inside
the route itself.

This led to some confusion, quirks, and strange filter code that handled
extended route attributes. Dropping it now.

The protocol interface has changed in an uniform way -- the
`struct ea_list *attrs` argument has been removed from store_tmp_attrs(),
import_control(), rt_notify() and get_route_info().
2018-05-30 17:08:49 +02:00
Jan Maria Matejka
ee7e2ffd26 Protocol: Introducing an enum protocol_class
This supersedes the EAP_* constants.
2018-05-29 12:35:06 +02:00
Jan Maria Matejka
c3becfe193 Filter: macro for recursive interpretation of instructions 2018-05-29 12:35:06 +02:00
Jan Maria Matejka
0ec6b5ecd3 Filter: Simple type checks converted to ARG() macro 2018-05-29 12:35:06 +02:00
Jan Maria Matejka
478f9babed Filter: Removing the third argument hack
Just to make the code a bit more clean and easier to maintain.
2018-05-29 11:53:51 +02:00
Jan Maria Matejka
cff9e937fd Filter: instruction names 2018-05-29 11:53:51 +02:00
Jan Maria Matejka
31d6939cde Filter: Instruction codes linearized 2018-05-29 11:53:51 +02:00
Ondrej Zajicek (work)
b24b781117 Filter: Add support for src filter op to access SADR source prefix
The patch allows to use 'net.src' to access SADR source prefix
from filters.

Thanks to Toke Hoiland-Jorgensen for the original patch for srclen.
2018-05-16 11:19:29 +02:00
Jan Maria Matejka
823ad12191 Filter: Added missing instruction comparators.
These instructions caused SIGABORTs on reconfiguration.
2018-04-27 14:38:41 +02:00
Jan Maria Matejka
8a871e890a Merge branch 'master' into int-new 2018-03-14 12:57:16 +01:00
Jan Maria Matejka
e8bc64e308 Filter: make bgpmask literals real constructors
The bgpmask literals can include expressions. This is OK but they have
to be interpreted as soon as the code is run, not in the time the code
is used as value.

This led to strange behavior like rewriting bgpmasks when they shan't
be rewritten:

	function mask_generator(int as)
	{
		return [= * as * =];
	}

	function another()
	bgpmask m1;
	bgpmask m2;
	{
		m1 = mask_generator(10);
		m2 = mask_generator(20);
		if (m1 == m2) {
			print("strange"); # this would happen
		}
	}

Moreover, sending this to CLI would cause stack overflow and knock down the
whole BIRD, as soon as there is at least one route to execute the given
filter on.

	show route filter bgpmask mmm; bgppath ppp; { ppp = +empty+; mmm = [= (ppp ~ mmm) =]; print(mmm); accept; }

The magic match operator (~) inside the bgpmask literal would try to
resolve mmm, which points to the same bgpmask so it would resolve
itself, call the magic match operator and vice versa.

After this patch, the bgpmask literal will get resolved as soon as it's
assigned to mmm and it also will return a type error as bool is not
convertible to ASN in BIRD.
2018-03-14 11:34:29 +01:00
Jan Maria Matejka
e95705f00c Merge branch 'master' into int-new 2018-03-13 17:02:49 +01:00
Jan Maria Matejka
74bfd2f97c Filters: Removed FI_COMMA, not used for 19 years.
This instruction was removed in the commit linked below
and never used ever again. Rest in peace.

commit 84c7e1943f
Author: Pavel Machek <pavel@ucw.cz>
Date:   Tue Mar 2 19:49:28 1999 +0000
2018-03-13 17:01:37 +01:00
Jan Maria Matejka
d1ba927b36 Merge branch 'master' into int-new 2018-03-13 16:51:04 +01:00
Jan Maria Matejka
7c601e6b7b Filter: recursion to loop
It was supposed to do tail-recursion in interpret() but it didn't
compile as such. Converting it to loop makes a significant filter
performance improvement for flat filters.
2018-03-13 16:29:33 +01:00
Maria Jan Matejka
5a14df3950 Filter: Instruction codes named as enum
The two-letter instructions were quite messy but they could be easily
read from memory dumps. Now GDB (since 2012) supports pretty printing
enum values and GCC checks the switch construction for missing enum
values so we are converting the nice two-byte values to enums.

Anyway, the enum still keeps the old two-byte values to be able to read
the instruction codes even without GDB from plain memory dump.
2018-03-13 16:29:33 +01:00
Jan Maria Matejka
f2f5a7d945 Filter: the test conf checks also a bit of BGP args
Uncommented an old test.
2018-03-08 12:57:39 +01:00
Jan Maria Matejka
0575c7db72 Config: Dropped the ipv4:netmask4 syntax for IPv4 prefixes. 2018-03-08 12:57:39 +01:00
Ondrej Zajicek (work)
1561ee799c Handle properly enums for extended attributes 2018-02-13 19:52:22 +01:00
Ondrej Zajicek (work)
75d98b6013 Merge branch 'master' into int-new 2018-01-23 18:29:32 +01:00
Ondrej Zajicek (work)
b940579115 Filter: Allow silent filter execution
A filter should log messages only if executed explicitly (e.g., during
route export or route import). When a filter is executed for technical
reasons (e.g., to establish whether a route was exported before), it
should run silently.
2018-01-16 16:20:01 +01:00
Ondrej Zajicek (work)
3831b61966 BGP: Require explicit import and export policies for EBGP channels
To comply with RFC 8212 requirements.
2018-01-16 04:14:49 +01:00
Ondrej Zajicek (work)
8f8671bcde Filter: Handle undefined BGP paths as empty
The same is already done for clists. Also fixes defined() to work
properly for paths and clists.
2018-01-03 15:44:05 +01:00
Ondrej Zajicek (work)
ed1d853e51 Filter: Remove old BGP path mask syntax from tests 2017-12-08 17:31:33 +01:00
Jan Maria Matejka
3e52d112d7 Docs: Update to v2.0 2017-12-08 16:27:19 +01:00
Ondrej Zajicek (work)
830ba75e6d Merge commit '1e8721e2aeccfbc3f533e8b8abc07582cee77e9a' into int-new 2017-12-07 21:54:47 +01:00
Jan Maria Matejka
9ba4b4a63d Filter test: typo fix 2017-11-09 15:04:05 +01:00
Michal 'vorner' Vaner
2a95e63343 RAdv: Support for more specific routes (RFC 4191)
The patch implements Default Router Preferences and More-Specific Routes
(RFC 4191) for RAdv protocol, allowing to announce router preference and
more specific routes in router advertisements. Routes can be exported to
RAdv like to regular routing protocols.

Some cleanups, bugfixes and other changes done by Ondrej Zajicek.
2017-10-04 16:27:02 +02:00
Michal 'vorner' Vaner
5a8b1fb047 filter: Allow assigning enums into extended attributes
They are internally ints, but they got refused as a wrong type. This
fixes setting of the BGP origin and is also needed for RA.
2017-09-20 15:36:54 +02:00
Ondrej Zajicek (work)
69f7399247 Merge branch 'master' into int-new 2017-08-09 12:46:27 +02:00
Ondrej Zajicek (work)
e46128fb50 Filters: Do not clamp EC set values to 16 bit for EC_GENERICs
Thanks to Lennert Buytenhek <buytenh@wantstofly.org> for the patch.
2017-06-19 12:46:40 +02:00