'Constructor.
:param bridge_classes: a dict for bridge classes.
:param conf: an instance of ConfigOpts'

def __init__(self, bridge_classes, conf=None):

    super(OVSNeutronAgent, self).__init__()
    self.conf = (conf or cfg.CONF)
    self.ovs = ovs_lib.BaseOVS()
    agent_conf = self.conf.AGENT
    ovs_conf = self.conf.OVS
    self.fullsync = False
    (self.br_int_cls, self.br_phys_cls, self.br_tun_cls) = (functools.partial(bridge_classes[b], datapath_type=ovs_conf.datapath_type) for b in ('br_int', 'br_phys', 'br_tun'))
    self.use_veth_interconnection = ovs_conf.use_veth_interconnection
    self.veth_mtu = agent_conf.veth_mtu
    self.available_local_vlans = set(moves.range(p_const.MIN_VLAN_TAG, (p_const.MAX_VLAN_TAG + 1)))
    self.tunnel_types = (agent_conf.tunnel_types or [])
    self.l2_pop = agent_conf.l2_population
    self.enable_distributed_routing = agent_conf.enable_distributed_routing
    self.arp_responder_enabled = (agent_conf.arp_responder and self.l2_pop)
    host = self.conf.host
    self.agent_id = ('ovs-agent-%s' % host)
    self.enable_tunneling = bool(self.tunnel_types)
    self._check_agent_configurations()
    self.int_br_device_count = 0
    self.int_br = self.br_int_cls(ovs_conf.integration_bridge)
    self.setup_integration_br()
    self.updated_ports = set()
    self.deleted_ports = set()
    self.network_ports = collections.defaultdict(set)
    self.vifname_to_ofport_map = {}
    self.setup_rpc()
    self.bridge_mappings = self._parse_bridge_mappings(ovs_conf.bridge_mappings)
    self.setup_physical_bridges(self.bridge_mappings)
    self.vlan_manager = vlanmanager.LocalVlanManager()
    self._reset_tunnel_ofports()
    self.polling_interval = agent_conf.polling_interval
    self.minimize_polling = agent_conf.minimize_polling
    self.ovsdb_monitor_respawn_interval = (agent_conf.ovsdb_monitor_respawn_interval or constants.DEFAULT_OVSDBMON_RESPAWN)
    self.local_ip = ovs_conf.local_ip
    self.tunnel_count = 0
    self.vxlan_udp_port = agent_conf.vxlan_udp_port
    self.dont_fragment = agent_conf.dont_fragment
    self.tunnel_csum = agent_conf.tunnel_csum
    self.tun_br = None
    self.patch_int_ofport = constants.OFPORT_INVALID
    self.patch_tun_ofport = constants.OFPORT_INVALID
    if self.enable_tunneling:
        self.setup_tunnel_br(ovs_conf.tunnel_bridge)
        self.setup_tunnel_br_flows()
    self.init_extension_manager(self.connection)
    self.dvr_agent = ovs_dvr_neutron_agent.OVSDVRNeutronAgent(self.context, self.dvr_plugin_rpc, self.int_br, self.tun_br, self.bridge_mappings, self.phys_brs, self.int_ofports, self.phys_ofports, self.patch_int_ofport, self.patch_tun_ofport, host, self.enable_tunneling, self.enable_distributed_routing)
    if self.enable_distributed_routing:
        self.dvr_agent.setup_dvr_flows()
    self.ancillary_brs = self.setup_ancillary_bridges(ovs_conf.integration_bridge, ovs_conf.tunnel_bridge)
    self._restore_local_vlan_map()
    self.sg_agent = agent_sg_rpc.SecurityGroupAgentRpc(self.context, self.sg_plugin_rpc, defer_refresh_firewall=True, integration_bridge=self.int_br)
    self.sg_plugin_rpc.register_legacy_sg_notification_callbacks(self.sg_agent)
    hybrid_plug = getattr(self.sg_agent.firewall, 'OVS_HYBRID_PLUG_REQUIRED', False)
    self.prevent_arp_spoofing = (not self.sg_agent.firewall.provides_arp_spoofing_protection)
    self.agent_state = {'binary': 'neutron-openvswitch-agent', 'host': host, 'topic': n_const.L2_AGENT_TOPIC, 'configurations': {'bridge_mappings': self.bridge_mappings, 'tunnel_types': self.tunnel_types, 'tunneling_ip': self.local_ip, 'l2_population': self.l2_pop, 'arp_responder_enabled': self.arp_responder_enabled, 'enable_distributed_routing': self.enable_distributed_routing, 'log_agent_heartbeats': agent_conf.log_agent_heartbeats, 'extensions': self.ext_manager.names(), 'datapath_type': ovs_conf.datapath_type, 'ovs_capabilities': self.ovs.capabilities, 'vhostuser_socket_dir': ovs_conf.vhostuser_socket_dir, portbindings.OVS_HYBRID_PLUG: hybrid_plug}, 'resource_versions': resources.LOCAL_RESOURCE_VERSIONS, 'agent_type': agent_conf.agent_type, 'start_flag': True}
    report_interval = agent_conf.report_interval
    if report_interval:
        heartbeat = loopingcall.FixedIntervalLoopingCall(self._report_state)
        heartbeat.start(interval=report_interval)
    self.iter_num = 0
    self.run_daemon_loop = True
    self.catch_sigterm = False
    self.catch_sighup = False
    self.connection.consume_in_threads()
    self.dead_topics.consume_in_threads()
    self.quitting_rpc_timeout = agent_conf.quitting_rpc_timeout
