From 32977c125e7e37473174abab1f277a00ef025ec4 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 17 Sep 2013 12:34:32 +0900 Subject: [PATCH] document MsgBase Signed-off-by: YAMAMOTO Takashi Signed-off-by: FUJITA Tomonori --- doc/source/ofproto_base.rst | 49 +++++++++++++++++++++++++++++++++++++ doc/source/ofproto_ref.rst | 1 + 2 files changed, 50 insertions(+) create mode 100644 doc/source/ofproto_base.rst diff --git a/doc/source/ofproto_base.rst b/doc/source/ofproto_base.rst new file mode 100644 index 00000000..0a12dea2 --- /dev/null +++ b/doc/source/ofproto_base.rst @@ -0,0 +1,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 diff --git a/doc/source/ofproto_ref.rst b/doc/source/ofproto_ref.rst index 216db35b..bcec5d6c 100644 --- a/doc/source/ofproto_ref.rst +++ b/doc/source/ofproto_ref.rst @@ -5,5 +5,6 @@ OpenFlow protocol API Reference .. toctree:: :maxdepth: 3 + ofproto_base.rst ofproto_v1_2_ref.rst ofproto_v1_3_ref.rst