File: ofproto_base.rst

package info (click to toggle)
ryu 4.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,784 kB
  • ctags: 19,167
  • sloc: python: 94,448; erlang: 14,517; ansic: 594; sh: 418; makefile: 152
file content (49 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
**************************************************
OpenFlow version independent classes and functions
**************************************************

.. py:currentmodule:: ryu.ofproto.ofproto_parser

Base class for OpenFlow messages
--------------------------------

..    XXX
..    the descrption of _TYPE is inlined from ryu/lib/stringify.py.
..    this is a work around for a sphinx bug.
..    https://bitbucket.org/birkenfeld/sphinx/issue/741/autodoc-inherited-members-wont-work-for

.. autoclass:: MsgBase
   :members: to_jsondict, from_jsondict

   .. attribute::
    _TYPE

    _TYPE class attribute is used to annotate types of attributes.

    This type information is used to find an appropriate conversion for
    a JSON style dictionary.

    Currently the following types are implemented.

    ===== ==========
    Type  Descrption
    ===== ==========
    ascii US-ASCII
    utf-8 UTF-8
    ===== ==========

    Example::

        _TYPE = {
            'ascii': [
                'hw_addr',
            ],
            'utf-8': [
                'name',
            ]
        }

Functions
---------

.. autofunction:: ofp_msg_from_jsondict