-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Quagga: Add BGP to UI #112
Conversation
Added bgpd.conf
Need many replaces
Needs multiple replacements
needs many adjustments
Need to replace Network to router ASN
Perhaps we can use this file as a template for Route-map
|
@fabianfrz OK please review, I'm finished now. With this stage you can run basic eBGP and iBGP. There are hundreds of options missing like route-maps etc. but for basic BGP this runs fine. EDIT: Thank you for your help! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far but contains little issues.
@fichtner If the changes are done fast, this may go into the release build.
| <default></default> | ||
| <Required>N</Required> | ||
| </updatesource> | ||
| <nexthopself type="BooleanField"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks strange (indent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
| <th data-column-id="remoteas" data-type="string" data-visible="true">{{ lang._('Remote AS') }}</th> | ||
| <th data-column-id="updatesource" data-type="string" data-visible="true">{{ lang._('Update Source Address') }}</th> | ||
| <th data-column-id="nexthopself" data-type="string" data-formatter="rowtoggle">{{ lang._('Next Hop Self') }}</th> | ||
| <th data-column-id="defaultoriginate" data-type="string" data-formatter="rowtoggle">{{ lang._('Default Originate') }}</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it looks ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabs vs. spaces, indent is PSR style, 4 spaces per indent
but we have a style fixer for this too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, within github UI it's ok. So I'll leave it and you'll fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mixed spaces and tabs. I replaced the tabs in those two lines with the same amount of spaces like the other lines. looks better now. In general, we do not use tabs in the source.
| <td colspan="5"></td> | ||
| <td> | ||
| <button data-action="add" type="button" class="btn btn-xs btn-default"><span class="fa fa-plus"></span></button> | ||
| <!-- <button data-action="deleteSelected" type="button" class="btn btn-xs btn-default"><span class="fa fa-trash-o"></span></button> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may remove this button if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd let it there if it's ok for you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem.
| {% endif %} | ||
| {% if helpers.exists('OPNsense.quagga.bgp.neighbors.neighbor') %} | ||
| {% for neighbor in helpers.toList('OPNsense.quagga.bgp.neighbors.neighbor') %} | ||
| {% if neighbor.enabled == '1' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you may put the whole thing under an if statement which checks if it is enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I put all under an if, seems to work fine, thanks for the hint!
| {% if neighbor.enabled == '1' %} | ||
| neighbor {{ neighbor.address }} remote-as {{ neighbor.remoteas }} | ||
| {% endif %} | ||
| {% if neighbor.enabled == '1' and neighbor.updatesource != '' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a field which is not required - replace neighbor.enabled == '1' by an existence check - also at the other lines later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I don't check for neighbor enabled these line will stay if I disable a neighbor. I'll try to put the whole thing under an if as you stated before
| {# | ||
|
|
||
| OPNsense® is Copyright © 2014 – 2017 by Deciso B.V. | ||
| This file is Copyright © 2017 by Fabian Franz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really not your copyright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied your file and replaced ospf with bgp, it's yours :)
I added a noted with my name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
files are copied, your own copyrights are added, no additions that weren't in there before. @fabianfrz must add his copyrights on his own (or not)
| return $result; | ||
| } | ||
|
|
||
| ///////////////////////////////////////////////////////////////////// TO BE REVIEWED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it's gone and I added some newlines before the functions
| use \OPNsense\Base\UIModelGrid; | ||
| /** | ||
| * Copyright (C) 2015 - 2017 Deciso B.V. | ||
| * Copyright (C) 2017 Fabian Franz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not your copyright?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, it's yours!
| <Required>N</Required> | ||
| </nexthopself> | ||
| <defaultoriginate type="BooleanField"> | ||
| <default>0</default> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already fixed
| @@ -2,6 +2,7 @@ | |||
| namespace OPNsense\Quagga; | |||
| /* | |||
| Copyright (C) 2017 Fabian Franz | |||
| Modified for BGP functionality by Michael Muenz | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should really read the following:
Copyright (C) 2017 Michael Muenz
don't be shy :)
|
@fabianfrz @fichtner Ok I'm done with the reviews so far, thanks for the fast review! |
|
@fabianfrz Stupid question: Do have to edit the indent stuff on my own or will your commit merged too? |
|
Everything will be merged together as it is on your branch. |
|
@mimugmail is is probably only the template that needs changes (maybe whitespace stuff too). I think we can merge it after this changes are done. I am sure @fichtner could do the whitespace cleanup. |
|
I close this for #121 |
|
@mimugmail your changes are merged now. |
|
Please delete your changes from |
Ok, so I've changed all the stuff, but still the bgpd.conf is empty and there's no error when trying to enable it.