On 13/04/13 21:09, Jouke Witteveen wrote:
On Thu, Apr 11, 2013 at 4:03 PM, Robbie Smith <[email protected]> wrote:
I’ve updated the documentation for the pppoe and mobile_ppp connections in
the netctl.profile(5) manpage. How should I submit it, a patch to this list
or a pull-request to the git repo on projects.archlinux.org?

A pull-request is a bit hard to review (and thats one thing this list
is for). Therefore I prefer patches to the list (git format-patch
style for ease of applying).

The changes to the documentation look good, although there are some
indentation issues. In the documentation all lines should be within 72
characters and indentation is 4 spaces deep.

I'm looking forward to your patches,
- Jouke

Here’s the patch for the documentation.

- Robbie
diff --git .gitignore .gitignore
new file mode 100644
index 0000000..372ef9a
--- /dev/null
+++ .gitignore
@@ -0,0 +1,5 @@
+*.patch
+*.tar
+*.xz
+*.sig
+/PKGBUILD
diff --git Makefile Makefile
index b1bc626..33c10e4 100644
--- Makefile
+++ Makefile
@@ -1,4 +1,4 @@
-export VERSION = 0.8
+export VERSION = 0.7
 
 .PHONY: install install-docs docs tarball pkgbuild clean
 
diff --git NEWS NEWS
index f4d0690..1011e03 100644
--- NEWS
+++ NEWS
@@ -1,7 +1,3 @@
-netctl 0.8
-- Fix escaping of unfortunate strings
-- Add support for configuration defaults to connection scripts
-
 netctl 0.7
 - Add support for systemd character escaping
 - Assorted fixes, including to vlan connections and the documentation
diff --git docs/examples/mobile_ppp docs/examples/mobile_ppp
index 4e5079f..f3b0b8a 100644
--- docs/examples/mobile_ppp
+++ docs/examples/mobile_ppp
@@ -1,7 +1,6 @@
 Description='Example PPP mobile connection'
 Interface=ttyUSB0
 Connection=mobile_ppp
-IdleTimeout=30
 
 # Debug pppd / chat output (separately from netctl)
 #PPPDebug=true
@@ -11,12 +10,6 @@ IdleTimeout=30
 # Use DNS provided by the peer (default: true)
 #UsePeerDNS=true
 
-# Always keep a connection established
-ConnectionMode='persist'
-# Establish connection on demand
-#ConnectionMode='demand'
-#IdleTimeout=300
-
 # The user and password are not always required
 #User='[email protected]'
 #Password='very secret'
diff --git docs/netctl.profile.5.txt docs/netctl.profile.5.txt
index 9841a82..4be5837 100644
--- docs/netctl.profile.5.txt
+++ docs/netctl.profile.5.txt
@@ -42,6 +42,8 @@ AVAILABLE CONNECTION TYPES
     available.
 +pppoe+::
     For PPPoE connections.
++mobile_ppp+::
+    For mobile broadband ppp connections that use a USB modem.
 +tunnel+::
     For tunnel interfaces.
 +tuntap+::
@@ -281,6 +283,81 @@ connections of the `bridge' type:
     Maximum age parameter. See *brctl*(8) for details.
 
 
+OPTIONS FOR `mobile_ppp' CONNECTIONS
+------------------------------------
+The name of the USB serial device is specified in 'Interface'. The
+following options are understood for connections of the `mobile_ppp'
+type:
+
+'DefaultRoute='::
+    Use the default route provided by the peer (defaults to
+    `true')
+
+'UsePeerDNS='::
+    Use the DNS provided by the peer (defaults to `true')
+
+'User=' and 'Password='::
+    The username and password to connect with. These are unset by
+    default, as they are often not required.
+
+'AccessPointName='::
+    The access point (apn) to connect on. This is specific to your
+    ISP.
+
+'Pin='::
+    If your modem requires a PIN to unlock, use this option.
+
+'Mode='::
+    This option is used to specify the connection mode. Can be one of
+    `3Gpref', `3Gonly', `GPRSpref', `GPRSonly', `None'. This generates
+    AT commands specific to certain Huawei modems; all other devices
+    should use `None'.
+
+
+OPTIONS FOR `pppoe' CONNECTIONS
+------------------------------
+The interface to dial peer-to-peer over ethernet is specified in
+'Interface'. The following options are understood for connections of
+the `pppoe' type:
+
+'User=' and 'Password='::
+    The username and password to connect with. 
+
+'ConnectionMode='::
+    This option specifies how a connection should be established, and
+    may take either `persist' or `demand' as its argument.
+
+'IdleTimeout='::
+    This option specifies the idle time (in seconds) after which `pppd'
+    should disconnect. This option is only valid if 'ConnectionMode' is
+    set to `demand'.
+
+'DefaultRoute='::
+    Use the default route provided by the peer (defaults to
+    `true')
+
+'UsePeerDNS='::
+    Use the DNS provided by the peer (defaults to `true')
+
+'LCPEchoInterval=' and 'LCPEchoFailure='::
+    These options override default LCP parameters from
+    `/etc/ppp/options'.
+
+The following advanced options are also understood:
+
+'PPPoEService='::
+    This option specifies the PPPoE service name. 
+'PPPoEAC='::
+    This option specifies the PPPoE access concentrator name. 
+'PPPoESession='::
+    This option specifies an existing session to attach to, and is of
+    the form `sessid:macaddr'.
+'PPPoEMAC='::
+    Only connect to specified MAC address
+'PPPoEIP6='::
+    Enable IPv6 support
+
+
 OPTIONS FOR `tunnel' CONNECTIONS
 ----------------------------------
 The name of the tunnel interface is specified in 'Interface'. Next to
diff --git src/lib/connections/ppp src/lib/connections/ppp
new file mode 100644
index 0000000..ddd1664
--- /dev/null
+++ src/lib/connections/ppp
@@ -0,0 +1,37 @@
+. "$SUBR_DIR/network"
+
+: ${PPPD:=pppd}
+
+_quotestring() {
+    echo "\"${1/\"/\\\"}\""
+}
+
+ppp_up() {
+    load_profile "$Profile"
+    [[ -z "$Peer" ]] && Peer="provider"
+    [[ -z "$PPPTimeout" ]] && PPPTimeout=30
+
+    ip link set dev "${Interface}" up
+    $PPPD call "$Peer" updetach child-timeout "$PPPTimeout" linkname "$Peer"
+
+    if [[ $? -ne 0 ]]; then
+        rmdir "$STATE_DIR/pppoe.${Interface}.${Profile}/"
+        report_error "Couldn't make pppd connection."
+        return 1
+    fi
+}
+
+ppp_down() {
+    load_profile "$Profile"
+    PIDFILE="/var/run/ppp-$(basename $Peer).pid"
+
+    if [[ -e $PIDFILE ]]; then
+        PID=$(head -1 $PIDFILE)
+        [[ -n "$PID" ]] && kill "$PID"
+    fi
+}
+
+ppp_$1 "$2"
+exit $?
+
+# vim: ft=sh ts=4 et sw=4:

Reply via email to