Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
 ryu/lib/packet/packet.py      | 23 ++++++++---------------
 ryu/lib/packet/packet_base.py | 13 +++++++------
 ryu/lib/packet/vrrp.py        |  4 ++--
 3 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/ryu/lib/packet/packet.py b/ryu/lib/packet/packet.py
index 9533266..84e5bf8 100644
--- a/ryu/lib/packet/packet.py
+++ b/ryu/lib/packet/packet.py
@@ -21,13 +21,17 @@ class Packet(object):
     """A packet decoder/encoder class.
 
     An instance is used to either decode or encode a single packet.
+
+    *data* is a bytearray to describe a raw datagram to decode.
+    When decoding, a Packet object is iteratable.
+    Iterated values are protocol (ethernet, ipv4, ...) headers and the payload.
+    Protocol headers are instances of subclass of packet_base.PacketBase.
+    The payload is a bytearray.  They are iterated in on-wire order.
+
+    *data* should be omitted when encoding a packet.
     """
 
     def __init__(self, data=None):
-        """*data* is a bytearray to describe a raw datagram to decode.
-        *data* should be omitted when encoding a packet.
-        """
-
         super(Packet, self).__init__()
         self.data = data
         self.protocols = []
@@ -80,8 +84,6 @@ class Packet(object):
         self.protocols.append(proto)
 
     def next(self):
-        """See __iter__."""
-
         try:
             p = self.protocols[self.protocol_idx]
         except:
@@ -92,13 +94,4 @@ class Packet(object):
         return p
 
     def __iter__(self):
-        """Iterate protocol (ethernet, ipv4, ...) headers and the payload.
-
-        This method is legal only when decoding a packet.
-
-        Protocol headers are instances of subclass of packet_base.PacketBase.
-        The payload is a bytearray.
-        They are iterated in on-wire order.
-        """
-
         return self
diff --git a/ryu/lib/packet/packet_base.py b/ryu/lib/packet/packet_base.py
index 8b93215..b0aeca0 100644
--- a/ryu/lib/packet/packet_base.py
+++ b/ryu/lib/packet/packet_base.py
@@ -49,17 +49,18 @@ class PacketBase(object):
         Returns the following two objects.
 
         * An object to describe the decoded header.
-        It should have the following attributes at least.
+          It should have the following attributes at least.
 
-        =========== ============
-        Attribute   Description
-        =========== ============
-        length      The number of the corresponding on-wire octets
-        =========== ============
+          =========== ============
+          Attribute   Description
+          =========== ============
+          length      The number of the corresponding on-wire octets.
+          =========== ============
 
         * A packet_base.PacketBase subclass appropriate for the rest of
           the packet.  None when the rest of the packet should be considered
           as raw payload.
+
         """
         pass
 
diff --git a/ryu/lib/packet/vrrp.py b/ryu/lib/packet/vrrp.py
index 6ce81ce..7c50fed 100644
--- a/ryu/lib/packet/vrrp.py
+++ b/ryu/lib/packet/vrrp.py
@@ -406,7 +406,7 @@ class vrrpv2(vrrp):
     """VRRPv2 (RFC 3768) header encoder/decoder class.
 
     Unlike other ryu.lib.packet.packet_base.PacketBase derived classes,
-    create method should be used to instantiate an object of this class.
+    *create* method should be used to instantiate an object of this class.
     """
 
     _PACK_STR = '!BBBBBBH'
@@ -513,7 +513,7 @@ class vrrpv3(vrrp):
     """VRRPv3 (RFC 5798) header encoder/decoder class.
 
     Unlike other ryu.lib.packet.packet_base.PacketBase derived classes,
-    create method should be used to instantiate an object of this class.
+    *create* method should be used to instantiate an object of this class.
     """
 
     _PACK_STR = '!BBBBHH'
-- 
1.8.0.1


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to