'Get (dp, ofp, ofpp) tuple for the switch.
A convenient method for openflow message composers.'

def _get_dp(self):

    while True:
        if (self._cached_dpid is None):
            dpid_str = self.get_datapath_id()
            LOG.info(_LI('Bridge    %(br_name)s    has    datapath-ID    %(dpid)s'), {'br_name': self.br_name, 'dpid': dpid_str})
            self._cached_dpid = int(dpid_str, 16)
        try:
            dp = self._get_dp_by_dpid(self._cached_dpid)
            return (dp, dp.ofproto, dp.ofproto_parser)
        except RuntimeError:
            with excutils.save_and_reraise_exception() as ctx:
                old_dpid_str = format(self._cached_dpid, '0x')
                new_dpid_str = self.get_datapath_id()
                if (new_dpid_str != old_dpid_str):
                    LOG.info(_LI('Bridge    %(br_name)s    changed    its    datapath-ID    from    %(old)s    to    %(new)s'), {'br_name': self.br_name, 'old': old_dpid_str, 'new': new_dpid_str})
                    ctx.reraise = False
                self._cached_dpid = int(new_dpid_str, 16)
