Skip to content

Commit

Permalink
implement staticroutebfd process
Browse files Browse the repository at this point in the history
  • Loading branch information
qiwang4 committed Feb 10, 2023
1 parent e6fde1d commit 5131fc9
Show file tree
Hide file tree
Showing 7 changed files with 686 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ program:pimd
program:frrcfgd
{%- else %}
program:bgpcfgd
program:staticroutebfd
{%- endif %}
14 changes: 14 additions & 0 deletions dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running

{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
{% else %}
[program:staticroutebfd]
command=/usr/local/bin/staticroutebfd
priority=6
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=bgpd:running
{% endif %}

[program:bgpmon]
command=/usr/local/bin/bgpmon
priority=6
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-bgpcfgd/bgpcfgd/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ def log_err(msg):

def log_crit(msg):
""" Send a message msg to the syslog as CRIT """
syslog.syslog(syslog.LOG_CRIT, msg)
syslog.syslog(syslog.LOG_CRIT, msg)
5 changes: 5 additions & 0 deletions src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ def set_handler(self, key, data):
intf_list = arg_list(data['ifname']) if 'ifname' in data else None
dist_list = arg_list(data['distance']) if 'distance' in data else None
nh_vrf_list = arg_list(data['nexthop-vrf']) if 'nexthop-vrf' in data else None
bfd_enable = arg_list(data['bfd']) if 'bfd' in data else None
route_tag = self.ROUTE_ADVERTISE_DISABLE_TAG if 'advertise' in data and data['advertise'] == "false" else self.ROUTE_ADVERTISE_ENABLE_TAG

# bfd enabled route would be handled in staticroutebfd, skip here
if bfd_enable and bfd_enable[0].lower() == "true":
return True

try:
ip_nh_set = IpNextHopSet(is_ipv6, bkh_list, nh_list, intf_list, dist_list, nh_vrf_list)
cur_nh_set, cur_route_tag = self.static_routes.get(vrf, {}).get(ip_prefix, (IpNextHopSet(is_ipv6), route_tag))
Expand Down
1 change: 1 addition & 0 deletions src/sonic-bgpcfgd/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
entry_points = {
'console_scripts': [
'bgpcfgd = bgpcfgd.main:main',
'staticroutebfd = staticroutebfd.main:main',
'bgpmon = bgpmon.bgpmon:main',
]
},
Expand Down
Empty file.
Loading

0 comments on commit 5131fc9

Please sign in to comment.