diff options
author | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-07-27 11:28:20 +0000 |
---|---|---|
committer | DmitriyEshenko <dmitriy.eshenko@vyos.io> | 2020-07-27 11:28:20 +0000 |
commit | 88d6c303286c6ed8d924e00e588226aad4a5cd57 (patch) | |
tree | c35ba96776261e57958fe267a1fea2bbdb67f121 /src/conf_mode/accel_pppoe.py | |
parent | 5660b07a0b95b685ba46c308a3d1fd0774cfdbfb (diff) | |
download | vyos-1x-88d6c303286c6ed8d924e00e588226aad4a5cd57.tar.gz vyos-1x-88d6c303286c6ed8d924e00e588226aad4a5cd57.zip |
pppoe-server: T1956: support PADO-delay
Diffstat (limited to 'src/conf_mode/accel_pppoe.py')
-rwxr-xr-x | src/conf_mode/accel_pppoe.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/conf_mode/accel_pppoe.py b/src/conf_mode/accel_pppoe.py index c8b570a87..1df873171 100755 --- a/src/conf_mode/accel_pppoe.py +++ b/src/conf_mode/accel_pppoe.py @@ -239,7 +239,9 @@ interface={{int}} {% if svc_name %} service-name={{svc_name}} {% endif %} -pado-delay=0 +{% if pado_delay %} +pado-delay={{pado_delay}} +{% endif %} # maybe: called-sid, tr101, padi-limit etc. {% if limits %} @@ -339,7 +341,8 @@ def get_config(): 'mtu' : '1492', 'ppp_options' : {}, 'limits' : {}, - 'snmp' : 'disable' + 'snmp' : 'disable', + 'pado_delay' : '' } c.set_level('service pppoe-server') @@ -522,6 +525,21 @@ def get_config(): if len(ppp_options) !=0: config_data['ppp_options'] = ppp_options + if c.exists('pado-delay'): + config_data['pado_delay'] = '0' + a = {} + for id in c.list_nodes('pado-delay'): + if not c.return_value('pado-delay {0} sessions'.format(id)): + a[id] = 0 + else: + a[id] = c.return_value('pado-delay {0} sessions'.format(id)) + + for k in sorted(a.keys()): + if k != sorted(a.keys())[-1]: + config_data['pado_delay'] += ",{0}:{1}".format(k,a[k]) + else: + config_data['pado_delay'] += ",{0}:{1}".format('-1',a[k]) + return config_data def verify(c): |