programmatic access to the Linux queuing disciplines
Project description
linuxnet-qos
linuxnet-qos provides programmatic access to the tc(8) command. Using linuxnet-qos one can manipulate the Linux Traffic Control functionality (queuing disciplines).
For the following examples, Python3 (3.6 or later) is required.
Accessing an interface's queuing discipline configuration:
>>> from linuxnet.qos import QDiscConfig
>>> config = QDiscConfig('eth2')
>>> config.dump()
PFifoFastQDisc(0:0) root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
PFifoFastQDisc
is the Python class used to represent the
pfifo_fast
queuing discipline (see tc-pfifo_fast(8)).
The following examples modify the interface's queuing discipline, so
root privileges are required for successful execution of the tc
command.
Replacing the interface's root queuing discipline:
>>> from linuxnet.qos import NetemQDisc, Handle
>>> netem_qdisc = NetemQDisc(Handle(1,1), None, delay=30.0)
>>> config.create_qdisc(netem_qdisc)
>>> config.dump()
NetemQDisc(1:1) root delay 30.0ms
Deleting the existing queuing discipline configuration:
>>> config.delete_config()
>>> config.read_interface_config()
True
>>> config.dump()
PFifoFastQDisc(0:0) root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Installation
Python3 is required.
Available Makefile
targets can be listed by invoking make
with no arguments.
make install
will install the package.
make test
runs the unit tests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file linuxnet-qos-3.3.6.tar.gz
.
File metadata
- Download URL: linuxnet-qos-3.3.6.tar.gz
- Upload date:
- Size: 83.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.9.5 requests/2.27.1 requests-toolbelt/0.10.1 tqdm/4.52.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce71319462f4cc9ff67ae413e073cbced7a735af6a0e560288ca8fbd0dec721a |
|
MD5 | d5c1888922d14e990c5f16079013fb68 |
|
BLAKE2b-256 | 8aa6e0ab34002735be3668320f755979474fdbe5a174ed5087332d963eb9c368 |
File details
Details for the file linuxnet_qos-3.3.6-py3-none-any.whl
.
File metadata
- Download URL: linuxnet_qos-3.3.6-py3-none-any.whl
- Upload date:
- Size: 78.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.9.5 requests/2.27.1 requests-toolbelt/0.10.1 tqdm/4.52.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9062a121bb9ac30baedf6c69f1fa9edb99589a1e2997093115770e2031aefa7 |
|
MD5 | a980b96bc5711156966d503a94b8612d |
|
BLAKE2b-256 | 2cc805b082858b61f9114e05db36090bb63096be5ff90874c125b4b4d92e3e71 |