Skip to content

net/frr: replace legacy ruby code, get rid of dependency#2143

Merged
AdSchellevis merged 35 commits into
opnsense:masterfrom
marcquark:frr_remove_ruby
Dec 22, 2020
Merged

net/frr: replace legacy ruby code, get rid of dependency#2143
AdSchellevis merged 35 commits into
opnsense:masterfrom
marcquark:frr_remove_ruby

Conversation

@marcquark
Copy link
Copy Markdown
Contributor

@marcquark marcquark commented Dec 12, 2020

closes #2101
closes #1877
closes #2137
very much a work in progress, will continue to add commits

@marcquark marcquark marked this pull request as ready for review December 12, 2020 22:36
@marcquark marcquark marked this pull request as draft December 12, 2020 22:37
@AdSchellevis AdSchellevis self-assigned this Dec 13, 2020
@marcquark
Copy link
Copy Markdown
Contributor Author

converting to a tree style display format could come in handy for OSPF interfaces and maybe also the overview. but routing tables should be kept in a tabular format imho (they're tables after all).

quick & dirty to at least get it into the GUI
JSON support is already in FRR upstream
use plaintext output until it's available in a package
@marcquark
Copy link
Copy Markdown
Contributor Author

I'd like to try out FRR 7.5 because I suspect it could already have JSON support for show ip ospf database aswell as show ipv6 ospf6 *. The docs aren't super clear - they only list the json commands in "latest". However some of the commands have obviously already made it into 7.4, and 7.5 is pretty new. Would like to at least give it a shot before i spend time writing a parser...

Anyway, i'm not much of a BSD guy. Could use some guidance as to how i can install v7.5. According to https://www.freshports.org/net/frr7/ it should be available somewhere in the FreeBSD 12 ports. I just have no clue where to look, and even if i found it, don't know how i would go about actually installing it. The FreeBSD docs seem to be offline at the moment, which doesn't help either...

@AdSchellevis
Copy link
Copy Markdown
Member

@marcquark our's is still at 7.4 (https://github.com/opnsense/ports/blob/master/net/frr7/Makefile), upstream (FreeBSD) seems to ship 7.5 at the moment (https://github.com/freebsd/freebsd-ports/blob/master/net/frr7/Makefile). Given the incompatibilities in the past, I expect we're not switching ours over instantly. The easiest step is probably to install our build tools (https://github.com/opnsense/tools) and copy their frr7 port in (either cherry pick or just download the changed files).

The normal ports installation procedure is documented at FreeBSD (https://www.freebsd.org/doc/handbook/ports-using.html) as well.

@fichtner
Copy link
Copy Markdown
Member

Yes, @mimugmail is still opting for 7.4 at this point due to general breakage in the 7 series...

@marcquark
Copy link
Copy Markdown
Contributor Author

I tested 7.5 from the FreeBSD ports and it doesn't add any of the JSON commands. So they likely won't be available for the plugin anytime soon. Parsing it is then.

@marcquark
Copy link
Copy Markdown
Contributor Author

summoning @mimugmail @fichtner @AdSchellevis
I need some help. Can't figure out how to make FRR output "Net Link States" without explicitly using show ip ospf database network, and even then the output is empty on my test installs. Do they only appear in certain non-trivial setups? I mimiced the parsing logic from the original script but have no way of verifying that it actually works. Maybe the default output of FRR for show ip ospf database has changed over time without anybody noticing?

If any of you can produce such output, could you please upload it so i can use it for testing?

@AdSchellevis
Copy link
Copy Markdown
Member

probably @mimugmail can try this on his end, I only have a boring pretty empty setup over here, which outputs an empty dataset like yours:

# show ip ospf database network

       OSPF Router with ID (192.168.123.125)


                Net Link States (Area 0.0.0.0)

@marcquark marcquark marked this pull request as ready for review December 17, 2020 16:12
@marcquark
Copy link
Copy Markdown
Contributor Author

finished :-) pls give it a test and lmk if you encounter and bugs or have suggestions for improvements

BTW should i also commit an update to the changelog in pkg-descr?

@AdSchellevis
Copy link
Copy Markdown
Member

I'll try to give it a spin on my end, check the code style and if @mimugmail agrees pull it into master for further testing.

@mimugmail
Copy link
Copy Markdown
Member

Please bump to 1.21 and add a Changelog :)
Tonight I have a maintenance and can test it as well .. would be nice to have this one

@marcquark
Copy link
Copy Markdown
Contributor Author

sure thing, there u go

Copy link
Copy Markdown
Member

@mimugmail mimugmail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you 👍
For me it's ok if it stays in master for a while.

I didn't test multi area ospf yet, maybe over christmas season.

@AdSchellevis
Copy link
Copy Markdown
Member

I've some style fixes and typo corrections stashed, will commit them with the merge of this one. The python script is a bit difficult to read, but since it's only temporary until frr supports json on the other commands as well, I don't mind pulling it in.

The user interface diagnostics code in general is quite buggy, lot's of errors in your browser when functionality isn't used, but this was already the case.

@marcquark thanks, and if you would like to add your name/email to the license, just open a new PR for the files you changed, I only added your name to the python script.

AdSchellevis added a commit that referenced this pull request Dec 22, 2020
@AdSchellevis AdSchellevis merged commit 40b23a0 into opnsense:master Dec 22, 2020
windgmbh pushed a commit to windgmbh/opnsense-plugins that referenced this pull request Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

FRR v1.19 Routing: Diagnostics: General:IPv4 Routes FRR: replace ruby dependancy Increase BGP functionality

4 participants