[frr]: RR client support in minigraph for FRR (#923)

This commit is contained in:
nikos-li 2017-09-12 15:48:38 -07:00 committed by Shuotian Cheng
parent c9cc7aea41
commit 686e227dcc
2 changed files with 11 additions and 0 deletions

View File

@ -57,12 +57,18 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
{% if neighbor_addr | ipv4 %}
address-family ipv4
neighbor {{ neighbor_addr }} activate
{% if bgp_session['rrclient'] != 0 %}
neighbor {{ neighbor_addr }} route-reflector-client
{% endif %}
maximum-paths 64
exit-address-family
{% endif %}
{% if neighbor_addr | ipv6 %}
address-family ipv6
neighbor {{ neighbor_addr }} activate
{% if bgp_session['rrclient'] != 0 %}
neighbor {{ neighbor_addr }} route-reflector-client
{% endif %}
maximum-paths 64
exit-address-family
{% endif %}

View File

@ -233,6 +233,10 @@ def parse_cpg(cpg, hname):
for router in child.findall(str(QName(ns1, "BGPRouterDeclaration"))):
asn = router.find(str(QName(ns1, "ASN"))).text
hostname = router.find(str(QName(ns1, "Hostname"))).text
if router.find(str(QName(ns1, "RRClient"))):
rrclient = '1'
else:
rrclient = '0'
if hostname == hname:
myasn = int(asn)
peers = router.find(str(QName(ns1, "Peers")))
@ -251,6 +255,7 @@ def parse_cpg(cpg, hname):
bgp_session = bgp_sessions[peer]
if hostname == bgp_session['name']:
bgp_session['asn'] = int(asn)
bgp_session['rrclient'] = int(rrclient)
return bgp_sessions, myasn, bgp_peers_with_range