def _add_vlan_acl(self, vid): ofmsgs = [] if vid in self.dp.vlan_acl_in: acl_num = self.dp.vlan_acl_in[vid] acl_rule_priority = self.dp.highest_priority acl_allow_inst = valve_of.goto_table(self.dp.eth_src_table) for rule_conf in self.dp.acls[acl_num].rules: acl_match, acl_inst = valve_acl.build_acl_entry( rule_conf, acl_allow_inst, vlan_vid=vid) ofmsgs.append(self.valve_flowmod( self.dp.vlan_acl_table, acl_match, priority=acl_rule_priority, inst=acl_inst)) acl_rule_priority -= 1 return ofmsgs
def _port_add_acl(self, port_num): ofmsgs = [] forwarding_table = self.dp.eth_src_table if port_num in self.dp.acl_in: acl_num = self.dp.acl_in[port_num] forwarding_table = self.dp.acl_table acl_rule_priority = self.dp.highest_priority acl_allow_inst = valve_of.goto_table(self.dp.eth_src_table) for rule_conf in self.dp.acls[acl_num].rules: acl_match, acl_inst = valve_acl.build_acl_entry( rule_conf, acl_allow_inst, port_num) ofmsgs.append(self.valve_flowmod( self.dp.acl_table, acl_match, priority=acl_rule_priority, inst=acl_inst)) acl_rule_priority -= 1 return ofmsgs, forwarding_table
def _port_add_acl(self, port_num): ofmsgs = [] acl_allow_inst = valve_of.goto_table(self.dp.vlan_table) if port_num in self.dp.port_acl_in: acl_num = self.dp.port_acl_in[port_num] acl_rule_priority = self.dp.highest_priority for rule_conf in self.dp.acls[acl_num].rules: acl_match, acl_inst = valve_acl.build_acl_entry( rule_conf, acl_allow_inst, port_num) ofmsgs.append(self.valve_flowmod( self.dp.port_acl_table, acl_match, priority=acl_rule_priority, inst=acl_inst)) acl_rule_priority -= 1 else: ofmsgs.append(self.valve_flowmod( self.dp.port_acl_table, self.valve_in_match(self.dp.port_acl_table, in_port=port_num), priority=self.dp.highest_priority, inst=[acl_allow_inst] )) return ofmsgs