def dataReceived(self, data):
        packets = data_util.read_data(data)

        for packet in packets:

            txn = packet_reader.read_txn(packet)
            command = packet_reader.read_cmd(packet)
            packet_id = packet_reader.read_pid(packet)

            self.log.debug(f"[{self.name}] command={command},txn={txn}")

            if command == "fsys":
                fsys.handle(self, txn=txn)
            elif command == "acct":
                acct.handle(self, txn=txn)
            elif command == "rank":
                rank.handle(self, txn=txn, data=packet)
            elif command == "pnow":
                pnow.handle(self, txn=txn, data=packet)
            elif len(command.split()) > 0:
                rank.handle(self, txn=txn, data=packet)
            else:
                self.log.warning(
                    f"[{self.name}] Unknown command+txn received, how do I handle this?! command={command},txn={txn}"
                )
Пример #2
0
    def dataReceived(self, data):
        packets = data_util.read_data(data)

        for packet in packets:

            txn = packet_reader.read_txn(packet)
            command = packet_reader.read_cmd(packet)
            packet_id = packet_reader.read_pid(packet)

            self.log.debug(f"[{self.name}] command={command}")

            if command == "CONN":
                conn.handle(self, data=packet)
            elif command == "USER":
                user.handle(self, data=packet)
            elif command == "CGAM":
                CGAM.handle(self, data=packet)
            elif command == "UBRA":
                UBRA.handle(self, data=packet)
            elif command == "UGAM":
                UGAM.handle(self, data=packet)
            else:
                self.log.warning(
                    f"[{self.name}] Unknown command+txn received, how do I handle this?! command={command},txn={txn}"
                )
Пример #3
0
    def datagramReceived(self, data, addr):
        command = packet_reader.read_cmd(data)
        self.log.debug(f"[{self.name}] command={command},ip={str(addr[0])}")

        if command == "ECHO":
            echo.handle(self, data, addr)
        else:
            self.log.warning(f"[{self.name}] Unknown command received, how do I handle this?! command={command}")
Пример #4
0
    def dataReceived(self, data):
        packets = data_util.read_data(data)

        for packet in packets:

            txn = packet_reader.read_txn(packet)
            command = packet_reader.read_cmd(packet)
            packet_id = packet_reader.read_pid(packet)

            self.log.debug(f"[{self.name}] command={command}")
Пример #5
0
def read_data(data):
    packets = []
    packets += data.split(b'\n\x00')
    packets = list(filter(lambda a: a != b'', packets))
    for packet in packets:
        packet += b'\n\x00'
        # Required workaround to handle a strange packet received after ACCT NuLoginPersona
        # where \n\x00 is found in the middle of the packet, making it hard to work with.
        if len(packet_reader.read_cmd(packet).split()) > 0:
            packet = b'rank\xc0\x00\x00\n\x00' + packet
    return packets
Пример #6
0
    def dataReceived(self, data):
        packets = data_util.read_data(data)

        for packet in packets:

            txn = packet_reader.read_txn(packet)
            command = packet_reader.read_cmd(packet)
            packet_id = packet_reader.read_pid(packet)

            if txn != "MemCheck":
                self.log.debug(f"[{self.name}] command={command},txn={txn}")

            if command == "fsys":
                fsys.handle(self, txn=txn)
            elif command == "acct":
                acct.handle(self, txn=txn)
            else:
                self.log.warning(
                    f"[{self.name}] Unknown command+txn received, how do I handle this?! command={command},txn={txn}"
                )
Пример #7
0
 def datagramReceived(self, data, addr):
     command = packet_reader.read_cmd(data)
     self.log.debug(f"[{self.name}] command={command},ip={str(addr[0])}")