summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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': [