sonic-buildimage/dockers/docker-fpm-frr/frr/common/functions.conf.j2
Prince Sunny b1acfb60a7 Skip vnet-vxlan interfaces from generating networks (#5251)
* Skip Vnet interface from generating networks
2020-09-03 15:49:59 -07:00

36 lines
948 B
Django/Jinja

{% macro get_ipv4_loopback_address(interfaces, loopbackname) -%}
{% set L = namespace(ip=None) %}
{% for name, prefix in interfaces|pfx_filter %}
{% if name == loopbackname %}
{% if prefix | ipv4 %}
{% set L.ip = prefix %}
{% endif %}
{% endif %}
{% endfor %}
{{ L.ip }}
{%- endmacro %}
{% macro get_ipv6_loopback_address(interfaces, loopbackname) -%}
{% set L = namespace(ip=None) %}
{% for name, prefix in interfaces|pfx_filter %}
{% if name == loopbackname %}
{% if prefix | ipv6 %}
{% set L.ip = prefix %}
{% endif %}
{% endif %}
{% endfor %}
{{ L.ip }}
{%- endmacro %}
{% macro get_vnet_interfaces(interfaces) -%}
{% set L = namespace(intfs=[]) %}
{% set vnet_intfs = [] %}
{% for (key, metadata) in interfaces.iteritems() %}
{% if metadata.has_key("vnet_name") %}
{% set vnet_intfs = vnet_intfs.append(key) %}
{% endif %}
{% endfor %}
{% set L.intfs = vnet_intfs %}
{{ L.intfs }}
{%- endmacro %}