1
0
Fork 0
mirror of https://github.com/alice-lg/birdwatcher.git synced 2025-03-09 00:00:05 +01:00
Commit graph

97 commits

Author SHA1 Message Date
Jonathan Lassoff
ca2cbd9f0e Add a dualstack config option to enable dualstack BIRD 2.x operation 2024-02-12 21:17:13 -08:00
Jonathan Lassoff
a78ad8c83e BIRD 2.x: Support dual-stack route queries 2024-02-12 20:30:41 -08:00
Inrin
a476210f38 Allow disabling MemoryCache in Config per BIRD
Setting the `ttl` to `0` does not disable the MemoryCache since the
abstraction function `toCache` overwrote `0` with `5` making it
impossible to hit the "// do not cache" branch of `MemoryCache::Set`.
2023-10-29 11:46:43 +01:00
Annika Hannig
21d8f508c1 updated default, added param to example config 2023-04-20 12:59:15 +02:00
Annika Hannig
4e6fb2b28e consistent max_keys parameter 2023-04-20 12:56:18 +02:00
Annika Hannig
f99f31afdc limit the number of entries in the cache 2023-04-20 12:52:34 +02:00
Annika Hannig
8dd9d81592 fixed missing details in routes/table/.../filtered output 2022-08-02 10:53:34 +02:00
Johannes Moos
174116433c
Add quoting for pipe, protocol and table names 2021-11-08 09:07:50 +01:00
Matthias Hannig
eb5d101dd5
added table remapping 2019-09-09 12:18:55 +02:00
Matthias Hannig
d1e3b2017c
fixed querybuilding 2019-09-09 12:11:18 +02:00
Matthias Hannig
76a8af43fe
Allow for birdc flags in the config 2019-07-18 16:39:57 +02:00
Patrick Seeburger
116f03fed4 Add support for uncached queries
The cache is still updated with new information on every request.
2019-03-20 14:55:11 +01:00
Patrick Seeburger
8585003413 Added a parser and endpoint for the show protocols command. 2019-03-20 14:55:10 +01:00
Benedikt Rudolph
e6ed0cb901 Refactor housekeeping and memory cache
* run Expire() only on MemoryCaches
* make initialization of the cache look pretty
2019-02-20 11:17:13 +01:00
Patrick Seeburger
cfa0af57cc Expire cache entries to save memory
* Add a method to expire cache entries, based on the ttl value
* Add a housekeeping method that will periodically expire cache
  entries and also maybe configured to force a GC/SCVG run.
2019-02-18 17:46:32 +01:00
Benedikt Rudolph
43b6a8b8dc Merge branch 'feature/api-redesign' into develop
* simplify RoutesNoExport() to just the birdc command
2019-02-06 08:54:21 +01:00
Benedikt Rudolph
56c378109f Integrate redis backend with the Cache interface 2019-02-28 16:14:13 +01:00
Benedikt Rudolph
cd05592804 Merge redis cache from 'upstream/master' into develop
Leave redis cache the way it is for now. Rework in future commits.
2019-02-28 15:11:31 +01:00
Benedikt Rudolph
14c8875ae0 Avoid overwriting existing cache entry
also fix RoutesNoExport.
2019-02-28 13:25:47 +01:00
Benedikt Rudolph
7e02cb23da Add test for memory cache backend
Improve error handling in case value can not be retrieved.
Either return the value and nil, or a value and an error.
2019-02-28 13:02:11 +01:00
Benedikt Rudolph
119b9f6360 Add feature cache backends
Add support for various cache backends in anticipation of the
merge with master that has an additional redis backend.
The current memory based cache backend is refactored to implement
the new interface.
2019-02-28 11:32:40 +01:00
Benedikt Rudolph
ceea37e53b Merge branch 'upstream/master' into develop
Merge changes including version 1.11.0 of upstream.
Remove extra lines in RoutesNoExport()

Conflicts:
       README.md
       * Keep `birdwatcher` in the configuration path
       bird/bird.go
       * Keep the default order of arguments to birdc in RoutesFiltered() and RoutesNoExport()
       birdwatcher.go
       * Keep `gorilla/handlers` for HTTP logging
2019-02-28 09:17:41 +01:00
Patrick Seeburger
83628d4995 Cache refactoring, allow update before store
* Change the callback type to update the cache for RunAndParse()
  to be a pointer to the Parsed record, which allows updating the
  Parsed record before it will be stored inside the cache
2019-03-13 09:29:15 +01:00
Patrick Seeburger
01eb78117b Refactor use of the Meta Cache
* Update all functions that use the meta cache to only create
  their own records and also use GetCacheKey() to request the
  meta cache from other functions.
  * eliminates the need for Clear() -> removed
* Add two new birdc commands:
  * PipeRoutesFiltered()
  * PipeRoutesFilteredCount()
2019-03-13 09:29:15 +01:00
Patrick Seeburger
50a79e7f4f Add the GetCacheKey() function
This allows to determine the key in the cache, where the result of
specific functions are stored, without requiring to know what command
was executed by that function.
Also updated all functions to use GetCacheKey() to store Parsed
records.
2019-03-13 09:29:14 +01:00
Patrick Seeburger
d931094ce7 Introduce a new birdc query RoutesFilteredCount()
The query can be used to determine the exact number of filtered
(not exported) prefixes from a table towards a pipe protocol for
a certain neighbor (if multiple neighbors are connected to
the given table).
2019-03-13 09:29:14 +01:00
Patrick Seeburger
c3d0d16b48 Fixed a bug in RoutesDumpPerPeerTable()
The bug causes an early exit if the filtered routes for a protocol
can not be retrieved.
2019-03-13 09:29:14 +01:00
Patrick Seeburger
3e63268af3 Implement a RunQeue for birdc commands
This prevents running the same birdc command multiple times in
parallel.
2019-03-13 09:29:13 +01:00
Patrick Seeburger
ced455ef7b Cache redesign - Parsed and Meta cache separation
* seperate Parsed and Meta cache, so that they may be locked independently
* extend the RunAndParse() function to allow the caller to specify a
  callback which will update the Meta cache
* change all methods interacting with the Meta cache to use the
  callback for RunAndParse() to update the Meta cache
2019-03-13 09:28:59 +01:00
Patrick Seeburger
7fd2dfd0cf Implement new endpoint /routes/count/primary 2019-02-22 14:07:10 +01:00
Patrick Seeburger
541ea6d84d Fix RoutesDumpPerPeerTable()
Fix RoutesDumpPerPeerTable to return results again and the filtered
routes.
2019-02-22 14:07:10 +01:00
Patrick Seeburger
08c63fc3a3 Fixed /routes/count/protocol Endpoint which was returning no data,
because the wrong parser was called.
2019-02-22 14:07:09 +01:00
Johannes Moos
439ee0d5d0 Fix RoutesPrefixed
This version ignored the prefix which is passed as an URL parameter.
2019-02-22 14:07:08 +01:00
Patrick Seeburger
27fe2969d7 Avoid unnecessary cache writes in /status
Introduce check to avoid unneccesarry cache writes.
2019-02-22 14:07:07 +01:00
Patrick Seeburger
8a69b5ba98 Repair 'protocols' endpoint
* repair 'protocols' endpoint to return a meaningful JSON object
* improve example configuration file
2019-02-22 14:07:06 +01:00
Matthias Hannig
712510b3bc include caching information alongside ttl 2019-02-22 14:07:06 +01:00
Matthias Hannig
837c97da13 prefix cache key for use with birdc and birdc6 2019-01-24 19:01:41 +01:00
Matthias Hannig
52f5e9506a use redis caching when available 2019-01-24 17:15:54 +01:00
Patrick Seeburger
c4dfeb253d API redesign - make birdwatcher more generic
Removed all high level functionality e.g. endpoints with multiple
invocations of birdc.
Add new endpoints which are required to duplicate the removed
functionality within Alice-LG.
2019-01-18 18:10:06 +01:00
Matthias Hannig
2a17304682 fixed command syntax 2018-11-29 15:28:00 +01:00
Patrick Seeburger
c1cc320030 Improve caching of parsed birdc output.
This additionally caches the results after matching regular
expressions and improves performance further.

Credits: Hasan Pekdemir for the original idea.
2018-07-18 10:53:53 +02:00
Benedikt Rudolph
715deaebb8 Fix quotation error Routes{Table,Lookup}* method
The commands submitted to birdc contain "'" characters
placed before and after ip-address/prefix and table
name. In normal operation of birdc they are eliminated
by the shell. However when given as arguments to birdc
directly they cause "IP address expected" error in Bird.

Credits: Felix Singer for finding and submitting this bug.
2018-07-18 10:53:07 +02:00
Benedikt Rudolph
fdfa4cbc32 Generalize parse method to accept all protocols
The method parseBgp is now generic enough to  parse
all types of protocols.
Added new regular expressions and a more flexible
way of processing route_change statistics that have
subtle differences in each protocol.
2018-07-18 10:43:00 +02:00
Benedikt Rudolph
88eb405c9e Add comment to explain "-r" argument. 2018-07-18 10:43:00 +02:00
Benedikt Rudolph
1ccbc3d702 Execute birdc in restricted mode with "-r" argument. 2018-07-18 10:42:59 +02:00
Benedikt Rudolph
46356aa9eb Make cache ttl for bird responses a config option
For bird and bird6 you may add ttl to the respective config file sections.
See example config in this commit.
This allows to have individual ttls for the cache of bird cli output per daemon.
2018-07-18 10:42:57 +02:00
Johannes Moos
e4ec6591b9 Increase default cache time to 10 minutes 2018-07-18 10:40:27 +02:00
Benedikt Rudolph
d5de4b8f65 Fix birdc query for RoutesFiltered 2018-06-08 16:37:33 +02:00
Daniel Czerwonk
37d5eeaa13 fxed version check 2018-01-18 18:34:08 +01:00
Daniel Czerwonk
8b65cb4d66 no all on count 2018-01-18 13:19:42 +01:00