diff --git a/py25/bacpypes/bvllservice.py b/py25/bacpypes/bvllservice.py index eabd4cc..65ae614 100755 --- a/py25/bacpypes/bvllservice.py +++ b/py25/bacpypes/bvllservice.py @@ -494,11 +494,6 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): def indication(self, pdu): if _debug: BIPForeign._debug("indication %r", pdu) - # check the BBMD registration status, we may not be registered - if self.registrationStatus != 0: - if _debug: BIPForeign._debug(" - packet dropped, unregistered") - return - # check for local stations if pdu.pduDestination.addrType == Address.localStationAddr: # make an original unicast PDU @@ -510,6 +505,11 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): # check for broadcasts elif pdu.pduDestination.addrType == Address.localBroadcastAddr: + # check the BBMD registration status, we may not be registered + if self.registrationStatus != 0: + if _debug: BIPForeign._debug(" - packet dropped, unregistered") + return + # make an original broadcast PDU xpdu = DistributeBroadcastToNetwork(pdu, user_data=pdu.pduUserData) xpdu.pduDestination = self.bbmdAddress @@ -546,6 +546,13 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): return + elif isinstance(pdu, OriginalUnicastNPDU): + # build a vanilla PDU + xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) + + # send it upstream + self.response(xpdu) + # check the BBMD registration status, we may not be registered if self.registrationStatus != 0: if _debug: BIPForeign._debug(" - packet dropped, unregistered") @@ -559,13 +566,6 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): # send this to the service access point self.sap_response(pdu) - elif isinstance(pdu, OriginalUnicastNPDU): - # build a vanilla PDU - xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) - - # send it upstream - self.response(xpdu) - elif isinstance(pdu, ForwardedNPDU): # build a PDU with the source from the real source xpdu = PDU(pdu.pduData, source=pdu.bvlciAddress, destination=LocalBroadcast(), user_data=pdu.pduUserData) diff --git a/py27/bacpypes/bvllservice.py b/py27/bacpypes/bvllservice.py index ae71941..4c2cc18 100755 --- a/py27/bacpypes/bvllservice.py +++ b/py27/bacpypes/bvllservice.py @@ -490,11 +490,6 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): def indication(self, pdu): if _debug: BIPForeign._debug("indication %r", pdu) - # check the BBMD registration status, we may not be registered - if self.registrationStatus != 0: - if _debug: BIPForeign._debug(" - packet dropped, unregistered") - return - # check for local stations if pdu.pduDestination.addrType == Address.localStationAddr: # make an original unicast PDU @@ -506,6 +501,11 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): # check for broadcasts elif pdu.pduDestination.addrType == Address.localBroadcastAddr: + # check the BBMD registration status, we may not be registered + if self.registrationStatus != 0: + if _debug: BIPForeign._debug(" - packet dropped, unregistered") + return + # make an original broadcast PDU xpdu = DistributeBroadcastToNetwork(pdu, user_data=pdu.pduUserData) xpdu.pduDestination = self.bbmdAddress @@ -542,6 +542,14 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): return + elif isinstance(pdu, OriginalUnicastNPDU): + # build a vanilla PDU + xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) + + # send it upstream + self.response(xpdu) + return + # check the BBMD registration status, we may not be registered if self.registrationStatus != 0: if _debug: BIPForeign._debug(" - packet dropped, unregistered") @@ -555,13 +563,6 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): # send this to the service access point self.sap_response(pdu) - elif isinstance(pdu, OriginalUnicastNPDU): - # build a vanilla PDU - xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) - - # send it upstream - self.response(xpdu) - elif isinstance(pdu, ForwardedNPDU): # build a PDU with the source from the real source xpdu = PDU(pdu.pduData, source=pdu.bvlciAddress, destination=LocalBroadcast(), user_data=pdu.pduUserData) diff --git a/py34/bacpypes/bvllservice.py b/py34/bacpypes/bvllservice.py index db7e529..dddb2d0 100755 --- a/py34/bacpypes/bvllservice.py +++ b/py34/bacpypes/bvllservice.py @@ -489,11 +489,6 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): def indication(self, pdu): if _debug: BIPForeign._debug("indication %r", pdu) - # check the BBMD registration status, we may not be registered - if self.registrationStatus != 0: - if _debug: BIPForeign._debug(" - packet dropped, unregistered") - return - # check for local stations if pdu.pduDestination.addrType == Address.localStationAddr: # make an original unicast PDU @@ -505,6 +500,11 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): # check for broadcasts elif pdu.pduDestination.addrType == Address.localBroadcastAddr: + # check the BBMD registration status, we may not be registered + if self.registrationStatus != 0: + if _debug: BIPForeign._debug(" - packet dropped, unregistered") + return + # make an original broadcast PDU xpdu = DistributeBroadcastToNetwork(pdu, user_data=pdu.pduUserData) xpdu.pduDestination = self.bbmdAddress @@ -541,6 +541,13 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): return + elif isinstance(pdu, OriginalUnicastNPDU): + # build a vanilla PDU + xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) + + # send it upstream + self.response(xpdu) + # check the BBMD registration status, we may not be registered if self.registrationStatus != 0: if _debug: BIPForeign._debug(" - packet dropped, unregistered") @@ -554,13 +561,6 @@ class BIPForeign(BIPSAP, Client, Server, OneShotTask, DebugContents): # send this to the service access point self.sap_response(pdu) - elif isinstance(pdu, OriginalUnicastNPDU): - # build a vanilla PDU - xpdu = PDU(pdu.pduData, source=pdu.pduSource, destination=pdu.pduDestination, user_data=pdu.pduUserData) - - # send it upstream - self.response(xpdu) - elif isinstance(pdu, ForwardedNPDU): # build a PDU with the source from the real source xpdu = PDU(pdu.pduData, source=pdu.bvlciAddress, destination=LocalBroadcast(), user_data=pdu.pduUserData)