Package: python-openflow
WARNING: As previously announced on our communication channels, the Kytos
project will enter the “shutdown” phase on May 31, 2021. After this date,
only critical patches (security and core bug fixes) will be accepted, and the
project will be in “critical-only” mode for another six months (until November
30, 2021). For more information visit the FAQ at <https://kytos.io/faq>. We’ll
have eternal gratitude to the entire community of developers and users that made
the project so far.python-openflowis a low level library to parse and create 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, short learning curve and free software license.This library is part ofKytos project, but feel free to
use this simple and intuitive library in other projects.Attention!python-openflowdoes not perform I/O operations. To communicate with a
switch, you must write your own controller using this library or use ourKytos SDN Platform.A quick start follows for you to check whether this project fits your needs.
For a more detailed documentation, please check thepython-openflow API
Reference Manual.Quick StartInstallingIn order to use this software please install python3.6 or greater into your
environment beforehand.We are doing a huge effort to make Kytos and its components available on all
common distros. So, we recommend you to download it from your distro repository.But if you are trying to test, develop or just want a more recent version of our
software no problem: Download now, the latest release (it still a beta
software), from our repository:First you need to clonepython-openflowrepository:$gitclonehttps://github.com/kytos/python-openflow.gitAfter cloning, the installation process is done by standardsetuptoolsinstall
procedure:$cdpython-openflow$sudopython3setup.pyinstallAlternatively, if you are a developer and want to install in develop mode:$cdpython-openflow$pip3install-rrequirements/dev.txtBasic Usage ExampleSee how it is easy to create a feature request message with this library.  You
can use ipython3 to get the advantages of autocompletion:>>>frompyof.v0x01.controller2switch.features_requestimportFeaturesRequest>>>request=FeaturesRequest()>>>print(request.header.message_type)Type.OFPT_FEATURES_REQUESTIf you need to send this message via socket, call thepack()method to get
its binary representation to be sent through the network:>>>binary_msg=request.pack()>>>print(binary_msg)b"\x01\x05\x00\x08\x14\xad'\x8d">>># Use a controller (e.g. Kytos SDN controller) to send "binary_msg"To parse a message, use theunpack()function:>>>frompyof.utilsimportunpack>>>binary_msg=b"\x01\x05\x00\x08\x14\xad'\x8d">>>msg=unpack(binary_msg)>>>print(msg.header.version)UBInt8(1)# OpenFlow 1.0>>>print(msg.header.message_type)Type.OFPT_FEATURES_REQUESTPlease, note that this library do not send or receive messages via socket. You
have to create your own server to receive messages from switches. This library
only helps you to handle OpenFlow messages in a more pythonic way.AuthorsFor a complete list of authors, please openAUTHORS.rstfile.ContributingIf you want to contribute to this project, please readKytos Documentationwebsite.LicenseThis software is underMIT-License. For more information please readLICENSEfile.