New bgpscanner backwards compatibility script is now available.
Lately I had the pleasure to be in contact with many old time
A question popped up frequently during our conversations.
- I used to do
bgpgrepdo the same, and how?
That’s when the fact hit me, that
bgpscanner probably had a larger userbase relying
on it for day to day work than I originally anticipated.
peerindex are not exactly backwards compatible.
While probably being very convenient to new users, it could throw off
the experienced userbase that has been familiar with
bgpscanner for years.
Even worse, it could make existing scripts instantly unusable.
This convinced me that providing a backwards compatibility feature might be a good idea to help users familiarize with the new tool while also providing a smoother transition curve.
Coming back to the recurring question, yes,
bgpscanner can do.
To top it off,
bgpgrep does what
bgpscanner does not.
That was actually the most fundamental reason that encouraged me to break
bgpgrep provides extreme flexibility in filtering specification, letting
the user combine freely multiple conditions and chain them arbitrarily with
bgpscanner could do only to a very limited extent.
This while also being intuitive with its syntax.
But that doesn’t eliminate the fact that
bgpscanner was already pretty powerful
by itself, and it did things in a different way. So what?
bgpscanner legacy wrapper script.
The third tool in µbgpsuite arsenal (they grow so fast ♥).
A somewhat pragmatic, crude, grumpy – yet fascinating in its own special way,
POSIX shell wrapper script capable of converting (almost) any invocation of
bgpscanner to an equivalent invocation of
bgpscanner legacy wrapper a drop-in replacement for the
While this is satisfactory by itself, it didn’t feel quite alright.
In my book
bgpscanner is still an obsolete tool (hence the “legacy” in “wrapper script”).
Being able to actually learn how to do things with new tools would be
much better than relying on the old ways.
This is when it hit me again, the wrapper script already does all the hard work to figure out how to make an equivalent call to µbgpsuite native tools. Why not just print the result, instead of executing it?
$ PRETEND=y bgpscanner -i 22.214.171.124 -p "137 2598$" -u 126.96.36.199/32 data/rib/bview.20181016.0800.gz bgpgrep -- data/rib/bview.20181016.0800.gz -peer \( 188.8.131.52 \) -supernet \( 184.108.40.206/32 \) -aspath "137 2598$"
Isn’t it awesome? With just a tiny
PRETEND=y flag, we can now interactively learn
how to convert an old invocation to the new format.
True, it might not be the best, most expressive, most idiomatic way to write the query,
but it is an excellent starting point.
You can install the
bgpscanner legacy wrapper script along with other µbgpsuite
tools by enabling the
bgpscanner-legacy configuration option with
$ meson configure -Dbgpscanner-legacy=true
inside your µbgpsuite build directory and it will be installed along with the
other tools upon
Obviously, it wouldn’t be a true announcement post, if I didn’t also mention
bgpscanner legacy wrapper script is documented in its own fantastic
And that you’re just one command away from having a beautiful PDF with its contents:
$ sed s/@UTILITY@/bgpscanner/g tools/bgpscanner/bgpscanner.1.in | groffer
bgpscanner legacy wrapper tool will be at least as useful to you as
it was fun for me to write.
P.S. A gigantic and special thank you to Rich’s sh (POSIX shell) tricks, for its enlightening list of shell recipes. In my opinion one of the most fundamental reads that anybody writing a shell script should go through.