File: usage.rst

package info (click to toggle)
python-openflow 1.1.0~alpha2-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 692 kB
  • ctags: 1,027
  • sloc: python: 2,713; makefile: 207; sh: 8
file content (26 lines) | stat: -rw-r--r-- 723 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Usage
=====

The main goal of this library is to provide a very simple and intuitive syntax
to parse OpenFlow packets. As we support multiple OpenFlow versions, you need to
be specific on which version to import.

Parsing a message
-----------------

Creating a message
------------------
For example, let's create a feature request message. Tip: you can use ipython3
for autocompletion:

.. The code in this section is replicated in README.rst.

>>> from pyof.v0x01.controller2switch.features_request import FeaturesRequest
>>> request = FeaturesRequest(xid = 100)
>>> print(request.header.message_type)
Type.OFPT_FEATURES_REQUEST
>>> print(request.header.xid)
100

A simple controller example
---------------------------