Commit graph

49 commits

Author SHA1 Message Date
Maria Matejka 37b6444137 Moved config-related allocations to config_pool and showing its size in memory usage 2022-11-01 16:38:24 +01: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
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 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 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
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
Maria Matejka f249d0b84c Filters: comparison of functions and filters caching 2019-02-26 16:44:24 +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 4f082dfa89 Filter: merged filter instruction constructors, counting line size on instruction construct 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 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 8436040735 Filter refactoring: Drop the roa check specific f_inst 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 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
Jan Maria Matejka cff9e937fd Filter: instruction names 2018-05-29 11:53:51 +02:00
Jan Maria Matejka d1ba927b36 Merge branch 'master' into int-new 2018-03-13 16:51:04 +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
Ondrej Zajicek (work) 1561ee799c Handle properly enums for extended attributes 2018-02-13 19:52:22 +01:00
Pavel Tvrdík 0264ccf6f4 Rewrite roa_check() for integrated BIRD
Thanks to Ondrej Zajicek for his support with writing this code.
2016-01-20 16:46:58 +01:00
Jan Moskyto Matejka 9656dce72e ROA code switchoff 2015-12-20 13:04:07 +01:00
Ondrej Zajicek 4be266a983 Implements wildcard matching in config file include.
Also fixes some minor bugs in include.

Thanks Kelly Cochran for suggestion and draft patch.
2012-07-18 19:29:33 +02:00
Ondrej Zajicek af582c4811 Route Origin Authorization basics.
- ROA tables, which are used as a basic part for RPKI.
 - Commands for examining and modifying ROA tables.
 - Filter operators based on ROA tables consistent with RFC 6483.
2012-03-18 17:32:30 +01:00
Ondrej Zajicek 8796a8a56e Fixes name for unnamed filters.
Thanks to Alexander V. Chernikov for the suggestion.
2012-03-15 12:50:49 +01:00
Ondrej Filip 48ec367aab Configuration can include other files. 2011-09-11 21:21:47 +02:00
Martin Mares 6ecd20605c ... and in the filter. 2004-06-05 09:26:55 +00:00
Pavel Machek a96a979d5b Line numbers for runtime errors (what's wrong with cvs? I could not
commit this from home)
2000-05-16 18:50:51 +00:00
Pavel Machek 7d6eebae3b Create syntax sugar for add/delete/prepend, so xyzzy.prepend(123) is
possible. That means that milestone 3 was reached.
2000-04-20 10:25:51 +00:00
Pavel Machek 0150e5211a Cleaned up mess with types in e,a and e,S. Dynamic attributes should
now work.
2000-04-17 14:12:02 +00:00
Pavel Machek ac7a2145cc f_new_dynamic_attr gets third argument, type as filters know it. 2000-04-12 14:02:04 +00:00
Martin Mares 66d573d490 Attribute type hack. 2000-04-12 13:55:30 +00:00
Martin Mares 3cf4a2e2b0 Removed lots of superfluous includes.
Use debug() instead of printf().
2000-03-31 23:35:59 +00:00
Pavel Machek 62ab789de5 Added type parameter to f_new_dynamic_attr. 2000-03-01 14:42:59 +00:00
Pavel Machek 31e79264a2 tmp_attrs fixed.
I do not know if it is right since mj ingores talk once started :-(.
2000-03-01 14:31:31 +00:00
Martin Mares db1326aa5e Dynamic attributes are now declared in per-protocol grammar files instead
of filter/config.Y. Bird now compiles even if you disable RIP.

Removed RTA and IMPOSSIBLE tokens (unused).

Removed superfluous comment in filter.h.

I've tried to do my best, but Pavel, please check these changes.
2000-03-01 11:32:23 +00:00
Pavel Machek c7b43f33ae Split inst->code into inst->code and inst->aux. Both are only 16 bit,
so aux is suitable for storing type but not much more.
1999-11-18 14:01:36 +00:00
Pavel Machek 23b1539bf9 Filters upgraded - a bit. Moved code to filter.c because it is where
it belongs. (f-util.c stays there for auxiliary and non-important things.)
1999-04-07 12:11:08 +00:00
Martin Mares 63a381dbf5 Several filter changes. (Pavel, please check if they are OK.)
o  Changed parameters of f_run. Changed rtein+rteout pair to rte pointer
      passed by reference, added ea_list of temporary attrs again passed
      by reference and finally added a pointer to memory pool for storing
      temporary data (new ea_lists's, temporary rta's etc.).
   o  Re-ordered result codes, so that all accepts come before all rejects.
   o  Introduced FILTER_ACCEPT and FILTER_REJECT dummy values (will be
      used in protocol configurations).
   o  Added filter_name() which returns name of a filter or ACCEPT/REJECT
      for the dummies.
1999-04-05 20:10:31 +00:00
Martin Mares 78d5ec1504 Please don't commit debugging code which makes BIRD exit before anything
actually starts to happen. Grrr.
1999-03-29 20:28:25 +00:00
Pavel Machek ba92164871 Update of filters towards new interface. 1999-03-29 20:21:28 +00:00
Martin Mares e0f2e42f4f A couple of filter tweaks:
o  Introduced struct filter which serves as an external reference
      to filter. Using struct symbol for this is unwise since it doesn't
      allow extra information attached to the filter and it also forces
      all filters to be named.
   o  Implemented config rule 'filter' which matches either named filter
      or an embedded unnamed filter (`{ <filter> }').
   o  Fixed totally bogus comment at the top of filter.h.
   o  Added a missing prototype for f_run() to filter.h.
1999-03-17 14:29:39 +00:00
Pavel Machek 3c7ad64c57 Compilation fix for mj. 1999-03-17 13:04:33 +00:00
Pavel Machek d36d838df5 accept & reject should now work 1999-03-17 10:19:07 +00:00
Pavel Machek b700582445 Filters are now a tiny bit stronger (if is actually working ;-) 1999-03-08 20:30:06 +00:00
Pavel Machek 84c7e1943f Add interface for running filters (please comment!), avoid bison warnings 1999-03-02 19:49:28 +00:00
Pavel Machek ca3d562b24 filters_init() renamed to filters_postconfig(). 1999-01-15 18:13:55 +00:00
Pavel Machek b9d70dc84e Filters, second try. This time they have their own directory. 1999-01-15 16:49:17 +00:00