Skip to content

Commit e07d8ea

Browse files
committed
Merge branch 'ppp-qos' of https://github.com/opswill/vyos-1x into ppp-qos
2 parents 155512c + ee2c19d commit e07d8ea

File tree

2 files changed

+21
-92
lines changed

2 files changed

+21
-92
lines changed
Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,10 @@
1-
#!/usr/bin/env python3
2-
#
3-
# Copyright VyOS maintainers and contributors <[email protected]>
4-
#
5-
# This program is free software; you can redistribute it and/or modify
6-
# it under the terms of the GNU General Public License version 2 or later as
7-
# published by the Free Software Foundation.
8-
#
9-
# This program is distributed in the hope that it will be useful,
10-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
# GNU General Public License for more details.
13-
#
14-
# You should have received a copy of the GNU General Public License
15-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1+
#!/bin/bash
162

17-
# This is a Python hook script which is invoked whenever a SSTP client session
18-
# goes "ip-up". It will call into our vyos.ifconfig library and will then
19-
# execute common tasks for the SSTP interface. The reason we have to "hook" this
20-
# is that we can not create a sstpcX interface in advance in linux and then
21-
# connect pppd to this already existing interface.
3+
interface=$6
4+
if [ -z "$interface" ]; then
5+
exit
6+
fi
227

23-
from sys import argv
24-
from sys import exit
25-
26-
from vyos.configquery import ConfigTreeQuery
27-
from vyos.configdict import get_interface_dict
28-
from vyos.ifconfig import SSTPCIf
29-
30-
# When the ppp link comes up, this script is called with the following
31-
# parameters
32-
# $1 the interface name used by pppd (e.g. ppp3)
33-
# $2 the tty device name
34-
# $3 the tty device speed
35-
# $4 the local IP address for the interface
36-
# $5 the remote IP address
37-
# $6 the parameter specified by the 'ipparam' option to pppd
38-
39-
if (len(argv) < 7):
40-
exit(1)
41-
42-
interface = argv[6]
43-
44-
conf = ConfigTreeQuery()
45-
_, sstpc = get_interface_dict(conf.config, ['interfaces', 'sstpc'], interface)
46-
47-
# Update the config
48-
p = SSTPCIf(interface)
49-
p.update(sstpc)
8+
if [[ "$interface" == sstpc* ]]; then
9+
/etc/ppp/ip-up.d/ppp-hook-scripts/96-vyos-sstpc-callback "$@"
10+
fi
Lines changed: 13 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,17 @@
1-
#!/usr/bin/env python3
2-
#
3-
# Copyright VyOS maintainers and contributors <[email protected]>
4-
#
5-
# This program is free software; you can redistribute it and/or modify
6-
# it under the terms of the GNU General Public License version 2 or later as
7-
# published by the Free Software Foundation.
8-
#
9-
# This program is distributed in the hope that it will be useful,
10-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
# GNU General Public License for more details.
13-
#
14-
# You should have received a copy of the GNU General Public License
15-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1+
#!/bin/bash
162

17-
# This is a Python hook script which is invoked whenever a PPPoE session goes
18-
# "ip-up". It will call into our vyos.ifconfig library and will then execute
19-
# common tasks for the PPPoE interface. The reason we have to "hook" this is
20-
# that we can not create a pppoeX interface in advance in linux and then connect
21-
# pppd to this already existing interface.
3+
interface=$6
4+
WLB_PID_FILE="/run/wlb_daemon.pid"
225

23-
from sys import argv
24-
from sys import exit
6+
if [ -z "$interface" ]; then
7+
exit
8+
fi
259

26-
from vyos.configquery import ConfigTreeQuery
27-
from vyos.configdict import get_interface_dict
28-
from vyos.ifconfig import PPPoEIf
10+
if [[ "$interface" == pppoe* ]]; then
11+
/etc/ppp/ip-up.d/ppp-hook-scripts/99-vyos-pppoe-callback "$@"
12+
/etc/ppp/ip-up.d/ppp-hook-scripts/99-vyos-pppoe-qos "$@"
13+
fi
2914

30-
# When the ppp link comes up, this script is called with the following
31-
# parameters
32-
# $1 the interface name used by pppd (e.g. ppp3)
33-
# $2 the tty device name
34-
# $3 the tty device speed
35-
# $4 the local IP address for the interface
36-
# $5 the remote IP address
37-
# $6 the parameter specified by the 'ipparam' option to pppd
38-
39-
if (len(argv) < 7):
40-
exit(1)
41-
42-
interface = argv[6]
43-
44-
conf = ConfigTreeQuery()
45-
_, pppoe = get_interface_dict(conf.config, ['interfaces', 'pppoe'], interface)
46-
47-
# Update the config
48-
p = PPPoEIf(interface)
49-
p.update(pppoe)
15+
if [ -f "$WLB_PID_FILE" ]; then
16+
/etc/ppp/ip-up.d/ppp-hook-scripts/99-vyos-pppoe-wlb "$@"
17+
fi

0 commit comments

Comments
 (0)