alice-lg / birdwatcher

A JSON API for BIRD
BSD 3-Clause "New" or "Revised" License
68 stars 41 forks source link

bird route parsing (startDefinition) #13

Open empi89 opened 4 years ago

empi89 commented 4 years ago

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

From my understanding this is due to https://github.com/alice-lg/birdwatcher/blob/b7d8845eda2fcfdd4368984c36936e58e523d490/bird/parser.go#L76 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?