'Do the actual flow updates for given direction and ethertype.'

def _update_flows_for_vlan_subr(self, direction, ethertype, vlan_tag, flow_state, addr_to_conj):

    current_ips = set(flow_state.keys())
    self.driver.delete_flows_for_ip_addresses((current_ips - set(addr_to_conj.keys())), direction, ethertype, vlan_tag)
    for (addr, conj_ids) in addr_to_conj.items():
        conj_ids.sort()
        if (flow_state.get(addr) == conj_ids):
            continue
        for flow in rules.create_flows_for_ip_address(addr, direction, ethertype, vlan_tag, conj_ids):
            self.driver._add_flow(**flow)
