예제 #1
0
    def __init__(self, cid=None, sid=None):
        """An Annex-H BACnet Tunneling Router node."""
        if _debug: BTR._debug("__init__ cid=%r sid=%r", cid, sid)
        Client.__init__(self, cid)
        Server.__init__(self, sid)

        # initialize a dicitonary of peers
        self.peers = {}
예제 #2
0
    def __init__(self, cid=None, sid=None):
        """An Annex-H BACnet Tunneling Router node."""
        if _debug: BTR._debug("__init__ cid=%r sid=%r", cid, sid)
        Client.__init__(self, cid)
        Server.__init__(self, sid)

        # initialize a dicitonary of peers
        self.peers = {}
예제 #3
0
 def __init__(self, sapID=None, cid=None, sid=None):
     """A BIP node."""
     if _debug:
         BIPSimple._debug("__init__ sapID=%r cid=%r sid=%r", sapID, cid,
                          sid)
     BIPSAP.__init__(self, sapID)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
예제 #4
0
    def __init__(self, mux, addr=None, userinfo=None, cid=None):
        if _debug: ProxyClientService._debug("__init__ %r %r userinfo=%r cid=%r", mux, addr, userinfo, cid)
        ServiceAdapter.__init__(self, mux)
        Client.__init__(self, cid)

        # save the address of the server and the userinfo
        self.address = addr
        self.userinfo = userinfo
예제 #5
0
    def __init__(self, sap, net, cid=None):
        if _debug:
            NetworkAdapter._debug("__init__ %r (net=%r) cid=%r", sap, net, cid)
        Client.__init__(self, cid)
        self.adapterSAP = sap
        self.adapterNet = net

        # add this to the list of adapters for the network
        sap.adapters.append(self)
예제 #6
0
 def __init__(self, fn, cid=None, sid=None):
     if _debug: StreamToPacket._debug("__init__ %r cid=%r, sid=%r", fn, cid, sid)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
     
     # save the packet function
     self.packetFn = fn
     
     # start with an empty set of buffers
     self.upstreamBuffer = {}
     self.downstreamBuffer = {}
예제 #7
0
 def __init__(self, fn, cid=None, sid=None):
     if _debug: StreamToPacket._debug("__init__ %r cid=%r, sid=%r", fn, cid, sid)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
     
     # save the packet function
     self.packetFn = fn
     
     # start with an empty set of buffers
     self.upstreamBuffer = {}
     self.downstreamBuffer = {}
예제 #8
0
    def __init__(self, addr, sapID=None, cid=None, sid=None):
        """A BBMD node."""
        if _debug: BIPBBMD._debug("__init__ %r sapID=%r cid=%r sid=%r", addr, sapID, cid, sid)
        BIPSAP.__init__(self, sapID)
        Client.__init__(self, cid)
        Server.__init__(self, sid)
        RecurringTask.__init__(self, 1000.0)

        self.bbmdAddress = addr
        self.bbmdBDT = []
        self.bbmdFDT = []

        # install so process_task runs
        self.install_task()
예제 #9
0
    def request(self, pdu):
        if _debug: TCPClientMultiplexer._debug("request %r", pdu)

        # encode it as a BSLPDU
        xpdu = BSLPDU()
        pdu.encode(xpdu)
        if _debug: TCPClientMultiplexer._debug("    - xpdu: %r", xpdu)

        # encode it as a raw PDU
        ypdu = PDU()
        xpdu.encode(ypdu)
        ypdu.pduDestination = unpack_ip_addr(pdu.pduDestination.addrAddr)
        if _debug: TCPClientMultiplexer._debug("    - ypdu: %r", ypdu)

        # continue along
        Client.request(self, ypdu)
예제 #10
0
    def __init__(self, addr, sapID=None, cid=None, sid=None):
        """A BBMD node."""
        if _debug:
            BIPBBMD._debug("__init__ %r sapID=%r cid=%r sid=%r", addr, sapID,
                           cid, sid)
        BIPSAP.__init__(self, sapID)
        Client.__init__(self, cid)
        Server.__init__(self, sid)
        RecurringTask.__init__(self, 1000.0)

        self.bbmdAddress = addr
        self.bbmdBDT = []
        self.bbmdFDT = []

        # install so process_task runs
        self.install_task()
예제 #11
0
    def __init__(self):
        if _debug: TCPClientMultiplexer._debug("__init__")
        Client.__init__(self)

        # create and bind
        self.director = TCPClientDirector()
        bind(self, _StreamToPacket(), self.director)

        # create an application service element and bind
        self.ase = TCPMultiplexerASE(self)
        bind(self.ase, self.director)

        # keep a dictionary of connections
        self.connections = {}

        # no services available until they are created, they are
        # instances of ServiceAdapter
        self.deviceToDeviceService = None
        self.routerToRouterService = None
        self.proxyService = None
        self.laneService = None
예제 #12
0
    def __init__(self, addr=None):
        if _debug: TCPServerMultiplexer._debug("__init__ %r", addr)
        Client.__init__(self)

        # check for some options
        if addr is None:
            self.address = Address()
            self.addrTuple = ('', 47808)
        else:
            # allow the address to be cast
            if isinstance(addr, Address):
                self.address = addr
            else:
                self.address = Address(addr)

            # extract the tuple for binding
            self.addrTuple = self.address.addrTuple

        if _debug:
            TCPServerMultiplexer._debug("    - address: %r", self.address)
            TCPServerMultiplexer._debug("    - addrTuple: %r", self.addrTuple)

        # create and bind
        self.director = TCPServerDirector(self.addrTuple)
        bind(self, _StreamToPacket(), self.director)

        # create an application service element and bind
        self.ase = TCPMultiplexerASE(self)
        bind(self.ase, self.director)

        # keep a dictionary of connections
        self.connections = {}

        # no services available until they are created, they are
        # instances of ServiceAdapter
        self.deviceToDeviceService = None
        self.routerToRouterService = None
        self.proxyService = None
        self.laneService = None
예제 #13
0
    def __init__(self, addr=None, ttl=None, sapID=None, cid=None, sid=None):
        """A BIP node."""
        if _debug: BIPForeign._debug("__init__ addr=%r ttl=%r sapID=%r cid=%r sid=%r", addr, ttl, sapID, cid, sid)
        BIPSAP.__init__(self, sapID)
        Client.__init__(self, cid)
        Server.__init__(self, sid)
        OneShotTask.__init__(self)

        # -2=unregistered, -1=not attempted or no ack, 0=OK, >0 error
        self.registrationStatus = -1

        # clear the BBMD address and time-to-live
        self.bbmdAddress = None
        self.bbmdTimeToLive = None

        # registration provided
        if addr:
            # a little error checking
            if ttl is None:
                raise RuntimeError, "BBMD address and time-to-live must both be specified"

            self.register(addr, ttl)
예제 #14
0
    def __init__(self, addr=None, ttl=None, sapID=None, cid=None, sid=None):
        """A BIP node."""
        if _debug:
            BIPForeign._debug("__init__ addr=%r ttl=%r sapID=%r cid=%r sid=%r",
                              addr, ttl, sapID, cid, sid)
        BIPSAP.__init__(self, sapID)
        Client.__init__(self, cid)
        Server.__init__(self, sid)
        OneShotTask.__init__(self)

        # -2=unregistered, -1=not attempted or no ack, 0=OK, >0 error
        self.registrationStatus = -1

        # clear the BBMD address and time-to-live
        self.bbmdAddress = None
        self.bbmdTimeToLive = None

        # registration provided
        if addr:
            # a little error checking
            if ttl is None:
                raise RuntimeError, "BBMD address and time-to-live must both be specified"

            self.register(addr, ttl)
예제 #15
0
 def __init__(self, mux):
     Client.__init__(self)
     self.multiplexer = mux
예제 #16
0
 def __init__(self, cid=None, sid=None):
     if _debug: AnnexJCodec._debug("__init__ cid=%r sid=%r", cid, sid)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
예제 #17
0
 def __init__(self, cid=None):
     ConsoleClient._debug("__init__ cid=%r", cid)
     asyncore.file_dispatcher.__init__(self, sys.stdin)
     Client.__init__(self, cid)
예제 #18
0
 def __init__(self, cid=None):
     ConsoleClient._debug("__init__ cid=%r", cid)
     asyncore.file_dispatcher.__init__(self, sys.stdin)
     Client.__init__(self, cid)
예제 #19
0
 def __init__(self, cid=None, sid=None):
     if _debug: AnnexJCodec._debug("__init__ cid=%r sid=%r", cid, sid)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
예제 #20
0
 def __init__(self, sapID=None, cid=None, sid=None):
     """A BIP node."""
     if _debug: BIPSimple._debug("__init__ sapID=%r cid=%r sid=%r", sapID, cid, sid)
     BIPSAP.__init__(self, sapID)
     Client.__init__(self, cid)
     Server.__init__(self, sid)
예제 #21
0
 def __init__(self, mux):
     Client.__init__(self)
     self.multiplexer = mux