-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
134 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,6 @@ ENV/ | |
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# setuptools-scm versioning | ||
_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# python-pppd | ||
|
||
Simple library for controlling PPP connections with pppd. | ||
|
||
Under the hood it uses the `subprocess` module to interact with `pppd` to create and disconnect PPP | ||
connections. | ||
|
||
|
||
## Installation | ||
|
||
Make sure `pppd` is installed on your system, typically on Ubuntu/Debian: | ||
|
||
$ apt-get install pppd | ||
|
||
|
||
And on Fedora/CentOS/RedHat: | ||
|
||
$ dnf install pppd | ||
|
||
|
||
Then you can install the latest release from PyPi: | ||
|
||
$ pip install python-pppd | ||
|
||
|
||
Alternatively, clone and install the latest development version from GitHub: | ||
|
||
$ git clone https://github.com/cour4g3/python-pppd | ||
$ cd python-pppd | ||
$ pip install -e . | ||
|
||
|
||
## Getting Started | ||
|
||
You can connect to an existing configured PPP connection: | ||
|
||
.. code:: python | ||
|
||
>>> from pppd import PPPConnection | ||
>>> ppp = PPPConnection(call='work') # blocks until connected | ||
>>> ppp.connected() # check if connected, raises error if connection error | ||
True | ||
>>> ppp.laddr # address of local host | ||
'10.0.0.1' | ||
>>> ppp.raddr # address of remote client | ||
'10.0.0.2' | ||
|
||
|
||
You can specify any positional or keyword arguments: | ||
|
||
.. code:: python | ||
|
||
PPPConnection('/dev/ttyS0', connect='/usr/bin/chat -v -f /etc/chatscripts/A1') | ||
|
||
|
||
Which is equivalent to the following: | ||
|
||
$ sudo pppd /dev/ttyS0 connect "/usr/bin/chat -v -f /etc/chatscripts/A1" | ||
|
||
|
||
Normally you require `sudo` to use `pppd`, if you don't have it and have setup | ||
the `pppd` binary with setuid-root or are running as root you can use: | ||
|
||
.. code:: python | ||
|
||
PPPConnection(sudo=False) | ||
|
||
|
||
You can also specify an alternate paths to `pppd` or `sudo` if the libary cannot | ||
find them: | ||
|
||
.. code:: python | ||
|
||
PPPConnection(sudo_path='/usr/local/bin/sudo', pppd_path='/usr/local/sbin/pppd') | ||
|
||
|
||
License | ||
======= | ||
|
||
Licensed under the MIT license. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[project] | ||
name = "python-pppd" | ||
description = "Simple library for controlling PPP connections with pppd." | ||
readme = "README.md" | ||
license = { text = "MIT" } | ||
authors = [{name = "Michael de Villiers", email = "michael@devilears.co.za"},] | ||
maintainers = [{name = "Michael de Villiers", email = "michael@devilears.co.za"},] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: POSIX", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: System :: Networking", | ||
] | ||
dynamic = ["version"] | ||
requires-python = ">= 3.6" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/COUR4G3/python-pppd/" | ||
"Source Code" = "https://github.com/COUR4G3/python-pppd/" | ||
"Issue Tracker" = "https://github.com/COUR4G3/python-pppd/issues/" | ||
|
||
[build-system] | ||
requires = [ | ||
"setuptools>=64.0", | ||
"setuptools_scm[toml]>=6.2", | ||
"wheel", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.bandit] | ||
exclude_dirs = [".github"] | ||
skips = ["B101"] | ||
|
||
[tool.setuptools] | ||
py-modules = ["pppd"] | ||
|
||
[tool.setuptools_scm] | ||
write_to = "_version.py" |