Signed-off-by: FUJITA Tomonori <[email protected]>
---
ryu/ofproto/ofproto_v1_0.py | 5 +++++
ryu/ofproto/ofproto_v1_0_parser.py | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_0.py b/ryu/ofproto/ofproto_v1_0.py
index 91ce666..3052664 100644
--- a/ryu/ofproto/ofproto_v1_0.py
+++ b/ryu/ofproto/ofproto_v1_0.py
@@ -235,6 +235,7 @@ OFP_ACTION_PACK_STR = '!H'
NXAST_RESUBMIT = 1
NXAST_SET_TUNNEL = 2
NXAST_REG_MOVE = 6
+NXAST_REG_LOAD = 7
NXAST_SET_TUNNEL64 = 9
NXAST_MULTIPATH = 10
NXAST_RESUBMIT_TABLE = 14
@@ -251,6 +252,10 @@ NX_ACTION_REG_MOVE_PACK_STR = '!HHIHHHHII'
NX_ACTION_REG_MOVE_SIZE = 24
assert calcsize(NX_ACTION_REG_MOVE_PACK_STR) == NX_ACTION_REG_MOVE_SIZE
+NX_ACTION_REG_LOAD_PACK_STR = '!HHIHHIQ'
+NX_ACTION_REG_LOAD_SIZE = 24
+assert calcsize(NX_ACTION_REG_LOAD_PACK_STR) == NX_ACTION_REG_LOAD_SIZE
+
NX_ACTION_SET_TUNNEL64_PACK_STR = '!HHIH6xQ'
NX_ACTION_SET_TUNNEL64_SIZE = 24
assert calcsize(NX_ACTION_SET_TUNNEL64_PACK_STR) == NX_ACTION_SET_TUNNEL64_SIZE
diff --git a/ryu/ofproto/ofproto_v1_0_parser.py
b/ryu/ofproto/ofproto_v1_0_parser.py
index eb07924..60ffd14 100644
--- a/ryu/ofproto/ofproto_v1_0_parser.py
+++ b/ryu/ofproto/ofproto_v1_0_parser.py
@@ -506,6 +506,30 @@ class NXActionRegMove(NXActionHeader):
ofprot_v1_0.NX_ACTION_REG_MOVE_PACK_STR, buf, offset)
return cls(n_bits, src_ofs, dst_ofs, src, dst)
+
[email protected]_nx_action_subtype(ofproto_v1_0.NXAST_REG_LOAD)
+class NXActionRegLoad(NXActionHeader):
+ def __init__(self, ofs_nbits, dst, value):
+ super(NXActionRegLoad, self).__init__(
+ ofproto_v1_0.NXAST_REG_LOAD,
+ ofproto_v1_0.NX_ACTION_REG_LOAD_SIZE)
+ self.ofs_nbits = ofs_nbits
+ self.dst = dst
+ self.value = value
+
+ def serialize(self, buf, offset):
+ msg_pack_into(ofproto_v1_0.NX_ACTION_REG_LOAD_PACK_STR, buf,
+ offset, self.type, self.len, self.vendor,
+ self.subtype, self.ofs_nbits, self.dst, self.value)
+
+ @classmethod
+ def parser(cls, buf, offset):
+ type_, len_, vendor, subtype, ofs_nbits, dst,
+ value = struct.unpack_from(
+ ofprot_v1_0.NX_ACTION_REG_LOAD_PACK_STR, buf, offset)
+ return cls(ofs_nbits, dst, value)
+
+
@NXActionHeader.register_nx_action_subtype(ofproto_v1_0.NXAST_SET_TUNNEL64)
class NXActionSetTunnel64(NXActionHeader):
def __init__(self, tun_id_):
--
1.7.4.4
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel