Exemple #1
0
    def dataReceived(self, data):
        packets_data = self.assembler.feed(data)
        for packet_data in packets_data:
            message = self.deserialize(packet_data)

            call_id = get_effective_call_id(message)
            self.maybeAddReplacement(call_id, self.unresolved_call_ids,
                                     self.new_call_ids_replaced,
                                     self.call_replacements)

            party_id = get_party_id(message)
            self.maybeAddReplacement(party_id, self.unresolved_party_ids,
                                     self.new_party_ids_replaced,
                                     self.party_replacements)

            self.logMessage(message, 'receive')

            if self.factory.inject:
                addr_to_inject = self.factory.srcaddr
                framed_data = sccpclientprotocol.to_frame(
                    packet_data,
                    sccpclientprotocol.SCCPClientProtocol.structFormat)
                if self.factory.debug:
                    injection = addr_to_inject, framed_data, message
                    injections.append(injection)
                else:
                    inject(addr_to_inject, framed_data)
Exemple #2
0
def run(filter=None, dry_run=False):
    engine = create_engine(replay.DB_URL)
    metadata = MetaData(engine)

    tbl_packets = Table('messages', metadata, *model.messages_columns)
    tbl_session_counter = Table('session_counter', metadata, *model.session_counter_columns)

    packets = replay.get_packets(tbl_packets, filter)

    for packet in packets:
        packet_data = packet['data']
        framed_data = sccpclientprotocol.to_frame(packet_data, sccpclientprotocol.SCCPClientProtocol.structFormat)
        if dry_run:
            print packet
        else:
            replay.inject(packet['dstaddr'], framed_data)
Exemple #3
0
def run(filter=None, dry_run=False):
    engine = create_engine(replay.DB_URL)
    metadata = MetaData(engine)

    tbl_packets = Table('messages', metadata, *model.messages_columns)
    tbl_session_counter = Table('session_counter', metadata,
                                *model.session_counter_columns)

    packets = replay.get_packets(tbl_packets, filter)

    for packet in packets:
        packet_data = packet['data']
        framed_data = sccpclientprotocol.to_frame(
            packet_data, sccpclientprotocol.SCCPClientProtocol.structFormat)
        if dry_run:
            print packet
        else:
            replay.inject(packet['dstaddr'], framed_data)
Exemple #4
0
    def sendString(self, message_data):
        message = self.deserialize(message_data)
        self.logMessage(message, 'send')

        call_id = get_effective_call_id(message)
        party_id = get_party_id(message)

        if call_id is not None or party_id is not None:
            if call_id is not None:
                message.callId = self.call_replacements[message.callId]
            if party_id is not None:
                message.passThruPartyId = self.call_replacements[message.passThruPartyId]
            message_data_to_send = message.pack()
        else:
            message_data_to_send = message_data

        frame_to_send = sccpclientprotocol.to_frame(message_data_to_send, sccpclientprotocol.SCCPClientProtocol.structFormat)
        self.transport.write(frame_to_send)
Exemple #5
0
    def sendString(self, message_data):
        message = self.deserialize(message_data)
        self.logMessage(message, 'send')

        call_id = get_effective_call_id(message)
        party_id = get_party_id(message)

        if call_id is not None or party_id is not None:
            if call_id is not None:
                message.callId = self.call_replacements[message.callId]
            if party_id is not None:
                message.passThruPartyId = self.call_replacements[
                    message.passThruPartyId]
            message_data_to_send = message.pack()
        else:
            message_data_to_send = message_data

        frame_to_send = sccpclientprotocol.to_frame(
            message_data_to_send,
            sccpclientprotocol.SCCPClientProtocol.structFormat)
        self.transport.write(frame_to_send)
Exemple #6
0
    def dataReceived(self, data):
        packets_data = self.assembler.feed(data)
        for packet_data in packets_data:
            message = self.deserialize(packet_data)

            call_id = get_effective_call_id(message)
            self.maybeAddReplacement(call_id, self.unresolved_call_ids, self.new_call_ids_replaced, self.call_replacements)

            party_id = get_party_id(message)
            self.maybeAddReplacement(party_id, self.unresolved_party_ids, self.new_party_ids_replaced, self.party_replacements)

            self.logMessage(message, 'receive')

            if self.factory.inject:
                addr_to_inject = self.factory.srcaddr
                framed_data = sccpclientprotocol.to_frame(packet_data, sccpclientprotocol.SCCPClientProtocol.structFormat)
                if self.factory.debug:
                    injection = addr_to_inject, framed_data, message
                    injections.append(injection)
                else:
                    inject(addr_to_inject, framed_data)
Exemple #7
0
 def injectMsg(addr, message):
     from network import sccpclientprotocol
     framed = sccpclientprotocol.to_frame(message.pack())
     proxy_factory.inject(addr, framed)
Exemple #8
0
 def injectMsg(addr, message):
     from network import sccpclientprotocol
     framed = sccpclientprotocol.to_frame(message.pack())
     proxy_factory.inject(addr, framed)