Esempio n. 1
0
    import pcap
except:
    pass

from debugging import ModuleLogger, DebugContents, bacpypes_debugging

from pdu import PDU, Address
from bvll import BVLPDU, bvl_pdu_types, ForwardedNPDU, \
    DistributeBroadcastToNetwork, OriginalUnicastNPDU, OriginalBroadcastNPDU
from npdu import NPDU, npdu_types
from apdu import APDU, apdu_types, confirmed_request_types, unconfirmed_request_types, complex_ack_types, error_types, \
    ConfirmedRequestPDU, UnconfirmedRequestPDU, SimpleAckPDU, ComplexAckPDU, SegmentAckPDU, ErrorPDU, RejectPDU, AbortPDU

# some debugging
_debug = 0
_log = ModuleLogger(globals())

# protocol map
_protocols = {
    socket.IPPROTO_TCP: 'tcp',
    socket.IPPROTO_UDP: 'udp',
    socket.IPPROTO_ICMP: 'icmp'
}

#
#   _hexify
#


def _hexify(s, sep='.'):
    return sep.join('%02X' % ord(c) for c in s)
Esempio n. 2
0
#!/usr/bin/python

"""
BACnet Virtual Link Layer Module
"""

from errors import EncodingError, DecodingError
from debugging import ModuleLogger, DebugContents, bacpypes_debugging

from pdu import *

# some debuging
_debug = 0
_log = ModuleLogger(globals())

# a dictionary of message type values and classes
bvl_pdu_types = {}

def register_bvlpdu_type(klass):
    bvl_pdu_types[klass.messageType] = klass

#
#   BVLCI
#

@bacpypes_debugging
class BVLCI(PCI, DebugContents):

    _debug_contents = ('bvlciType', 'bvlciFunction', 'bvlciLength')
    
    result                              = 0x00
Esempio n. 3
0
    import pcap
except:
    pass

from debugging import ModuleLogger, DebugContents, bacpypes_debugging

from pdu import PDU, Address
from bvll import BVLPDU, bvl_pdu_types, ForwardedNPDU, \
    DistributeBroadcastToNetwork, OriginalUnicastNPDU, OriginalBroadcastNPDU
from npdu import NPDU, npdu_types
from apdu import APDU, apdu_types, confirmed_request_types, unconfirmed_request_types, complex_ack_types, error_types, \
    ConfirmedRequestPDU, UnconfirmedRequestPDU, SimpleAckPDU, ComplexAckPDU, SegmentAckPDU, ErrorPDU, RejectPDU, AbortPDU

# some debugging
_debug = 0
_log = ModuleLogger(globals())

# protocol map
_protocols={socket.IPPROTO_TCP:'tcp',
           socket.IPPROTO_UDP:'udp',
           socket.IPPROTO_ICMP:'icmp'}

#
#   _hexify
#

def _hexify(s, sep='.'):
    return sep.join('%02X' % ord(c) for c in s)

#
#   strftimestamp