def test_match_pack(self): obj = ofp.match([ ofp.oxm.udp_dst(53), ofp.oxm.metadata_masked(0xFEDCBA9876543210, 0xFFFFFFFF12345678), ofp.oxm.eth_src([1,2,3,4,5,6]), ofp.oxm.ipv6_dst("\x12" * 16), ]) self.assertEquals(self.sample_match_buf, obj.pack())
of_master_role_request = of.message.role_request( xid=generate_xid(), role=of.const.OFPCR_ROLE_MASTER) of_set_config = of.message.set_config(xid=generate_xid(), miss_send_len=128) # FlowMod message to add the dummy flow of_flow_add = of.message.flow_add(xid=generate_xid(), cookie=1991, hard_timeout=1, flags=of.const.OFPFF_SEND_FLOW_REM, buffer_id=of.const.OFP_NO_BUFFER, out_port=of.const.OFPP_ANY, out_group=of.const.OFPG_ANY, match=of.match([ of.oxm.in_port(1991), ]), instructions=[]) # FlowMod message to add the dummy flow of_flow_delete = of.message.flow_delete(xid=generate_xid(), cookie=1991, hard_timeout=1, flags=of.const.OFPFF_SEND_FLOW_REM, buffer_id=of.const.OFP_NO_BUFFER, out_port=of.const.OFPP_ANY, out_group=of.const.OFPG_ANY, match=of.match([ of.oxm.in_port(1991), ]), instructions=[])
def test_empty_match_pack(self): obj = ofp.match() self.assertEquals(self.sample_empty_match_buf, obj.pack())