Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/lib/packet/arp.py | 18 ++++++++++--------
ryu/lib/packet/ethernet.py | 15 ++++++++-------
ryu/lib/packet/ipv4.py | 27 +++++++++++++++------------
ryu/lib/packet/ipv6.py | 18 ++++++++++--------
4 files changed, 43 insertions(+), 35 deletions(-)
diff --git a/ryu/lib/packet/arp.py b/ryu/lib/packet/arp.py
index 2edb028..191ce9a 100644
--- a/ryu/lib/packet/arp.py
+++ b/ryu/lib/packet/arp.py
@@ -33,21 +33,23 @@ class arp(packet_base.PacketBase):
An instance has the following attributes at least.
Most of them are same to the on-wire counterparts but in host byte order.
+ IPv4 addresses are represented as a string like '192.0.2.1'.
+ MAC addresses are represented as a string like '08:60:6e:7f:74:e7'.
__init__ takes the correspondig args in this order.
- ============== ====================
- Attribute Description
- ============== ====================
+ ============== ==================== =====================
+ Attribute Description Example
+ ============== ==================== =====================
hwtype ar$hrd
proto ar$pro
hlen ar$hln
plen ar$pln
opcode ar$op
- src_mac ar$sha
- src_ip ar$spa
- dst_mac ar$tha
- dst_ip ar$tpa
- ============== ====================
+ src_mac ar$sha '08:60:6e:7f:74:e7'
+ src_ip ar$spa '192.0.2.1'
+ dst_mac ar$tha '00:00:00:00:00:00'
+ dst_ip ar$tpa '192.0.2.2'
+ ============== ==================== =====================
"""
_PACK_STR = '!HHBBH6s4s6s4s'
diff --git a/ryu/lib/packet/ethernet.py b/ryu/lib/packet/ethernet.py
index 0ca77d8..2b8c932 100644
--- a/ryu/lib/packet/ethernet.py
+++ b/ryu/lib/packet/ethernet.py
@@ -25,15 +25,16 @@ class ethernet(packet_base.PacketBase):
"""Ethernet header encoder/decoder class.
An instance has the following attributes at least.
+ MAC addresses are represented as a string like '08:60:6e:7f:74:e7'.
__init__ takes the correspondig args in this order.
- =========== ====================
- Attribute Description
- =========== ====================
- dst destination address
- src source address
- ethertype ether type
- =========== ====================
+ ============== ==================== =====================
+ Attribute Description Example
+ ============== ==================== =====================
+ dst destination address 'ff:ff:ff:ff:ff:ff'
+ src source address '08:60:6e:7f:74:e7'
+ ethertype ether type 0x0800
+ ============== ==================== =====================
"""
_PACK_STR = '!6s6sH'
diff --git a/ryu/lib/packet/ipv4.py b/ryu/lib/packet/ipv4.py
index d80c849..8a07c81 100644
--- a/ryu/lib/packet/ipv4.py
+++ b/ryu/lib/packet/ipv4.py
@@ -38,28 +38,31 @@ class ipv4(packet_base.PacketBase):
An instance has the following attributes at least.
Most of them are same to the on-wire counterparts but in host byte order.
+ IPv4 addresses are represented as a string like '192.0.2.1'.
__init__ takes the correspondig args in this order.
- ============== ====================
- Attribute Description
- ============== ====================
+ ============== ======================================== ==================
+ Attribute Description Example
+ ============== ======================================== ==================
version Version
header_length IHL
tos Type of Service
- total_length Total Length \
- (0 means automatically-calculate when encoding)
+ total_length Total Length
+ (0 means automatically-calculate
+ when encoding)
identification Identification
flags Flags
offset Fragment Offset
ttl Time to Live
proto Protocol
- csum Header Checksum \
- (Ignored and automatically-calculated when encoding)
- src Source Address
- dst Destination Address
- option A bytearray which contains the entire Options, or None for \
- no Options
- ============== ====================
+ csum Header Checksum
+ (Ignored and automatically-calculated
+ when encoding)
+ src Source Address '192.0.2.1'
+ dst Destination Address '192.0.2.2'
+ option A bytearray which contains the entire
+ Options, or None for no Options
+ ============== ======================================== ==================
"""
_PACK_STR = '!BBHHHBBH4s4s'
diff --git a/ryu/lib/packet/ipv6.py b/ryu/lib/packet/ipv6.py
index f2393ef..b65b823 100644
--- a/ryu/lib/packet/ipv6.py
+++ b/ryu/lib/packet/ipv6.py
@@ -33,21 +33,23 @@ class ipv6(packet_base.PacketBase):
An instance has the following attributes at least.
Most of them are same to the on-wire counterparts but in host byte order.
+ IPv6 addresses are represented as a string like 'ff02::1'.
__init__ takes the correspondig args in this order.
- ============== ====================
- Attribute Description
- ============== ====================
+ ============== ======================================== ==================
+ Attribute Description Example
+ ============== ======================================== ==================
version Version
traffic_class Traffic Class
- flow_label When decoding, Flow Label. \
- When encoding, the most significant 8 bits of Flow Label.
+ flow_label When decoding, Flow Label.
+ When encoding, the most significant 8
+ bits of Flow Label.
payload_length Payload Length
nxt Next Header
hop_limit Hop Limit
- src Source Address
- dst Destination Address
- ============== ====================
+ src Source Address 'ff02::1'
+ dst Destination Address '::'
+ ============== ======================================== ==================
"""
_PACK_STR = '!IHBB16s16s'
--
1.8.1.5
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel