### Description
Openflow requires port ranges to be defined as bitwise matches. This module
provides an easy way to the port/mask ranges for a specified port range.
As described in the [ovs-ofctl](http://www.openvswitch.org/support/dist-docs-2.5/ovs-ofctl.8.txt) documentation:
> Bitwise match on TCP (or UDP or SCTP) source or destination
> port. The port and mask are 16-bit numbers written in decimal
> or in hexadecimal prefixed by 0x. Each 1-bit in mask requires
> that the corresponding bit in port must match. Each 0-bit in
> mask causes the corresponding bit to be ignored.
It is recommended to only use this for large ranges that would require a large number of flows.
### Installation
`pip install ovsportranges`
### Basic Usage
``` python
from ovsportrange import OvsPorts
if __name__ == "__main__":
ovsports = OvsPorts()
ranges = ovsports.get_port_ranges(1000, 1999)
for r in ranges:
print("Port: {}, Bitmask: {}".format(r.port, r.bitmask))
```
### Output
```text
Port: 1000, Bitmask: 65528
Port: 1008, Bitmask: 65520
Port: 1024, Bitmask: 65024
Port: 1536, Bitmask: 65280
Port: 1792, Bitmask: 65408
Port: 1920, Bitmask: 65472
Port: 1984, Bitmask: 65520
```
Metadata
Release files for ovsportranges 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ovsportranges-0.1.2.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ovsportranges-0.1.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 10.0 kB
Release files / ovsportranges-0.1.2.tar.gz
| Download URL | ovsportranges-0.1.2.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe0db6869c14cc754d894f5f1effd52f7ad197ad0ea92274f7ce847f2c771272
|
|
BLAKE2b-256 checksum How to use checksums |
f643528060119d194de7e11143551d10fc99ba858edf6d7fee93c2b9dcb2d13c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Release files / ovsportranges-0.1.2-py2.py3-none-any.whl
| Download URL | ovsportranges-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4b2bfedf63b20200adf18f59ddd9b24bb0a2f54ecda21e47cea5d0e523506b58
|
|
BLAKE2b-256 checksum How to use checksums |
1f3b1c1c7e7b57ea1e6560100d557aaedf68f332e52586b81e882564dc2b78c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
|
Security for ovsportranges 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.