Coder Social home page Coder Social logo

birdwatcher's Introduction

birdwatcher

birdwatcher is a small HTTP server meant to provide an API defined by Barry O'Donovan's birds-eye to the BIRD internet routing daemon.

Why

The INEX implementation of birdseye runs PHP, which is not always desirable (and performant) in a route server setting. By using Go, we are able to work with regular binaries, which means deployment and maintenance might be more convenient.

Our version also has a few more capabilities, as you will discover when looking at the modules section of the config.

Installation

You will need to have go installed to build the package. Please make sure your go version is >= 1.9.

Running go install github.com/alice-lg/birdwatcher@latest will give you a binary. You might need to cross-compile it for your bird-running service (GOARCH and GOOS are your friends).

We provide a Makefile for more advanced compilation/configuration. Running make linux will create a Linux executable (by default for amd64, but that is configurable by providing the ARCH argument to the Makefile).

2.0 Breaking Change

The BIRD configuration setup (single/multi table, pipe/table prefixes) is no longer configured in birdwatcher but directly in Alice-LG. Please have a look at the source section of the Alice-LG config example.

BIRD configuration

Birdwatcher parses the output of birdc[6] and expects (for now) the time format to be iso long. You need to configure

timeformat base         iso long;
timeformat log          iso long;
timeformat protocol     iso long;
timeformat route        iso long;

in your /etc/bird[6].conf for birdwatcher to work.

BIRD keep filtered routes

To also see filtered routes in configured BGP protocol instances, you need to make sure that you have enabled the import keep filtered on option for affected bgp protocols.

protocol bgp 'peerX' {
    ...
    import keep filtered on;
    ...
}

Now you should be able to do a show route filtered protocol peerX in BIRD.

If you use a multi table setup you are also using the pipe protocol the connect the tables. No special BIRD configuration is required to be able to query pipe filtered routes.

birdwatcher provides various endpoints (see "available modules" section) to query routes filtered in bgp protocol as well as pipe protocol instances.

For use with Alice-LG, make sure to set the appropriate BIRD config setup in your Alice-LG configuration.

BIRD tagging filtered routes

If you want to make use of the filtered route reasons in Alice-LG, you need to make sure that you are using BIRD 1.6.3 or up as you will need Large BGP Communities (http://largebgpcommunities.net/) support.

You need to add a Large BGP Community just before you filter a route, for example:

define yourASN = 12345
define yourFilteredNumber = 65666
define prefixTooLong = 1
define pathTooLong = 2

function importScrub() {
    ...
    if (net.len > 24) then {
        print "REJECTING: ",net.ip,"/",net.len," received from ",from,": Prefix is longer than 24: ",net.len,"!";
        bgp_large_community.add((YourASN,yourFilteredNumber,prefixTooLong));
        return false;
    }
    if (bgp_path.len > 64) then {
        print "REJECTING: ",net.ip,"/",net.len," received from ",from,": AS path length is ridiculously long: ",bgp_path.len,"!";
        bgp_large_community.add((yourASN,yourFilteredNumber,pathTooLong));
        return false;
    }
    ...
    return true;
}

function importFilter() {
    ...
    if !(importScrub()) then reject;
    ...
    accept;
}

Using Docker

You can run the birdwatcher for BIRD2 with docker:

docker pull alicelg/birdwatcher:latest

docker run -p 29184:29184 -v /run/bird/bird.ctl:/run/bird/bird.ctl -it --rm birdwatcher:latest

Or build your own image:

docker build . -t alicelg/birdwatcher:latest

Building an RPM

Building RPMs is supported through fpm. If you have fpm installed locally, you can run make rpm to create a RPM in the folder RPMS. If you have a remote build server with fpm installed, you can build and fetch an RPM with make remote_rpm BUILD_SERVER=<buildserver_url> (requires SSH access).

Deployment

If you want to deploy birdwatcher on a system that uses RPMs, you should be able to install it after following the instructions on building an RPM.

We do not currently support other deployment methods.

Configuration

An example config with sane defaults is provided in etc/birdwatcher/birdwatcher.conf. You should be able to use it out of the box. If you need to change it, it is well-commented and hopefully intuitive. If you do not know how to configure it, please consider opening an issue.

How

In the background birdwatcher runs the birdc[6] client, sends commands and parses the result. It also leverages simple caching techniques to help reduce the load on the BIRD service.

Who

Initially developed by Daniel and MC from Netnod in two days at the RIPE 73 IXP Tools Hackathon in Madrid, Spain.

Running BIRD and parsing the results was added by Veit Heller on behalf of ecix.

With major contributions from: Patrick Seeburger and Benedikt Rudolph on behalf of DE-CIX.

birdwatcher's People

Contributors

annikahannig avatar benerudolph avatar bluikko avatar ctassisf avatar czerwonk avatar dmelani avatar fach avatar hackacad avatar hellerve avatar ihsinme avatar inrin avatar johannesmoos avatar kotronis-te avatar nstgt avatar stv0g avatar trubb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

birdwatcher's Issues

Clarify support for Bird v2.0

Does birdwatcher support both Bird v1 and v2?

I am a bit confused. The README does not mention it.. Same for the alice-lg frontend.
Seems like the IX users DECIX and ECIX are both running Bird v1.6.3

panic: interface conversion: interface {} is nil, not string

birdwatcher (v4) is bailing out with the following messages:

[ ... ]
172.18.20.3 - - [12/Mar/2021:22:50:31 +0100] "GET //routes/table/master HTTP/1.1" 301 55
panic: interface conversion: interface {} is nil, not string

goroutine 31 [running]:
github.com/alice-lg/birdwatcher/bird.parseRouteLines(0x9080400, 0xf, 0x10, 0x4, 0x92d21c0)
        /home/weiti/go/src/github.com/alice-lg/birdwatcher/bird/parser.go:335 +0xe09
github.com/alice-lg/birdwatcher/bird.workerForRouteBlockParsing(0x92d2180, 0x92d21c0, 0x930c330)
        /home/weiti/go/src/github.com/alice-lg/birdwatcher/bird/parser.go:313 +0x87
created by github.com/alice-lg/birdwatcher/bird.startRouteWorkers.func1
        /home/weiti/go/src/github.com/alice-lg/birdwatcher/bird/parser.go:271 +0x4b

the v6 version is running without issues.

IPv6 interface {} is nil, not string

Jan 28 16:52:05 rs1 birdwatcher[485554]: panic: interface conversion: interface {} is nil, not string
Jan 28 16:52:05 rs1 birdwatcher[485554]: goroutine 33 [running]:
Jan 28 16:52:05 rs1 birdwatcher[485554]: github.com/alice-lg/birdwatcher/bird.parseRouteLines(0xc000126400, 0x12, 0x20, 0x75, 0xc000060180)
Jan 28 16:52:05 rs1 birdwatcher[485554]: #11/root/go/pkg/mod/github.com/alice-lg/[email protected]/bird/parser.go:335 +0x1089
Jan 28 16:52:05 rs1 birdwatcher[485554]: github.com/alice-lg/birdwatcher/bird.workerForRouteBlockParsing(0xc000060120, 0xc000060180, 0xc0002a60c0)
Jan 28 16:52:05 rs1 birdwatcher[485554]: #11/root/go/pkg/mod/github.com/alice-lg/[email protected]/bird/parser.go:313 +0x73
Jan 28 16:52:05 rs1 birdwatcher[485554]: created by github.com/alice-lg/birdwatcher/bird.startRouteWorkers.func1
Jan 28 16:52:05 rs1 birdwatcher[485554]: #11/root/go/pkg/mod/github.com/alice-lg/[email protected]/bird/parser.go:271 +0x65
Jan 28 16:52:05 rs1 systemd[1]: birdwatcher6.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 28 16:52:05 rs1 systemd[1]: birdwatcher6.service: Failed with result 'exit-code'.

"protocols" endpoint doesn't show routes count for IPv6 protocol on BIRDv2

Hi,

I found an issue that current birdwatcher can't parse "protocol" for BIRDv2 which run with both IPv4 and IPv6. When I curl to /protocols/bgp, then I could get routes count for IPv4 protocol but couldn't get it for IPv6 like follows:

{
    ...
    "protocols": {
        "B2001_db8__101": {
            "af_announced": "ipv6",
            "bgp_state": "Established",
            "bird_protocol": "BGP",
            "connection": "Established",
            "description": "TEST_PEER_1",
            "hold_timer": "73.180/90",
            "keepalive_timer": "1.859/30",
            "local_as": 65100,
            "neighbor_address": "2001:db8::101",
            "neighbor_as": 65001,
            "neighbor_id": "10.0.0.101",
            "protocol": "B2001_db8__101",
            "route_changes": {},
            "routes": {
                "accepted": 0,
                "exported": 0,
                "filtered": 0,
                "imported": 0,
                "preferred": 0
            },
            "session": "external route-server AS4",
            "source_address": "2001:db8:7:1::211",
            "state": "up",
            "state_changed": "2020-02-23 18:37:40",
            "table": "---"
        }
    }
}

https://github.com/alice-lg/birdwatcher/blob/master/bird/parser.go#L539
To my understanding, this line cause the issue.
The function isCorrectChannel() always returns false while parsing lines following "Channel ipv6" in result of show protocols all B2001_db8__101, because bird.IPVersion is set as "4".

Heavy memory usage

I have a bird instance with one routing table containing ~800k routes. When using birdwatcher to scrape these routes it uses ~8 Gigabytes of RAM. That seems a little much to me..
Bird, which also holds all the data, is using less than 200 Megabytes of memory.

bird:
$ pmap 2080 | tail -n 1 | awk '/[0-9]K/{print $2}'
178672K

birdwatcher:
$ pmap 9470 | tail -n 1 | awk '/[0-9]K/{print $2}'
8245008K

Is there a way to reduce the memory footprint of birdwatcher?

Birdwatcher returns empty array of routes

Hi guys,

When running the URL to see the routes for a specific peer I don't receive anything from birdwatcher:

[email protected]:/root# curl http://103.247.138.73:29184//routes/protocol/103.247.139.24
Moved Permanently.

When checking the raw output in my browser I see nothing in the array:
{"api":{"Version":"2.0.0","result_from_cache":false,"cache_status":{"cached_at":{"date":"2020-12-25T15:43:33.356887066Z","timezone_type":"UTC","timezone":"UTC"}}},"cached_at":"2020-12-25T15:43:33.356887066Z","routes":[],"ttl":"2020-12-25T15:53:33.356887066Z"}

Do you know why this happens? We run Bird 1.6.8 and the latest version of birdwatcher (but same issue was happening in the previous version).

Thank's
Stavros

Install error: cannot find package "go.opentelemetry.io/otel/label"

Hello,

I'm seeing errors in the installation of birdwatcher.

Step 6/18 : RUN go get github.com/alice-lg/birdwatcher
 ---> Running in f2c2b211a6fb
cannot find package "go.opentelemetry.io/otel/label" in any of:
	/usr/local/go/src/go.opentelemetry.io/otel/label (from $GOROOT)
	/root/go/src/go.opentelemetry.io/otel/label (from $GOPATH)

I see that 9 days ago something changed in opentelemetry-go: open-telemetry/opentelemetry-go@ecf65d7

  • Renamed the otel/label package to otel/attribute. (#1541)

Sorry for filing an issue and not a PR to fix it, but at the moment I have zero knowledge of Go.

The problem that Capabilities cannot output.

I want to use birdwatcher to get Local Capabilities and Neighbor Capabilities from BIRDv2.0.7 via API. However, as shown below, both Capabilities are not in output.

        “BXXX_XXX_XXX_XXX”: {
            "action": "restart",
            "af_announced": "ipv4",
            "bgp_next_hop": “XXX.XXX.XXX.XXX”,
            "bgp_state": "Established",
            "bird_protocol": "BGP",
            "connection": "Established",
            "description": “XXXXXX”,
            "hold_timer": “30/30",
            "input_filter": “XXXXXXX”,
            "keepalive_timer": "1/10",
            "local_as": XXXXX,
            "neighbor_address": “XXX”.XXX.XXX.XXX,
            "neighbor_as": XXXXXX,
            "neighbor_id": “XXX.XXX.XXX.XXX”,
            "output_filter": "",
            "preference": 100,
              :
              :

Support for inet-vpn unicast NLRIs (MPLS L3VPN)

Hi,

I was wondering whether there is any possibility to have birdwatcher check inet-vpn unicast routes with a specific route target in BIRD.

I could not find anything in the code or in the documentation, but I think it might be possible with some minor changes. Is there any support planned for this, or is there maybe someone who played with the same thought?

Cheers

Markus

RPM packaging - GitHub Action and RPM issues

I have created a GitHub Action for birdwatcher that builds it for CentOS 7 and packages the RPM. It is at a proof of concept stage and could be improved. For example it uses a CentOS 7 Docker image for build that I baked, so it takes quite a long time to prepare that image every run. The fork is at https://github.com/bluikko/birdwatcher/tree/github-action-rpm

I believe that building birdwatcher RPMs (and Alice-LG Docker images) automatically would be very useful for the users of Alice-LG and birdwatcher.

There were two issues after I tested the resulting RPM:

  1. The configuration file /etc/birdwatcher/birdwatcher.conf has execute bits. I am not sure if this is because of my build system - it is my first time using GitHub Actions and fpm. Has anyone else noticed this?
  2. There are no systemd unit files even though they exist in install/systemd directory in the repository. I reckon one issue with packaging these is whether the BIRD version is 1 or 2 - so should the IPv6 birdwatcher unit file be included.

make install error

is there any howto for linux debian?
current version; go version go1.11.6 linux/amd64

if run make:

GOARCH=amd64 GOOS=linux go build -o birdwatcher-linux-amd64
# _/usr/src/birdwatcher
./birdwatcher.go:36:38: cannot use endpoints.Version(VERSION) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:37:38: cannot use endpoints.Endpoint(endpoints.Status) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:40:41: cannot use endpoints.Endpoint(endpoints.Protocols) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:43:45: cannot use endpoints.Endpoint(endpoints.Bgp) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:46:47: cannot use endpoints.Endpoint(endpoints.ProtocolsShort) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:49:39: cannot use endpoints.Endpoint(endpoints.Symbols) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:52:46: cannot use endpoints.Endpoint(endpoints.SymbolTables) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:55:49: cannot use endpoints.Endpoint(endpoints.SymbolProtocols) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:58:57: cannot use endpoints.Endpoint(endpoints.ProtoRoutes) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:61:49: cannot use endpoints.Endpoint(endpoints.PeerRoutes) (type "github.com/alice-lg/birdwatcher/vendor/github.com/julienschmidt/httprouter".Handle) as type "github.com/julienschmidt/httprouter".Handle in argument to r.GET
./birdwatcher.go:61:49: too many errors
make: *** [Makefile:37: linux] Error 2

How to query v4 and v6 networks

Hi, I have two routes in BIRD's RIB, one for v4 prefix 10.1.1.0/24 and one for v6 prefix 2001:db8:3c4d::/48.
I am using birdwatcher's route_net endpoint, and specifically:

r.GET("/route/net/:net", endpoints.Endpoint(endpoints.RouteNet))

I have two questions:

  • For v4, I can only query without the netmask, like
/route/net/10.1.1.0

Is there a way to query with the netmask?

  • For v6, I cannot get the query to work at all, possibly due to the : format. Do you have a practical example of a working v6 query?
/route/net/2001:db8:3c4d::

Same question about the netmask too, as long as v6 works of course.

Unable to build docker container: failed to solve: ehlers/bird2

Build using Dockerfile of latest repo causes following result:

[+] Building 1.6s (4/4) FINISHED                                                                                                                                                                                                               
 => [internal] load build definition from Dockerfile                                                                                                                                                                                      0.1s
 => => transferring dockerfile: 588B                                                                                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                         0.0s
 => => transferring context: 2B                                                                                                                                                                                                           0.0s
 => ERROR [internal] load metadata for docker.io/ehlers/bird2:latest                                                                                                                                                                      1.4s
 => CANCELED [internal] load metadata for docker.io/library/golang:1.13                                                                                                                                                                   1.5s
------
 > [internal] load metadata for docker.io/ehlers/bird2:latest:
------
Dockerfile:21
--------------------
  19 |     
  20 |     # Add birdwatcher to bird
  21 | >>> FROM ehlers/bird2
  22 |     
  23 |     COPY --from=app /src/birdwatcher/birdwatcher-linux-amd64 /usr/bin/birdwatcher
--------------------
ERROR: failed to solve: ehlers/bird2: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I have checked in docker hub - ehlers/bird2 really is absent.

Killed

Housekeeping started
Expiring MemoryCache
Expired 0 entries (MemoryCache)
Freeing memory
192.168.1.70 - - [23/Jul/2019:07:11:55 +0000] "GET /protocols HTTP/1.1" 200 819
192.168.1.70 - - [23/Jul/2019:07:12:02 +0000] "GET /protocols HTTP/1.1" 200 818
192.168.1.70 - - [23/Jul/2019:07:12:02 +0000] "GET /status HTTP/1.1" 200 317
192.168.1.70 - - [23/Jul/2019:07:12:10 +0000] "GET /protocols HTTP/1.1" 200 818
192.168.1.70 - - [23/Jul/2019:07:12:02 +0000] "GET /routes/peer/192.168.1.251 HTTP/1.1" 200 19704766
192.168.1.70 - - [23/Jul/2019:07:12:37 +0000] "GET /protocols HTTP/1.1" 200 818
192.168.1.70 - - [23/Jul/2019:07:12:37 +0000] "GET /routes/filtered/AS65535 HTTP/1.1" 200 172
192.168.1.70 - - [23/Jul/2019:07:12:40 +0000] "GET /protocols HTTP/1.1" 200 818
192.168.1.70 - - [23/Jul/2019:07:12:40 +0000] "GET /routes/peer/192.168.1.251 HTTP/1.1" 500 28
Killed

possible because view of full table?

API docs

Hi,

where I can find the whole endpoints list?
I could not find it anywhere!

Many thanks for your incredible work!

Bird Unreachable errors after route server migration

Hello,

Recently one of our route servers crashed and we had to do a migration to another server. We have set up everything correctly and in the process upgraded Bird to 2.14 from 1.6.8 . We have the IXP Manager internal looking glass working fine but somehow Alice-LG does not seem to connect to the new installation. Birdwatcher cannot find bird on the new server and so shows "Bird Uncreachable" errors all the time. We have tried multiple birdwatcher versions and also trying to use previously working versions without success.. Anyway to debug what the issue is?

Logs as below:

root@ip-172-31-14-139:~# curl http://172.17.139.81:29184/status
{"error":"bird unreachable"}

root@rs1:~# service birdwatcher status
● birdwatcher.service - birdwatcher
Loaded: loaded (/etc/systemd/system/birdwatcher.service; disabled; vendor preset: enabled)
Active: active (running) since Mon 2024-02-12 17:06:27 IST; 5h 13min ago
Main PID: 8210 (birdwatcher)
Tasks: 8 (limit: 17841)
Memory: 2.9M
CPU: 4.172s
CGroup: /system.slice/birdwatcher.service
└─8210 /usr/sbin/birdwatcher -config /usr/local/etc/birdwatcher.conf

Feb 12 22:11:28 rs1 birdwatcher[8210]: Housekeeping started
Feb 12 22:11:28 rs1 birdwatcher[8210]: Expiring MemoryCache
Feb 12 22:11:28 rs1 birdwatcher[8210]: Expired 0 entries (MemoryCache)
Feb 12 22:11:28 rs1 birdwatcher[8210]: Freeing memory
Feb 12 22:16:28 rs1 birdwatcher[8210]: Housekeeping started
Feb 12 22:16:28 rs1 birdwatcher[8210]: Expiring MemoryCache
Feb 12 22:16:28 rs1 birdwatcher[8210]: Expired 0 entries (MemoryCache)
Feb 12 22:16:28 rs1 birdwatcher[8210]: Freeing memory
Feb 12 22:20:21 rs1 birdwatcher[8210]: 172.31.14.139 - - [12/Feb/2024:22:20:21 +0530] "GET /status HTTP/1.1" 500 28
Feb 12 22:20:23 rs1 birdwatcher[8210]: 172.31.14.139 - - [12/Feb/2024:22:20:23 +0530] "GET /status HTTP/1.1" 500 28

Any help will be appreciated. Birdwatcher is latest.

Unable to install; error with go-redis

Hapens with Go 1.14 (can build it manually) and 1.10

# go get github.com/alice-lg/birdwatcher
# github.com/alice-lg/birdwatcher/bird
go/src/github.com/alice-lg/birdwatcher/bird/redis_cache.go:25:23: not enough arguments in call to client.cmdable.Ping
	have ()
	want (context.Context)
go/src/github.com/alice-lg/birdwatcher/bird/redis_cache.go:39:30: not enough arguments in call to self.client.cmdable.Get
	have (string)
	want (context.Context, string)
go/src/github.com/alice-lg/birdwatcher/bird/redis_cache.go:71:27: not enough arguments in call to self.client.cmdable.Set
	have (string, []byte, time.Duration)
	want (context.Context, string, interface {}, time.Duration)

Support for Bird2 ipv4 and ipv6 in a single daemon

Hi, we are running bird2.0.7 in a single daemon supporting both ipv4 and ipv6.

We have found that birdwatcher works well with our installation with just one exception - /protocols/bgp does not return any route summary data for IPv6 sessions.

We have tracked it down to bird/parser.go's isCorrectChannel function which appears to only support either v4 or v6 but not both in the same instance.

Is there any way to work around this issue?

Cheers

undefined: sync.Map

go get github.com/alice-lg/birdwatcher

github.com/alice-lg/birdwatcher/bird

go/src/github.com/alice-lg/birdwatcher/bird/bird.go:31: undefined: sync.Map

how can i fix this? any software missing?

Birdwatcher enabling more secure TLS communication

Hello,

Thank you for the job.
We would like to be able to disable TLS v1.0 and v1.1 and maybe use stronger Ciphers than the default ones.

It does not seem to be configurable.
I am not a developer that is why I cannot affirm anything.

I think the TLS configuration for Birdwatcher is using this package: https://pkg.go.dev/crypto/tls
If it is the case, it should be possible to implement this ability.

Thanks in advance for any feedback.

bird route parsing (startDefinition)

I have found this old issue pointing to an issue when having dashes inside the protocol name within the bird config: ecix/alice-lg#12
This means that e.g. coreX_city does not work as protocol name.

From my understanding this is due to

regex.routes.startDefinition = regexp.MustCompile(`^([0-9a-f\.\:\/]+)\s+via\s+([0-9a-f\.\:]+)\s+on\s+([\w\.]+)\s+\[([\w\.:]+)\s+([0-9\-\:\s]+)(?:\s+from\s+([0-9a-f\.\:\/]+)){0,1}\]\s+(?:(\*)\s+){0,1}\((\d+)(?:\/\d+){0,1}\).*`)
which parses [\w.:]+ for the protocol name. Would it be possible to change this to [0-9a-zA-Z_-.:]+?

Another issue I have found on our setup is the second value of the distance, e.g.:
aaaa:a401:8007::/48 via aaaa:bbbb:e001::1 on eth0 [corexcity 2019-12-27 14:03:10 from aaaa:bbbb:1337:5::7] * (100**/?**) [AS11111i]

This is not parsed because of the ?. This could be fixed by changing (?:/\d+) to (?:/[?\d]+)

Would it be possible to fix those or document the conditions that need to be fulfilled by the environment?

birdwatcher randomly crashes

-- Logs begin at Sat 2019-12-28 09:50:05 CET. --
déc. 28 18:06:45 edge1 birdwatcher[12824]: panic: interface conversion: interface {} is nil, not string
déc. 28 18:06:45 edge1 birdwatcher[12824]: goroutine 33 [running]:
déc. 28 18:06:45 edge1 birdwatcher[12824]: github.com/alice-lg/birdwatcher/bird.parseRouteLines(0xc000166400, 0x12, 0x20, 0x3, 0xc00005e180)
déc. 28 18:06:45 edge1 birdwatcher[12824]: /root/go/src/github.com/alice-lg/birdwatcher/bird/parser.go:329 +0xf4c
déc. 28 18:06:45 edge1 birdwatcher[12824]: github.com/alice-lg/birdwatcher/bird.workerForRouteBlockParsing(0xc00005e120, 0xc00005e180, 0xc00007a000)
déc. 28 18:06:45 edge1 birdwatcher[12824]: /root/go/src/github.com/alice-lg/birdwatcher/bird/parser.go:307 +0x73
déc. 28 18:06:45 edge1 birdwatcher[12824]: created by github.com/alice-lg/birdwatcher/bird.startRouteWorkers.func1
déc. 28 18:06:45 edge1 birdwatcher[12824]: /root/go/src/github.com/alice-lg/birdwatcher/bird/parser.go:265 +0x60
déc. 28 18:06:45 edge1 systemd[1]: birdwatcher4.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
déc. 28 18:06:45 edge1 systemd[1]: birdwatcher4.service: Failed with result 'exit-code'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.