Signed-off-by: FUJITA Tomonori <fujita.tomon...@lab.ntt.co.jp> --- ryu/ofproto/ofproto_v1_0.py | 10 ++++++++++ ryu/ofproto/ofproto_v1_0_parser.py | 13 +++++++++++++ 2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/ryu/ofproto/ofproto_v1_0.py b/ryu/ofproto/ofproto_v1_0.py index 55350ce..5c9c205 100644 --- a/ryu/ofproto/ofproto_v1_0.py +++ b/ryu/ofproto/ofproto_v1_0.py @@ -573,6 +573,7 @@ NXT_SET_FLOW_FORMAT = 12 NXT_FLOW_MOD = 13 NXT_FLOW_REMOVED = 14 NXT_FLOW_MOD_TABLE_ID = 15 +NXT_SET_PACKET_IN_FORMAT = 16 NXT_SET_CONTROLLER_ID = 20 # enum nx_role @@ -584,6 +585,10 @@ NX_ROLE_SLAVE = 2 NXFF_OPENFLOW10 = 0 NXFF_NXM = 2 +# enum nx_packet_in_format +NXPIF_OPENFLOW10 = 0 +NXPIF_NXM = 1 + NICIRA_HEADER_PACK_STR = '!II' NICIRA_HEADER_SIZE = 16 assert (calcsize(NICIRA_HEADER_PACK_STR) + @@ -614,6 +619,11 @@ NX_FLOW_MOD_TABLE_ID_SIZE = 24 assert (calcsize(NX_FLOW_MOD_TABLE_ID_PACK_STR) + NICIRA_HEADER_SIZE == NX_FLOW_MOD_TABLE_ID_SIZE) +NX_SET_PACKET_IN_FORMAT_PACK_STR = '!I' +NX_SET_PACKET_IN_FORMAT_SIZE = 20 +assert (calcsize(NX_SET_PACKET_IN_FORMAT_PACK_STR) + + NICIRA_HEADER_SIZE == NX_SET_PACKET_IN_FORMAT_SIZE) + NX_CONTROLLER_ID_PACK_STR = '!6xH' NX_CONTROLLER_ID_SIZE = 24 assert (calcsize(NX_CONTROLLER_ID_PACK_STR) + diff --git a/ryu/ofproto/ofproto_v1_0_parser.py b/ryu/ofproto/ofproto_v1_0_parser.py index 82e17a0..07acce4 100644 --- a/ryu/ofproto/ofproto_v1_0_parser.py +++ b/ryu/ofproto/ofproto_v1_0_parser.py @@ -1355,6 +1355,19 @@ class NXTFlowRemoved(NiciraHeader): byte_count, match) +class NXTSetPacketInFormat(NiciraHeader): + def __init__(self, datapath, packet_in_format): + super(NXTSetPacketInFormat, self).__init__( + datapath, ofproto_v1_0.NXT_SET_PACKET_IN_FORMAT) + self.format = packet_in_format + + def _serialize_body(self): + self.serialize_header() + msg_pack_into(ofproto_v1_0.NX_SET_PACKET_IN_FORMAT_PACK_STR, + self.buf, ofproto_v1_0.NICIRA_HEADER_SIZE, + self.format) + + class NXTSetControllerId(NiciraHeader): def __init__(self, datapath, controller_id): super(NXTSetControllerId, self).__init__( -- 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 Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel