summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEshenko Dmitriy <dmitriy.eshenko@vyos.io>2021-06-01 21:53:38 +0300
committerGitHub <noreply@github.com>2021-06-01 20:53:38 +0200
commit49d74ad62065f921e6c732696015ebc751934b2b (patch)
tree51c97d69c108108b99b19c84d76cb064c9cfbf28
parent9566393f95fb11616ec1bae2530256d7bf7e47d1 (diff)
downloadvyos-1x-49d74ad62065f921e6c732696015ebc751934b2b.tar.gz
vyos-1x-49d74ad62065f921e6c732696015ebc751934b2b.zip
pppoe-server: T3593: Add extended-scripts feature
-rw-r--r--data/templates/accel-ppp/pppoe.config.tmpl14
-rw-r--r--interface-definitions/service_pppoe-server.xml.in39
2 files changed, 53 insertions, 0 deletions
diff --git a/data/templates/accel-ppp/pppoe.config.tmpl b/data/templates/accel-ppp/pppoe.config.tmpl
index f444af85c..f241f034a 100644
--- a/data/templates/accel-ppp/pppoe.config.tmpl
+++ b/data/templates/accel-ppp/pppoe.config.tmpl
@@ -17,6 +17,10 @@ net-snmp
{% if limits is defined %}
connlimit
{% endif %}
+{% if extended_scripts is defined %}
+sigchld
+pppd_compat
+{% endif %}
[core]
thread-count={{ thread_count }}
@@ -153,5 +157,15 @@ called-sid={{ authentication.radius.called_sid_format }}
{# Common RADIUS shaper configuration #}
{% include 'accel-ppp/config_shaper_radius.j2' %}
+{% if extended_scripts is defined %}
+[pppd-compat]
+verbose=1
+radattr-prefix=/run/accel-pppd/radattr
+{% set script_name = {'on_up': 'ip-up', 'on_down': 'ip-down', 'on_change':'ip-change', 'on_pre_up':'ip-pre-up'} %}
+{% for script in extended_scripts %}
+{{ script_name[script] }}={{ extended_scripts[script] }}
+{% endfor %}
+{% endif %}
+
[cli]
tcp=127.0.0.1:2001
diff --git a/interface-definitions/service_pppoe-server.xml.in b/interface-definitions/service_pppoe-server.xml.in
index dc8af67af..9d0f887a9 100644
--- a/interface-definitions/service_pppoe-server.xml.in
+++ b/interface-definitions/service_pppoe-server.xml.in
@@ -334,6 +334,45 @@
</leafNode>
</children>
</node>
+ <node name="extended-scripts">
+ <properties>
+ <help>Extended script execution</help>
+ </properties>
+ <children>
+ <leafNode name="on-pre-up">
+ <properties>
+ <help>Script to run before PPPoE session interface comes up</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="on-up">
+ <properties>
+ <help>Script to run when PPPoE session interface is completely configured and started</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="on-down">
+ <properties>
+ <help>Script to run when PPPoE session interface going to terminate</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="on-change">
+ <properties>
+ <help>Script to run when PPPoE session interface changed by RADIUS CoA handling</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
</children>
</node>
</children>