Commit graph

73 commits

Author SHA1 Message Date
Pavel Tvrdik
45ec4ce82a Lexer: Add a quotation mark back while parsing quotes
Thanks to Ondrej Zajicek for code.
2016-11-16 12:21:19 +01:00
Ondrej Zajicek (work)
8860e991f6 Merge branch 'master' into int-new 2016-11-08 19:27:58 +01:00
Ondrej Zajicek (work)
c8cafc8ebb Minor code cleanups 2016-11-08 17:46:29 +01:00
Ondrej Zajicek (work)
cc5b93f72d Merge tag 'v1.6.2' into int-new 2016-11-08 17:04:29 +01:00
Pavel Tvrdik
768d5e1058 Add !~ operator to filter grammar 2016-09-21 13:35:52 +02:00
Ondřej Surý
61e6725335 Include <stdint.h> in cf-lex.l to avoid UINTx_MAX redefinition 2016-08-16 09:23:55 +02:00
Ondrej Zajicek (work)
af678af0d5 Merge remote-tracking branch 'origin/master' into int-new 2016-05-12 18:03:23 +02:00
Pavel Tvrdik
8e433d6a52 Prog Doc: Complete several missing parameters 2016-05-12 15:49:44 +02:00
Jan Moskyto Matejka
9656dce72e ROA code switchoff 2015-12-20 13:04:07 +01:00
Ondrej Zajicek (work)
04ae8ddaa1 Merge branch 'master' into int-new 2015-11-25 14:24:35 +01:00
Ondrej Zajicek (work)
9b9a7143c4 Conf: Fixes bug in symbol lookup during reconfiguration
Symbol lookup by cf_find_symbol() not only did the lookup but also added
new void symbols allocated from cfg_mem linpool, which gets broken when
lookups are done outside of config parsing, which may lead to crashes
during reconfiguration.

The patch separates lookup-only cf_find_symbol() and config-modifying
cf_get_symbol(), while the later is called only during parsing. Also
new_config and cfg_mem global variables are NULLed outside of parsing.
2015-11-09 00:42:02 +01:00
Ondrej Zajicek (work)
fe9f1a6ded Initial commit on integrated BIRD
New data types net_addr and variants (in lib/net.h) describing
network addresses (prefix/pxlen). Modifications of FIB structures
to handle these data types and changing everything to use these
data types instead of prefix/pxlen pairs where possible.

The commit is WiP, some protocols are not yet updated (BGP, Kernel),
and the code contains some temporary scaffolding.

Comments are welcome.
2015-11-05 12:48:52 +01:00
Ondrej Zajicek
bc7f4e0e34 Bump max symbol length to 64.
And move the constant to conf.h header.

Thanks to Alexander Chernikov for the patch.
2015-02-21 12:42:31 +01:00
Ondrej Zajicek
88a183c6c9 Integrated IP functions. 2014-10-24 11:11:43 +02:00
Ondrej Zajicek
b2f008378a Allows more constants in set literals.
Thanks to Michael Fincham for the bugreport.
2014-10-02 12:52:50 +02:00
Ondrej Zajicek
0c3d9dacaf Fixes file descriptor leak when parser ends with error.
Thanks to MrBr for the bugreport.
2014-03-25 14:58:00 +01:00
Ondrej Filip
1f64a487a0 Symbol names enclosed by apostrophes can contain colons. 2013-08-15 13:29:33 +02:00
Ondrej Zajicek
1103b32e83 Allows to define constants of all filter types. 2013-07-25 22:33:57 +02:00
Ondrej Filip
8c4da7e01d Symbol names enclosed by apostrophes can contain DOTs. 2013-02-10 19:17:38 +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
c32c3f88f0 Fixes parsing larger numbers on 64bit platforms. 2011-12-22 13:44:43 +01:00
Ondrej Zajicek
60fd666b79 Fixes missing header. 2011-11-10 09:22:38 +01:00
Ondrej Zajicek
a7f23f581f Implements protocol templates.
Based on the patch from Alexander V. Chernikov.
Extended to support almost all protocols.
Uses 'protocol bgp NAME from TEMPLATE { ... }' syntax.
2011-11-07 00:31:23 +01:00
Ondrej Zajicek
9b7fdfc84a Fixes for include. 2011-10-10 01:41:08 +02:00
Ondrej Filip
48ec367aab Configuration can include other files. 2011-09-11 21:21:47 +02:00
Ondrej Zajicek
b8cc390e7e Fixes several problems in filter syntax.
- Fixes several conflicts in the grammar.
 - Fixes a bug in (a..b, c) pair patterns.
 - Makes pair patterns orthogonal.
 - Allows term expressions in pair patterns without additional ( ).
 - Allows several comma separated values in switch cases.
2011-05-06 22:00:54 +02:00
Ondrej Zajicek
26d92bb892 A hack to distinguish if..else from else: in case.
The old BIRD grammar needs two lookaheads to distinguish if..else from
else: in case, which caused the parser to fail on some combinations of
both expressions.

This patch replaces two tokens 'else' ':' by one token 'else:' to fix
that.
2011-03-23 12:49:53 +01:00
Ondrej Zajicek
93e868c730 Implements Router Advertisement protocol. 2011-03-13 11:33:50 +01:00
Ondrej Zajicek
506fa1a73e Merge several fixes suggested by Joakim Tjernlund. 2010-05-02 22:41:40 +02:00
Ondrej Zajicek
e304fd4bcf Implements pattern match for 'show protocols' command.
And generally consolidates protocol commands.
2010-02-20 00:08:07 +01:00
Ondrej Filip
0efd646278 Define symbols as text between ''. 2010-02-10 12:30:14 +01:00
Ondrej Zajicek
cf18603491 New syntax for bgp_path 2009-03-14 12:43:10 +01:00
Ondrej Zajicek
f949163039 New syntax for bgp_path 2009-01-27 17:35:00 +01:00
Martin Mares
725270cb1d Fixes for the programmer's manual. 2000-06-08 12:37:21 +00:00
Martin Mares
58f7d004fd Fixes to the progdoc. 2000-06-07 13:25:53 +00:00
Martin Mares
2e9b24211a Spelling fixes to progdoc. 2000-06-07 12:29:08 +00:00
Martin Mares
04dc62a011 Nested scopes could never have worked. My fault I wrote such a buggy code,
Pavel's fault that he's never tested shadowing of declarations in the filters.

cf_define_symbol() has been modified to check the scope of the symbol it's
given and it if it's an already defined symbol, but in a different scope,
a copy is created in the current scope and redefined to the new meaning,
the consequence being that it cf_define_symbol() now returns the new symbol
you need to use when assigning aux and aux2.
2000-06-04 19:30:13 +00:00
Martin Mares
58f9453776 Moved parser docs to cf-lex.l, so that the parser compiles. 2000-06-04 15:22:20 +00:00
Martin Mares
06607335ef Documentation. 2000-06-03 18:23:00 +00:00
Martin Mares
c0b2f6463f cf_symbol_class_name now recognizes SYM_IPA. 2000-06-03 16:56:00 +00:00
Pavel Machek
5f4aee76a2 Added && and ||. 2000-06-01 08:43:29 +00:00
Martin Mares
69a20d2eff Recognize `!'. 2000-05-30 21:46:21 +00:00
Pavel Machek
9a09a64bb4 Use ? in path matching to avoid /* trap. 2000-05-25 14:58:38 +00:00
Martin Mares
a412f01ea8 Include CF_HDR section in keywords.h as well, so that protocol symbols
can be used in definition of ENUM's.
2000-04-28 15:12:03 +00:00
Martin Mares
221135d6bf Include "lib/string.h" instead of <string.h>. It should give us bzero()
and other non-portable functions on all systems.
2000-03-31 23:30:21 +00:00
Pavel Machek
c8d5ffafb7 Fix <=, >=, != 2000-03-10 20:21:12 +00:00
Martin Mares
4b87e256eb Split off general commands to cmds.c.
Added `show symbols' command which dumps whole symbol table together
with symbol types etc.
2000-01-19 12:30:19 +00:00
Martin Mares
d272fe22dd Separated `official protocol names' used in status dumps from name templates
used for automatic generation of instance names.

	protocol->name is the official name
	protocol->template is the name template (usually "name%d"),
		should be all lowercase.

Updated all protocols to define the templates, checked that their configuration
grammar includes proto_name which generates the name and interns it in the
symbol table.
2000-01-17 11:52:50 +00:00
Martin Mares
ca0edc5395 When a quoted string is encountered, don't forget to copy it to the
config pool before passing it to the parser.
2000-01-16 23:36:53 +00:00