Hi Thomas and others, thanks for your quick replies. To make things more clear, our project at NLnet Labs is the development of "a modern IRRtoolset" written in Python and targeting any operator, not just another homemade tool for our own needs. Or to say in more detail the creation of a tool that is able to configure BGP routers directly+automatically by extracting the policies from RIPE DB. This means that I am struggling to avoid the (re)use of any past or legacy software that exists, otherwise we loose independency and inherit restrictions from the past. Currently, I do have a working proof of concept with a simple RPSL parser written in Python which is able to parse simple policies with (v6)import(s)-(v6)export(s)-accept-announce-action-pref-med-coomunity attributes. Convenient I would say for many existing policies like KPN’s, RIPE’s etc. but definitely it will crash in complex policy files like GRNET’s. My current solution uses also BGPq3 to translate AS, AS-SET and ROUTE-SET and this is also something that I want to ged rid of. So I was looking for the existence of a Python Library which can do a complete job and translate any existing policy in an intermediate data structure like XML (this is what I do now). I was hoping to find one, adopt it and present our (completed) work in the next RIPE meeting (yes I know I am very ambitious, I need to slow down). * Masimo, I already checked rpsltool and discarded it. But thanks for your super-fast reply. * Tomas, thanks for pointing me to your library. I will have a look at it and check if it is convenient for our project. * George, yes you are right. This should be the #1 step, take corresponding RPSL RFCs and implement them in Python. However, that would take too much time and will not allow us to work on other missing functionalities of the prototype. And we would like to have something ready at the beginning of November. However, I will check your solution as well. I hope now that I made myself more clear. Big thanks to everyone, every help, info or idea is kindly appreciated. Kind Regards Stavros ---- Stavros Konstantaras Internet Research Engineer, NLnet Labs Science Park 400, 1098 XH, Amsterdam Fingerprint: 4502 7D16 2DF8 ADB0 4AA6 21A9 BF9E EFFF 2744 FE5D
On 19 Aug 2015, at 14:39, Tomas Hlavacek <tomas.hlavacek@nic.cz> wrote:
Hi Stavros!
On 08/19/2015 02:15 PM, Ondrej Filip wrote:
Vis o necem?
-------- Forwarded Message -------- Subject: [opensource-wg] Question for RPSL Parser Date: Wed, 19 Aug 2015 14:13:58 +0200 From: Stavros Konstantaras <stavros@nlnetlabs.nl> To: db-wg@ripe.net CC: opensource-wg@ripe.net
Hi all WG members,
For my project at NLnet Labs I would like to ask you if you know any (relatively) complete RPSL parser written in *Python*. I searched around and I didnât find anything. Does someone know any repository where I can get one or maybe contact someone who has written one?
It depends on what you need... I wrote one - https://github.com/tmshlvck/bgpcrunch , but the aim was rather data analysis than "authoritative" RPSL translation. When it comes to filter interpretation my approach is quite "heuristic" and it is focused on speed and ability to take short-cuts which wouldn't be possible with full parsing the RPSL objects according to EBNF metasyntax.
Have you considered creating simple Python interface for peval from IRRToolSet? It might do the job if you don't need any special features.
Cheers, Tomas