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

147 commits

Author SHA1 Message Date
Annika Hannig
37257e907c
Merge branch 'patch-1' of https://github.com/ihsinme/birdwatcher into ihsinme-patch-1 2020-10-28 16:15:23 +01:00
Annika Hannig
98faa6ccc4
fixed redis inband ttl handling 2020-10-28 16:13:58 +01:00
Annika Hannig
990d85c41d
added inband ttl to test data 2020-10-28 16:04:24 +01:00
Annika Hannig
45c1453831
fixed handling serialized TTLs 2020-10-28 16:03:22 +01:00
Annika Hannig
5518ddf7e5
fixed error style 2020-10-28 15:48:21 +01:00
Annika Hannig
7e1e332c2c
updated redis usage 2020-10-28 15:42:16 +01:00
Annika Hannig
96815d7640
fixed test case 2020-10-28 15:38:08 +01:00
ihsinme
c6a096db57
Update parser.go 2020-10-26 15:19:18 +03:00
39f573c38e bird2: parse interface and gateway of routes properly 2020-01-20 03:59:30 +01:00
Matthias Hannig
58811bedf5
upgraded dependency 2019-12-23 15:58:35 +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
Matthias Hannig
6bc26640dd
made regex for bird_protocol a bit more permissive 2019-07-18 16:06:07 +02:00
Patrick Seeburger
e0031c61a0 Change extended communities fomat
Change format for extended BGP communities from (string,int,int) to
(string,string,string) in order to support communities like
(generic, 0x43000000, 0x1)
2019-03-20 14:55:11 +01: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
c6e717bc61 Fixed a bug regarding timestamps in the protocols parser. 2019-03-20 14:55:10 +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
12be0f9de3 Fixed a bug where a community was missing when parsing multiline communities.
Also added a test case for the multiline community parsing.
2019-03-13 09:29:58 +01:00
Patrick Seeburger
791b2a04ba Fixed the regular expression to not match white spaces at the end of
the protocol line.

Fixed the route sample which was failing the parser tests.
2019-03-13 09:29:55 +01:00
Patrick Seeburger
c1db0320e3 Implemented handling of multiline replies in case of BGP.*community 2019-03-13 09:29:53 +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
980fcff9c2 Changed the data structure for the extended communities to be a single
slice of {string, int64, int64} instead of a parsed record.
2019-02-22 14:07:11 +01:00
Patrick Seeburger
95cf1a71af Fixed a bug in the parser that would return an integer of the wrong type
(int vs. int64) in an error case.
2019-02-22 14:07:11 +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
c1a07cc985 Implemented support for parsing extended communities. 2019-02-22 14:07:10 +01:00
Patrick Seeburger
b7952f9061 Fix TestParseProtocolBgp()
Fix test method TestParseProtocolBgp() to match the output of the
current ProtocolsBgp() method wich returns Parsed records instead of a
string array.
2019-02-22 14:07:09 +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
Patrick Seeburger
6e8734fa90 Fixed /symbols endpoint. 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
Patrick Seeburger
1d3118b864 Added missing default value (imported). 2019-02-04 15:48:24 +01:00