From 3b77f8666f19ca2ed1fc242d05d88706b8261863 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Thu, 27 Feb 2014 13:58:57 +0100 Subject: Introduce a new PPP connection type This should at some point take care of most PPP use cases, but currently is just a frontend to pppoe. The main difference is that the new connection type keeps track of profiles by their 'dynamic' interface name. Hence it is not wise to use both pppoe and ppp profiles. --- src/lib/connections/ppp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/lib/connections/ppp (limited to 'src') diff --git a/src/lib/connections/ppp b/src/lib/connections/ppp new file mode 100644 index 0000000..dfc7805 --- /dev/null +++ b/src/lib/connections/ppp @@ -0,0 +1,28 @@ +. "$SUBR_DIR/connections/pppoe" + +ppp_compatible() { + if [[ ${#BindsToInterfaces[@]} -ne 1 ]]; then + report_error "No unique port for PPP interface '$Interface' specified" + return 1 + fi + if [[ ! $Interface =~ ppp([[:digit:]]+) ]]; then + report_error "Interface '$Interface' is not of the supported form 'ppp'" + return 1 + fi + PPPUnit=${BASH_REMATCH[1]} + echo "$BindsToInterfaces" +} + +ppp_up() { + local interface + interface=$(ppp_compatible) || return 1 + + Interface=$interface pppoe_up +} + +ppp_down() { + local interface + interface=$(ppp_compatible) || return 1 + + Interface=$interface pppoe_down +} -- cgit v1.2.3-24-g4f1b