def process_pdu(self, pdu):
        """ Process a PDU by sending a copy to each node as dictated by the
            addressing and if a node is promiscuous.
        """
        if _debug: Network._debug("process_pdu %r", pdu)

        if self.dropPercent != 0.0:
            if (random.random() * 100.0) < self.dropPercent:
                if _debug: Network._debug("    - packet dropped")
                return

        if not pdu.pduDestination or not isinstance(pdu.pduDestination, Address):
            raise RuntimeError("invalid destination address")

        elif pdu.pduDestination.addrType == Address.localBroadcastAddr:
            for n in self.nodes:
                if (pdu.pduSource != n.address):
                    n.response(deepcopy(pdu))

        elif pdu.pduDestination.addrType == Address.localStationAddr:
            for n in self.nodes:
                if n.promiscuous or (pdu.pduDestination == n.address):
                    n.response(deepcopy(pdu))

        else:
            raise RuntimeError("invalid destination address type")
dataset/ETHPy150Open JoelBender/bacpypes/py27/bacpypes/vlan.py/Network.process_pdu/original