bird: function -> filter
This commit is contained in:
parent
6773c5e90d
commit
ac9947c50f
1 changed files with 6 additions and 6 deletions
|
@ -116,7 +116,7 @@ protocol ospf v3 ospf6 {
|
|||
}
|
||||
{% endif %}
|
||||
|
||||
{% macro bird_filter_function(filter, last) %}
|
||||
{% macro bird_filter(filter, last) %}
|
||||
{% if filter.as_prepend is defined %}
|
||||
{% for _ in range(filter.as_prepend.size) %}
|
||||
bgp_path.prepend({{ filter.as_prepend.asn }});
|
||||
|
@ -133,7 +133,7 @@ return {{ filter.accept | ternary("true", "false") }};
|
|||
{% for session in bird__bgp_sessions %}
|
||||
{% for version in [4, 6] %}
|
||||
{% for direction in ["import", "export"] %}
|
||||
function bgp{{ version }}_{{ direction }}_{{ session.name }}() {
|
||||
filter bgp{{ version }}_{{ direction }}_{{ session.name }} {
|
||||
{% for filter in session[direction] %}
|
||||
{% if filter.prefix | default([]) %}
|
||||
{% set op =
|
||||
|
@ -149,11 +149,11 @@ function bgp{{ version }}_{{ direction }}_{{ session.name }}() {
|
|||
| ternary("+", "")) %}
|
||||
{% if networks %}
|
||||
if net {{ op }} [ {{ networks | join(", ") }} ] then {
|
||||
{{ bird_filter_function(filter) | indent(8) }}
|
||||
{{ bird_filter(filter) | indent(8) }}
|
||||
}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{{ bird_filter_function(filter) | indent(4) }}
|
||||
{{ bird_filter(filter) | indent(4) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
|
@ -177,8 +177,8 @@ protocol bgp bgp{{ version }}_{{ session.name }} {
|
|||
neighbor {{ remote_address }} as {{ session.remote.as }};
|
||||
|
||||
{{ "ipv4" if version == 4 else "ipv6" }} {
|
||||
import where bgp{{ version }}_import_{{ session.name }}();
|
||||
export where bgp{{ version }}_export_{{ session.name }}();
|
||||
import filter bgp{{ version }}_import_{{ session.name }};
|
||||
export filter bgp{{ version }}_export_{{ session.name }};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue