Library to parse and generate OpenFlow messages
Project description
python-openflow is a low level library to parse OpenFlow messages. If you want to read an OpenFlow packet from an open socket or send a message to an OpenFlow switch, this is your best friend. The main features are: high performance, latest specification compliance, short learning curve and free software license.
This library is part of Kytos project. python-openflow was developed to be used with Kytos controller, but feel free to use this simple and intuitive library in other projects.
Overview
This is just an overview for you to check whether this project fit your needs. For a more detailed documentation, please check the python-openflow API Reference Manual.
Usage
See how easy is the creation of a features request message with this library. You can use ipython3 to get the advantages of autocompletion:
>>> from pyof.v0x01.controller2switch.features_request import FeaturesRequest
>>> request = FeaturesRequest()
>>> print(request.header.message_type)
Type.OFPT_FEATURES_REQUEST
If you need to send this message via socket, call the pack() method to get its binary representation that should be used to be sent throught the network:
>>> binary_msg = request.pack()
Installation
You can install this package with pip package installer or from source code.
Installing from PyPI
python-openflow is in PyPI, so you can easily install it via pip3 (pip for Python 3) and also include this project in your requirements.txt
If you do not have pip3 you can install it on Ubuntu-base machines by running:
$ sudo apt update
$ sudo apt install python3-pip
Once you have pip3, execute:
$ sudo pip3 install python-openflow
Installing source code
First you need to clone python-openflow repository:
$ git clone https://github.com/kytos/python-openflow.git
After cloning, the installation process is done by setuptools in the usual way:
$ cd python-openflow
$ sudo python3 setup.py install
Checking installation
That’s it! To check wether it is installed successfully, please try to import after running python3 or ipython3:
>>> import pyof
>>> # no errors should be displayed
Support
We are available in IRC (#kytos (at) freenode.net)and there is also a development mailing list. Details can be found in the full documentation.
Contributing
Contributions are welcome either by creating issues in GitHub or in the form of pull requests. Before, please, read the contribution and hacking guides in the main documentation.
License
This software is under MIT-License. For more information please read the LICENSE file.
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
Hashes for python-openflow-1.1.0b1.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a10601cc401ceae3efe2f7eb8befb1cbef2f5cee8dd9b7d0d839c82babbb2ce |
|
MD5 | 5fd22c1cda8df676e9d71d149f55f7ee |
|
BLAKE2b-256 | b4cbf9f50d865b2c9b0496e483a860bf8aab99c323978859508eac51eaf716df |