summaryrefslogtreecommitdiffhomepage
path: root/doc/source
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>2013-09-17 12:34:32 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2013-09-20 09:40:53 +0900
commit32977c125e7e37473174abab1f277a00ef025ec4 (patch)
tree76c7ddc0e4ffbdc08091fccc42f0ff073f00a434 /doc/source
parent71ea304be62144813aedf4ac4577e34b7b955d8c (diff)
document MsgBase
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/ofproto_base.rst49
-rw-r--r--doc/source/ofproto_ref.rst1
2 files changed, 50 insertions, 0 deletions
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