Exemple #1
0
    def __init__(self, name=None):
        self.id = uuid.uuid4()
        self.name = name
        self.description = ""

        self.__fields = TypedList(AbstractField)
        self.__parent = None

        self.__encodingFunctions = SortedTypedList(EncodingFunction)
        self.__visualizationFunctions = TypedList(VisualizationFunction)
        self.__transformationFunctions = TypedList(TransformationFunction)

        self._variable = None
Exemple #2
0
    def __init__(self,
                 messages=None,
                 _id=None,
                 applicativeData=None,
                 name="Session"):
        """
        :parameter messages: the messages exchanged in the current session
        :type data: a list of :class:`netzob.Model.Vocabulary.Messages.AbstractMessage.AbstractMessage`
        :parameter _id: the unique identifier of the session
        :type _id: :class:`uuid.UUID`
        :keyword applicativeData: a list of :class:`netzob.Model.Vocabulary.ApplicaticeData.ApplicativeData`
        """
        self.__messages = SortedTypedList(AbstractMessage)
        self.__applicativeData = TypedList(ApplicativeData)

        if messages is None:
            messages = []
        self.messages = messages
        if _id is None:
            _id = uuid.uuid4()
        self.id = _id
        if applicativeData is None:
            applicativeData = []
        self.applicativeData = applicativeData
        self.name = name
 def __init__(self, data, _id=None, session=None, date=None, source=None, destination=None):
     """
     :parameter data: the content of the message
     :type data: a :class:`object`
     :parameter _id: the unique identifier of the message
     :type _id: :class:`uuid.UUID`
     :keyword session: the session in which the message was captures
     :type session: :class:`netzob.Model.Vocabulary.Session.Session`
     :parameter date: the timestamp of the message
     :type date: a :class:`int`
     :parameter source: the optional source address of the message
     :type source: a :class:`str`
     :parameter destination: the optional destination address of the message
     :type destination: a :class:`str`
     """
     if data is None:
         data = ''
     self.data = data
     self.session = session
     if _id is None:
         _id = uuid.uuid4()
     self.id = _id
     if date is None:
         date = time.mktime(time.gmtime())
     self.__date = date
     self.__source = source
     self.__destination = destination
     self.__visualizationFunctions = TypedList(VisualizationFunction)
     self.__metadata = OrderedDict()
     self.__semanticTags = OrderedDict()
Exemple #4
0
 def __init__(self, fields=None, messages=None, name="Symbol", meta=False):
     """
     :keyword fields: the fields which participate in symbol definition
     :type fields: a :class:`list` of :class:`netzob.Model.Vocabulary.Field`
     :keyword messages: the message that represent the symbol
     :type messages: a :class:`list` of :class:`netzob.Model.Vocabulary.Messages.AbstractMessage.AbstractMessage`
     :keyword name: the name of the symbol
     :type name: :class:`str`
     """
     super(Symbol, self).__init__(name, meta)
     self.__messages = TypedList(AbstractMessage)
     if messages is None:
         messages = []
     self.messages = messages
     if fields is None:
         # create a default empty field
         fields = [Field()]
     self.fields = fields
Exemple #5
0
 def __init__(self, children):
     super(NetzobAlternativeRegex, self).__init__()
     self.__children = TypedList(NetzobRegex)
     self.children = children
Exemple #6
0
 def __init__(self, children):
     super(NetzobAggregateRegex, self).__init__()
     self.__children = TypedList(NetzobRegex)
     self.children = children