summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMinoru TAKAHASHI <takahashi.minoru7@gmail.com>2015-09-17 13:05:00 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-09-18 08:27:42 +0900
commit7872ba275c6fdb5aa091ed0497d8bdecf56cd70b (patch)
tree03b651b3a30c5672cd200174ad2c6267f82d97d9
parent2079d06d6f5e7551bcee0c400606dda2006a12d8 (diff)
doc/ofproto_v1_2_ref: Add description for Port Structures
Signed-off-by: Minoru TAKAHASHI <takahashi.minoru7@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--doc/source/ofproto_v1_2_ref.rst5
-rw-r--r--ryu/ofproto/ofproto_v1_2_parser.py30
2 files changed, 35 insertions, 0 deletions
diff --git a/doc/source/ofproto_v1_2_ref.rst b/doc/source/ofproto_v1_2_ref.rst
index 95036471..525cdcc9 100644
--- a/doc/source/ofproto_v1_2_ref.rst
+++ b/doc/source/ofproto_v1_2_ref.rst
@@ -312,6 +312,11 @@ Experimenter
.. literalinclude:: ../../ryu/tests/unit/ofproto/json/of12/3-16-ofp_experimenter.packet.json
+Port Structures
+===============
+
+.. autoclass:: OFPPort
+
Flow Match Structure
====================
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py
index ef43b129..cdf7651d 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -312,6 +312,36 @@ class OFPExperimenter(MsgBase):
class OFPPort(ofproto_parser.namedtuple('OFPPort', (
'port_no', 'hw_addr', 'name', 'config', 'state', 'curr',
'advertised', 'supported', 'peer', 'curr_speed', 'max_speed'))):
+ """
+ Description of a port
+
+ ========== =========================================================
+ Attribute Description
+ ========== =========================================================
+ port_no Port number and it uniquely identifies a port within
+ a switch.
+ hw_addr MAC address for the port.
+ name Null-terminated string containing a human-readable name
+ for the interface.
+ config Bitmap of port configration flags.
+
+ | OFPPC_PORT_DOWN
+ | OFPPC_NO_RECV
+ | OFPPC_NO_FWD
+ | OFPPC_NO_PACKET_IN
+ state Bitmap of port state flags.
+
+ | OFPPS_LINK_DOWN
+ | OFPPS_BLOCKED
+ | OFPPS_LIVE
+ curr Current features.
+ advertised Features being advertised by the port.
+ supported Features supported by the port.
+ peer Features advertised by peer.
+ curr_speed Current port bitrate in kbps.
+ max_speed Max port bitrate in kbps.
+ ========== =========================================================
+ """
_TYPE = {
'ascii': [