Skip to content
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

Merged
merged 76 commits into from
Apr 15, 2017
Merged

[WIP] Quagga: Add BGP to UI #112

merged 76 commits into from
Apr 15, 2017

Conversation

mimugmail
Copy link
Member

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.

@mimugmail
Copy link
Member Author

mimugmail commented Apr 12, 2017

@fabianfrz OK please review, I'm finished now.
I'm able to add und remove peer's, set remote as and next-hop-self and update-source.

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! 👍

Copy link
Member

@fabianfrz fabianfrz 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 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">
Copy link
Member

Choose a reason for hiding this comment

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

looks strange (indent)

Copy link
Member Author

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>
Copy link
Member

Choose a reason for hiding this comment

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

indent

Copy link
Member Author

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?

Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

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> -->
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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' %}
Copy link
Member

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

Copy link
Member Author

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 != '' %}
Copy link
Member

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

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

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

really not your copyright?

Copy link
Member Author

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

Copy link
Member

@fichtner fichtner Apr 12, 2017

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
Copy link
Member

Choose a reason for hiding this comment

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

remove this line

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

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

Not your copyright?

Copy link
Member Author

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>
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Member Author

Choose a reason for hiding this comment

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

Already fixed

@fabianfrz fabianfrz changed the title [WIP] Quagga: Add BGP to UI / 2 [WIP] Quagga: Add BGP to UI Apr 12, 2017
@@ -2,6 +2,7 @@
namespace OPNsense\Quagga;
/*
Copyright (C) 2017 Fabian Franz
Modified for BGP functionality by Michael Muenz
Copy link
Member

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 :)

@mimugmail
Copy link
Member Author

@fabianfrz @fichtner Ok I'm done with the reviews so far, thanks for the fast review!

@mimugmail
Copy link
Member Author

@fabianfrz Stupid question: Do have to edit the indent stuff on my own or will your commit merged too?

@fabianfrz
Copy link
Member

Everything will be merged together as it is on your branch.

@fabianfrz
Copy link
Member

@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.

@fabianfrz fabianfrz mentioned this pull request Apr 14, 2017
Merged
@fabianfrz
Copy link
Member

I close this for #121

@fabianfrz fabianfrz closed this Apr 14, 2017
@fabianfrz fabianfrz reopened this Apr 15, 2017
@fabianfrz fabianfrz merged commit 04c0efc into opnsense:master Apr 15, 2017
@fabianfrz
Copy link
Member

@mimugmail your changes are merged now.

@fabianfrz
Copy link
Member

Please delete your changes from master now or create a new clone so you can fast forward your master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new functionality
Development

Successfully merging this pull request may close these issues.

3 participants