Signed-off-by: Shinpei Muraoka <shinpei.mura...@gmail.com>
---
 doc/source/library_packet_ref.rst | 15 ++++++++++++++-
 ryu/lib/packet/mpls.py            |  2 ++
 ryu/lib/packet/vxlan.py           | 35 +++++++++--------------------------
 3 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/doc/source/library_packet_ref.rst 
b/doc/source/library_packet_ref.rst
index 87f44a1..29c68a2 100644
--- a/doc/source/library_packet_ref.rst
+++ b/doc/source/library_packet_ref.rst
@@ -26,6 +26,9 @@ Protocol Header classes
 .. automodule:: ryu.lib.packet.ethernet
    :members:
 
+.. autoclass:: ryu.lib.packet.lldp.lldp
+   :members:
+
 .. automodule:: ryu.lib.packet.vlan
    :members:
 
@@ -50,6 +53,9 @@ Protocol Header classes
 .. automodule:: ryu.lib.packet.icmpv6
    :members:
 
+.. automodule:: ryu.lib.packet.vxlan
+   :members:
+
 .. automodule:: ryu.lib.packet.gre
    :members:
 
@@ -118,7 +124,8 @@ Protocol Header classes
    :members:
 .. autoclass:: ryu.lib.packet.bgp.BGPNotification
    :members:
-.. automodule:: ryu.lib.packet.sctp
+
+.. automodule:: ryu.lib.packet.bmp
    :members:
 
 .. autoclass:: ryu.lib.packet.bfd.bfd
@@ -133,3 +140,9 @@ Protocol Header classes
    :members:
 .. autoclass:: ryu.lib.packet.bfd.MeticulousKeyedSHA1
    :members:
+
+.. autoclass:: ryu.lib.packet.ospf.OSPFMessage
+   :members:
+
+.. automodule:: ryu.lib.packet.sctp
+   :members:
diff --git a/ryu/lib/packet/mpls.py b/ryu/lib/packet/mpls.py
index bba2861..b158884 100644
--- a/ryu/lib/packet/mpls.py
+++ b/ryu/lib/packet/mpls.py
@@ -73,6 +73,7 @@ class mpls(packet_base.PacketBase):
 def label_from_bin(buf):
     """
     Converts binary representation label to integer.
+
     :param buf: Binary representation of label.
     :return: MPLS Label and BoS bit.
     """
@@ -84,6 +85,7 @@ def label_from_bin(buf):
 def label_to_bin(mpls_label, is_bos=True):
     """
     Converts integer label to binary representation.
+
     :param mpls_label: MPLS Label.
     :param is_bos: BoS bit.
     :return: Binary representation of label.
diff --git a/ryu/lib/packet/vxlan.py b/ryu/lib/packet/vxlan.py
index c7de04b..5a6e013 100644
--- a/ryu/lib/packet/vxlan.py
+++ b/ryu/lib/packet/vxlan.py
@@ -13,32 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-"""
-VXLAN packet parser/serializer
-
-RFC 7348
-VXLAN Header:
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|R|R|R|R|I|R|R|R|            Reserved                           |
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|                VXLAN Network Identifier (VNI) |   Reserved    |
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-- Flags (8 bits): where the I flag MUST be set to 1 for a valid
-  VXLAN Network ID (VNI).  The other 7 bits (designated "R") are
-  reserved fields and MUST be set to zero on transmission and
-  ignored on receipt.
-
-- VXLAN Segment ID/VXLAN Network Identifier (VNI): this is a
-  24-bit value used to designate the individual VXLAN overlay
-  network on which the communicating VMs are situated.  VMs in
-  different VXLAN overlay networks cannot communicate with each
-  other.
-
-- Reserved fields (24 bits and 8 bits): MUST be set to zero on
-  transmission and ignored on receipt.
-"""
-
 import struct
 import logging
 
@@ -72,6 +46,13 @@ class vxlan(packet_base.PacketBase):
     _PACK_STR = '!II'
     _MIN_LEN = struct.calcsize(_PACK_STR)
 
+    # VXLAN Header:
+    # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    # |R|R|R|R|I|R|R|R|            Reserved                           |
+    # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    # |                VXLAN Network Identifier (VNI) |   Reserved    |
+    # +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+
     def __init__(self, vni):
         super(vxlan, self).__init__()
         self.vni = vni
@@ -95,6 +76,7 @@ class vxlan(packet_base.PacketBase):
 def vni_from_bin(buf):
     """
     Converts binary representation VNI to integer.
+
     :param buf: binary representation of VNI.
     :return: VNI integer.
     """
@@ -104,6 +86,7 @@ def vni_from_bin(buf):
 def vni_to_bin(vni):
     """
     Converts integer VNI to binary representation.
+
     :param vni: integer of VNI
     :return: binary representation of VNI.
     """
-- 
2.7.4


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to