def _process_router_floating_ips(self, ri, ex_gw_port):
<EOL>current_fips = ri.router.get(bc.constants.FLOATINGIP_KEY, [])<EOL>current_fip_ids = {fip['<STR_LIT:id>'] for fip in current_fips}<EOL>configured_fip_ids = {fip['<STR_LIT:id>'] for fip in ri.floating_ips}<EOL>id_to_current_fip_map = {}<EOL>fips_to_add = []<EOL>for configured_fip in current_fips:<EOL><INDENT>if configured_fip['<STR_LIT>']:<EOL><INDENT>id_to_current_fip_map[configured_fip['<STR_LIT:id>']] = configured_fip<EOL>if configured_fip['<STR_LIT:id>'] not in configured_fip_ids:<EOL><INDENT>fips_to_add.append(configured_fip)<EOL><DEDENT><DEDENT><DEDENT>fip_ids_to_remove = configured_fip_ids - current_fip_ids<EOL>LOG.debug("<STR_LIT>" % fips_to_add)<EOL>LOG.debug("<STR_LIT>" % fip_ids_to_remove)<EOL>fips_to_remove = []<EOL>fip_statuses = {}<EOL>for configured_fip in ri.floating_ips:<EOL><INDENT>if configured_fip['<STR_LIT:id>'] in fip_ids_to_remove:<EOL><INDENT>fips_to_remove.append(configured_fip)<EOL>self._floating_ip_removed(<EOL>ri, ri.ex_gw_port, configured_fip['<STR_LIT>'],<EOL>configured_fip['<STR_LIT>'])<EOL>fip_statuses[configured_fip['<STR_LIT:id>']] = (<EOL>bc.constants.FLOATINGIP_STATUS_DOWN)<EOL>LOG.debug("<STR_LIT>",<EOL>configured_fip['<STR_LIT:id>'],<EOL>configured_fip['<STR_LIT>'],<EOL>configured_fip['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>configured_fixed_ip = configured_fip['<STR_LIT>']<EOL>new_fip = id_to_current_fip_map[configured_fip['<STR_LIT:id>']]<EOL>current_fixed_ip = new_fip['<STR_LIT>']<EOL>if (current_fixed_ip and configured_fixed_ip and<EOL>current_fixed_ip != configured_fixed_ip):<EOL><INDENT>floating_ip = configured_fip['<STR_LIT>']<EOL>self._floating_ip_removed(ri, ri.ex_gw_port,<EOL>floating_ip, configured_fixed_ip)<EOL>fip_statuses[configured_fip['<STR_LIT:id>']] = (<EOL>bc.constants.FLOATINGIP_STATUS_DOWN)<EOL>fips_to_remove.append(configured_fip)<EOL>fips_to_add.append(new_fip)<EOL><DEDENT><DEDENT><DEDENT>for configured_fip in fips_to_remove:<EOL><INDENT>ri.floating_ips.remove(configured_fip)<EOL><DEDENT>for configured_fip in fips_to_add:<EOL><INDENT>self._floating_ip_added(ri, ex_gw_port,<EOL>configured_fip['<STR_LIT>'],<EOL>configured_fip['<STR_LIT>'])<EOL>ri.floating_ips.append(configured_fip)<EOL>fip_statuses[configured_fip['<STR_LIT:id>']] = (<EOL>bc.constants.FLOATINGIP_STATUS_ACTIVE)<EOL>LOG.debug("<STR_LIT>",<EOL>configured_fip['<STR_LIT:id>'],<EOL>configured_fip['<STR_LIT>'],<EOL>configured_fip['<STR_LIT>'])<EOL><DEDENT>if fip_statuses:<EOL><INDENT>LOG.debug("<STR_LIT>", fip_statuses)<EOL>self.plugin_rpc.update_floatingip_statuses(<EOL>self.context, ri.router_id, fip_statuses)<EOL><DEDENT>
Process a router's floating ips.

        Compare floatingips configured in device (i.e., those fips in
        the ri.floating_ips "cache") with the router's updated floating ips
        (in ri.router.floating_ips) and determine floating_ips which were
        added or removed. Notify driver of the change via
        `floating_ip_added()` or `floating_ip_removed()`. Also update plugin
        with status of fips.

        :param ri:  RouterInfo object of the router being processed.
        :param ex_gw_port: Port dict of the external gateway port.
        :return: None
        :raises: networking_cisco.plugins.cisco.cfg_agent.cfg_exceptions.
        DriverException if the configuration operation fails.