def valve_in_match(self, table_id, in_port=None, vlan=None, eth_type=None, eth_src=None, eth_dst=None, eth_dst_mask=None, ipv6_nd_target=None, icmpv6_type=None, nw_proto=None, nw_src=None, nw_dst=None): """Compose an OpenFlow match rule.""" match_dict = valve_of.build_match_dict(in_port, vlan, eth_type, eth_src, eth_dst, eth_dst_mask, ipv6_nd_target, icmpv6_type, nw_proto, nw_src, nw_dst) if table_id != self.dp.port_acl_table\ and table_id != self.dp.vlan_acl_table: assert table_id in self.TABLE_MATCH_TYPES,\ '%u table not registered' % table_id for match_type in match_dict.iterkeys(): assert match_type in self.TABLE_MATCH_TYPES[table_id],\ '%s match not registered for table %u' % ( match_type, table_id) match = valve_of.match(match_dict) return match
def valve_in_match(self, table_id, in_port=None, vlan=None, eth_type=None, eth_src=None, eth_dst=None, eth_dst_mask=None, ipv6_nd_target=None, icmpv6_type=None, nw_proto=None, nw_src=None, nw_dst=None): match_dict = valve_of.build_match_dict( in_port, vlan, eth_type, eth_src, eth_dst, eth_dst_mask, ipv6_nd_target, icmpv6_type, nw_proto, nw_src, nw_dst) if table_id != self.dp.acl_table: assert table_id in self.TABLE_MATCH_TYPES,\ '%u table not registered' % table_id for match_type in match_dict.iterkeys(): assert match_type in self.TABLE_MATCH_TYPES[table_id],\ '%s match not registered for table %u' % ( match_type, table_id) match = valve_of.match(match_dict) return match
def match(self, in_port=None, vlan=None, eth_type=None, eth_src=None, eth_dst=None, eth_dst_mask=None, ipv6_nd_target=None, icmpv6_type=None, nw_proto=None, nw_src=None, nw_dst=None): """Compose an OpenFlow match rule.""" match_dict = valve_of.build_match_dict(in_port, vlan, eth_type, eth_src, eth_dst, eth_dst_mask, ipv6_nd_target, icmpv6_type, nw_proto, nw_src, nw_dst) match = valve_of.match(match_dict) if self.restricted_match_types is not None: for match_type in match_dict: assert match_type in self.restricted_match_types, '%s match in table %s' % ( match_type, self.name) return match