Skip to content

Commit

Permalink
Merge pull request #2 from internet2/rnobrega
Browse files Browse the repository at this point in the history
Rnobrega
  • Loading branch information
knewell authored Mar 18, 2019
2 parents 9baf12c + 0ab5a9e commit d5517c1
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 48 deletions.
92 changes: 49 additions & 43 deletions template/set-flow-route.conf
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
routing-options {
flow {
route {{ flowRouteName }} {
match {
{%- if dstPrefix is defined and dstPrefix !=None %}
destination {{dstPrefix}};
{%- endif %}
{%- if dstPort is defined and dstPort !=None %}
destination-port {{ dstPort }};
{%- endif %}
{%- if dscp is defined and dscp !=None %}
dscp {{dscp}};
{%- endif %}
{%- if fragment is defined and fragment !=None %}
fragment {{fragment}};
{%- endif %}
{%- if icmp_code is defined and icmp_code !=None %}
icmp-code {{icmp_code}};
{%- endif %}
{%- if icmp_type is defined and icmp_type !=None %}
icmp-type {{icmp_type}};
{%- endif %}
{%- if packet_length is defined and packet_length !=None %}
packet-length {{packet_length}};
{%- endif %}
{%- if port is defined and port !=None %}
port {{port}};
{%- endif %}
{%- if protocol is defined and protocol !=None %}
protocol {{protocol}};
{%- endif %}
{%- if srcPrefix is defined and srcPrefix !=None %}
source {{srcPrefix}};
{%- endif %}
{%- if srcPort is defined and srcPortt !=None %}
source-port {{srcPort}};
{%- endif %}
{%- if tcp_flags is defined and tcp_flags !=None %}
tcp-flags {{tcp_flags}};
{%- endif %}
}
then {
{%- if vrf is defined %}
routing-instances {
{{vrf}} {
{%- endif %}
routing-options {
flow {
route {{ flowRouteName }} {
match {
{%- if dstPrefix is defined and dstPrefix !=None %}
destination {{dstPrefix}};
{%- endif %}
{%- if dstPort is defined and dstPort !=None %}
destination-port {{ dstPort }};
{%- endif %}
{%- if dscp is defined and dscp !=None %}
dscp {{dscp}};
{%- endif %}
{%- if fragment is defined and fragment !=None %}
fragment {{fragment}};
{%- endif %}
{%- if icmp_code is defined and icmp_code !=None %}
icmp-code {{icmp_code}};
{%- endif %}
{%- if icmp_type is defined and icmp_type !=None %}
icmp-type {{icmp_type}};
{%- endif %}
{%- if packet_length is defined and packet_length !=None %}
packet-length {{packet_length}};
{%- endif %}
{%- if port is defined and port !=None %}
port {{port}};
{%- endif %}
{%- if protocol is defined and protocol !=None %}
protocol {{protocol}};
{%- endif %}
{%- if srcPrefix is defined and srcPrefix !=None %}
source {{srcPrefix}};
{%- endif %}
{%- if srcPort is defined and srcPortt !=None %}
source-port {{srcPort}};
{%- endif %}
{%- if tcp_flags is defined and tcp_flags !=None %}
tcp-flags {{tcp_flags}};
{%- endif %}
}
then {
{{action}};
}
}
{%- if vrf is defined %}
}
}
}
{%- endif %}
17 changes: 12 additions & 5 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<title>BGP Flow Spec Demo</title>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/css/bootstrap-dialog.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.4/css/bootstrap-dialog.min.css">
<link href="ui.css" rel="stylesheet">

</head>
Expand Down Expand Up @@ -251,7 +251,14 @@ <h4 class="modal-title">Add new flow route</h4>
</select>
</div>
</div>

<div class="form-group row" id="fg_vrf">
<label for="selectVrf" class="col-sm-2 col-form-label">VRF</label>
<div class="col-sm-3">
<select class="form-control" id="selectVrf">
<option>re</option>
<option>trcps</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
Expand Down Expand Up @@ -341,8 +348,8 @@ <h4 class="modal-title">Modify Flow Route</h4>
crossorigin="anonymous">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/js/bootstrap-dialog.min.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.35.4/js/bootstrap-dialog.min.js"></script>
<script type="text/javascript" charset="utf8" src="ui.js"></script>
</body>
</html>
2 changes: 2 additions & 0 deletions ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ function flowRouteAddNewConfigEventHandler(){
data.protocol = $('#selectProtocol').val();
}

data.vrf = $('#selectVrf').val();

data.action = $('#selectAddNewFlowAction').val();

if (data.action == 'community') {
Expand Down

0 comments on commit d5517c1

Please sign in to comment.