diff options
author | Yusuke Iwase <iwase.yusuke0@gmail.com> | 2014-12-05 09:53:24 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-12-05 10:00:32 +0900 |
commit | 311fe904d2bd6f95ce65f3dd853913130f57d056 (patch) | |
tree | 4b1d5ace0fb0a1759237bb9c9951671f2af7d987 | |
parent | cf58ed01098a3a725494838d32dfe2426ba543ad (diff) |
ofproto_v1_[234]_parser: Add notes for vlan_vid match field
To make it possible to refer the usage of vlan_vid match field
at Ryu-documentation, This patch adds notes into ofproto_v1_[234]_parser.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/ofproto/ofproto_v1_2_parser.py | 60 | ||||
-rw-r--r-- | ryu/ofproto/ofproto_v1_3_parser.py | 60 | ||||
-rw-r--r-- | ryu/ofproto/ofproto_v1_4_parser.py | 60 |
3 files changed, 180 insertions, 0 deletions
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py index 39a5b0c8..20f3b572 100644 --- a/ryu/ofproto/ofproto_v1_2_parser.py +++ b/ryu/ofproto/ofproto_v1_2_parser.py @@ -3316,6 +3316,66 @@ class OFPMatch(StringifyMixin): ... print match['ipv6_src'] ... ('2001:db8:bd05:1d2:288a:1fc0:1:10ee', 'ffff:ffff:ffff:ffff::') + + .. Note:: + + For VLAN id match field, special values are defined in OpenFlow Spec. + + 1) Packets with and without a VLAN tag + + - Example:: + + match = parser.OFPMatch() + + - Packet Matching + + ====================== ===== + non-VLAN-tagged MATCH + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) MATCH + ====================== ===== + + 2) Only packets without a VLAN tag + + - Example:: + + match = parser.OFPMatch(vlan_vid=0x0000) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged MATCH + VLAN-tagged(vlan_id=3) x + VLAN-tagged(vlan_id=5) x + ====================== ===== + + 3) Only packets with a VLAN tag regardless of its value + + - Example:: + + match = parser.OFPMatch(vlan_vid=(0x1000, 0x1000)) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged x + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) MATCH + ====================== ===== + + 4) Only packets with VLAN tag and VID equal + + - Example:: + + match = parser.OFPMatch(vlan_vid=(0x1000 | 3)) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged x + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) x + ====================== ===== """ def __init__(self, type_=None, length=None, _ordered_fields=None, diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py index 53d235c3..1d2d671b 100644 --- a/ryu/ofproto/ofproto_v1_3_parser.py +++ b/ryu/ofproto/ofproto_v1_3_parser.py @@ -743,6 +743,66 @@ class OFPMatch(StringifyMixin): ... print match['ipv6_src'] ... ('2001:db8:bd05:1d2:288a:1fc0:1:10ee', 'ffff:ffff:ffff:ffff::') + + .. Note:: + + For VLAN id match field, special values are defined in OpenFlow Spec. + + 1) Packets with and without a VLAN tag + + - Example:: + + match = parser.OFPMatch() + + - Packet Matching + + ====================== ===== + non-VLAN-tagged MATCH + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) MATCH + ====================== ===== + + 2) Only packets without a VLAN tag + + - Example:: + + match = parser.OFPMatch(vlan_vid=0x0000) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged MATCH + VLAN-tagged(vlan_id=3) x + VLAN-tagged(vlan_id=5) x + ====================== ===== + + 3) Only packets with a VLAN tag regardless of its value + + - Example:: + + match = parser.OFPMatch(vlan_vid=(0x1000, 0x1000)) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged x + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) MATCH + ====================== ===== + + 4) Only packets with VLAN tag and VID equal + + - Example:: + + match = parser.OFPMatch(vlan_vid=(0x1000 | 3)) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged x + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) x + ====================== ===== """ def __init__(self, type_=None, length=None, _ordered_fields=None, diff --git a/ryu/ofproto/ofproto_v1_4_parser.py b/ryu/ofproto/ofproto_v1_4_parser.py index 60ead3f8..1363908d 100644 --- a/ryu/ofproto/ofproto_v1_4_parser.py +++ b/ryu/ofproto/ofproto_v1_4_parser.py @@ -641,6 +641,66 @@ class OFPMatch(StringifyMixin): ... print match['ipv6_src'] ... ('2001:db8:bd05:1d2:288a:1fc0:1:10ee', 'ffff:ffff:ffff:ffff::') + + .. Note:: + + For VLAN id match field, special values are defined in OpenFlow Spec. + + 1) Packets with and without a VLAN tag + + - Example:: + + match = parser.OFPMatch() + + - Packet Matching + + ====================== ===== + non-VLAN-tagged MATCH + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) MATCH + ====================== ===== + + 2) Only packets without a VLAN tag + + - Example:: + + match = parser.OFPMatch(vlan_vid=0x0000) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged MATCH + VLAN-tagged(vlan_id=3) x + VLAN-tagged(vlan_id=5) x + ====================== ===== + + 3) Only packets with a VLAN tag regardless of its value + + - Example:: + + match = parser.OFPMatch(vlan_vid=(0x1000, 0x1000)) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged x + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) MATCH + ====================== ===== + + 4) Only packets with VLAN tag and VID equal + + - Example:: + + match = parser.OFPMatch(vlan_vid=(0x1000 | 3)) + + - Packet Matching + + ====================== ===== + non-VLAN-tagged x + VLAN-tagged(vlan_id=3) MATCH + VLAN-tagged(vlan_id=5) x + ====================== ===== """ def __init__(self, type_=None, length=None, _ordered_fields=None, |