示例#1
0
 def __init__(self, id, memory, protocol, bind_ip, bind_port, target_ip, target_port):
     AbstractChannel.__init__(self, id, False, False, memory, protocol, bind_ip, bind_port, target_ip, target_port)
     # create logger with the given configuration
     self.log = logging.getLogger(__name__)
     self.socket = None
     self.inputMessages = []
     self.outputMessages = []
示例#2
0
    def __init__(self, id, memory, protocol, bind_ip, bind_port, target_ip, target_port):
        AbstractChannel.__init__(self, id, True, False, memory, protocol, bind_ip, bind_port, target_ip, target_port)
        # create logger with the given configuration
        self.log = logging.getLogger(__name__)

        self.server = None
        self.instantiatedServers = []
        self.allowMultipleClients = True
示例#3
0
 def __init__(self, id, memory, protocol, bind_ip, bind_port, target_ip,
              target_port):
     AbstractChannel.__init__(self, id, False, False, memory, protocol,
                              bind_ip, bind_port, target_ip, target_port)
     # create logger with the given configuration
     self.log = logging.getLogger(__name__)
     self.socket = None
     self.inputMessages = []
     self.outputMessages = []
    def __init__(self, id, inputs, outputs, vocabulary, memory):
        AbstractChannel.__init__(self, id, False, False, memory, None, None, None, None, None)

        # create logger with the given configuration
        self.log = logging.getLogger('netzob.Common.MMSTD.Actors.SimpleCommunicationLayer.py')
        self.predefinedInputs = deque(inputs)
        self.predefinedOutputs = deque(outputs)
        self.inputMessages = []
        self.outputMessages = []
        self.vocabulary = vocabulary
        self.memory = memory
 def __init__(self, idActor, memory, protocol, request, bind_ip, bind_port, target_ip, target_port):
     AbstractChannel.__init__(self, idActor, True, True, memory, protocol, bind_ip, bind_port, target_ip, target_port)
     # create logger with the given configuration
     self.log = logging.getLogger('netzob.Common.MMSTD.Actors.Network.InstanciatedNetworkServer.py')
     self.inputMessages = []
     self.outputMessages = []
     self.protocol = protocol
     if self.protocol == "UDP":
         dataReceived = request[0].strip()
         self.socket = request[1]
     else:  # TCP
         self.socket = request
    def __init__(self, id, inputs, outputs, vocabulary, memory):
        AbstractChannel.__init__(self, id, False, False, memory, None, None,
                                 None, None, None)

        # create logger with the given configuration
        self.log = logging.getLogger(
            'netzob.Common.MMSTD.Actors.SimpleCommunicationLayer.py')
        self.predefinedInputs = deque(inputs)
        self.predefinedOutputs = deque(outputs)
        self.inputMessages = []
        self.outputMessages = []
        self.vocabulary = vocabulary
        self.memory = memory
示例#7
0
    def loadFromXML(xmlRoot, namespace, version, vocabulary):
        if version == "0.1":
            communicationChannel = None
            memory = Memory()

            if xmlRoot.find("{" + namespace + "}communicationChannel") is not None:
                communicationChannel = AbstractChannel.loadFromXML(xmlRoot.find("{" + namespace + "}communicationChannel"), namespace, version, memory)

            if memory is None or communicationChannel is None:
                logging.warn("An error occurred and prevented loading the abstraction layer from its XML definiton")
                return None

            return AbstractionLayer(communicationChannel, vocabulary, memory)

        return None
示例#8
0
    def loadFromXML(xmlRoot, namespace, version, vocabulary):
        if version == "0.1":
            communicationChannel = None
            memory = Memory()

            if xmlRoot.find("{" + namespace +
                            "}communicationChannel") is not None:
                communicationChannel = AbstractChannel.loadFromXML(
                    xmlRoot.find("{" + namespace + "}communicationChannel"),
                    namespace, version, memory)

            if memory is None or communicationChannel is None:
                logging.warn(
                    "An error occurred and prevented loading the abstraction layer from its XML definiton"
                )
                return None

            return AbstractionLayer(communicationChannel, vocabulary, memory)

        return None