def __init__(self, max_length=MAX_DOT15D4_LENGTH - 11): #TODO: Check max value being used self.max_frame_len = max_length self.fields_desc = [ StrFixedLenField("load", "", length_from=self.get_load_length) ] Packet.__init__(self)
def __init__(self, *args, **fields): try: self.tls_ctx = fields["ctx"] del(fields["ctx"]) except KeyError: self.tls_ctx = None Packet.__init__(self, *args, **fields)
def __init__(self, _pkt="", post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields): try: setme = self.tls_session is None except Exception: setme = True if setme: if tls_session is None: self.tls_session = tlsSession() else: self.tls_session = tls_session self.rcs_snap_init = self.tls_session.rcs.snapshot() self.wcs_snap_init = self.tls_session.wcs.snapshot() Packet.__init__(self, _pkt=_pkt, post_transform=post_transform, _internal=_internal, _underlayer=_underlayer, **fields)
def __init__(self, *args, **kwargs): # type: (Any, Any) -> None self.tx_id = kwargs.pop("tx_id", None) # type: Optional[int] self.rx_id = kwargs.pop("rx_id", None) # type: Optional[int] self.ext_address = kwargs.pop("ext_address", None) # type: Optional[int] # noqa: E501 self.rx_ext_address = kwargs.pop("rx_ext_address", None) # type: Optional[int] # noqa: E501 Packet.__init__(self, *args, **kwargs) self.validate_fields()
def __init__(self, _pkt="", post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields): try: setme = self.tls_session is None except Exception: setme = True newses = False if setme: if tls_session is None: newses = True self.tls_session = tlsSession() else: self.tls_session = tls_session self.rcs_snap_init = self.tls_session.rcs.snapshot() self.wcs_snap_init = self.tls_session.wcs.snapshot() if isinstance(_underlayer, TCP): tcp = _underlayer self.tls_session.sport = tcp.sport self.tls_session.dport = tcp.dport try: self.tls_session.ipsrc = tcp.underlayer.src self.tls_session.ipdst = tcp.underlayer.dst except AttributeError: pass if conf.tls_session_enable: if newses: s = conf.tls_sessions.find(self.tls_session) if s: if s.dport == self.tls_session.dport: self.tls_session = s else: self.tls_session = s.mirror() else: conf.tls_sessions.add(self.tls_session) if self.tls_session.connection_end == "server": srk = conf.tls_sessions.server_rsa_key if not self.tls_session.server_rsa_key and \ srk: self.tls_session.server_rsa_key = srk Packet.__init__(self, _pkt=_pkt, post_transform=post_transform, _internal=_internal, _underlayer=_underlayer, **fields)
def __init__(self, *args, **fields): try: self.tls_ctx = fields["ctx"] del (fields["ctx"]) self.above_tls10 = self.tls_ctx.params.negotiated.version > TLSVersion.TLS_1_0 if self.explicit_iv_field not in self.fields_desc and self.above_tls10: self.fields_desc.append(self.explicit_iv_field) for field in self.decryptable_fields: if field not in self.fields_desc: self.fields_desc.append(field) except KeyError: self.tls_ctx = None Packet.__init__(self, *args, **fields)
def __init__(self, *args, **fields): try: self.tls_ctx = fields["ctx"] del(fields["ctx"]) self.above_tls10 = self.tls_ctx.params.negotiated.version > TLSVersion.TLS_1_0 if self.explicit_iv_field not in self.fields_desc and self.above_tls10: self.fields_desc.append(self.explicit_iv_field) for field in self.decryptable_fields: if field not in self.fields_desc: self.fields_desc.append(field) except KeyError: self.tls_ctx = None Packet.__init__(self, *args, **fields)
def __init__(self, pkt=b"", mtype=None, method=None, seqid=None, args=None, header=None): Packet.__init__(self, pkt) self.setfieldval('type', mtype) self.setfieldval('method', method) self.setfieldval('seqid', seqid) self.setfieldval('header', header) self.setfieldval('args', args) self.setfieldval('load', pkt) if args and not isinstance(args, ThriftStruct): raise ValueError('args must be a ThriftStruct instance') if header and not isinstance(header, ThriftStruct): raise ValueError('header must be a ThriftStruct instance')
def __init__(self, _pkt="", post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields): try: setme = self.tls_session is None except: setme = True if setme: if tls_session is None: self.tls_session = tlsSession() else: self.tls_session = tls_session self.rcs_snap_init = self.tls_session.rcs.snapshot() self.wcs_snap_init = self.tls_session.wcs.snapshot() Packet.__init__(self, _pkt=_pkt, post_transform=post_transform, _internal=_internal, _underlayer=_underlayer, **fields)
def __init__(self, *args, **kwargs): self.src = None self.dst = None self.exsrc = None self.exdst = None if "src" in kwargs: self.src = kwargs["src"] del kwargs["src"] if "dst" in kwargs: self.dst = kwargs["dst"] del kwargs["dst"] if "exsrc" in kwargs: self.exsrc = kwargs["exsrc"] del kwargs["exsrc"] if "exdst" in kwargs: self.exdst = kwargs["exdst"] del kwargs["exdst"] Packet.__init__(self, *args, **kwargs) self.validate_fields()
def __init__(self, _pkt="", post_transform=None, _internal=0, _underlayer=None, tls_session=None, **fields): try: setme = self.tls_session is None except: setme = True if setme: if tls_session is None: self.tls_session = tlsSession() else: self.tls_session = tls_session Packet.__init__(self, _pkt=_pkt, post_transform=post_transform, _internal=_internal, _underlayer=_underlayer, **fields)
def __init__(self, _pkt=None, _orig_s=None, _orig_p=None, *args, **kwargs): self._orig_s = _orig_s self._orig_p = _orig_p Packet.__init__(self, _pkt=_pkt, *args, **kwargs)
def __init__(self, _pkt=None, index=0, **kwargs): self._restart_indentation(index) Packet.__init__(self, _pkt, **kwargs)
def __init__(self, _pkt=None, offset=0, pkt_len=0, **kwargs): self.my_offset = offset self.pkt_len = pkt_len Packet.__init__(self, _pkt, **kwargs)
def __init__(self, *args, **kwargs): self.payload_cls = DEFAULT_DTO if "payload_cls" in kwargs: self.payload_cls = kwargs["payload_cls"] del kwargs["payload_cls"] Packet.__init__(self, *args, **kwargs)
def __init__(self, *args, **kwargs): Packet.__init__(self, *args, **kwargs) self.explicit = 1
def __init__(self, *args, **kwargs): Packet.__init__(self, *args, **kwargs) if self.fieldType is not None and not self.fieldLength and self.fieldType in NetflowV9TemplateFieldDefaultLengths: # noqa: E501 self.fieldLength = NetflowV9TemplateFieldDefaultLengths[self.fieldType] # noqa: E501
def __init__(self, *args, **kwargs): Packet.__init__(self, *args, **kwargs) if self.fieldType is not None and not self.fieldLength and self.fieldType in NetflowV9TemplateFieldDefaultLengths: # noqa: E501 self.fieldLength = NetflowV9TemplateFieldDefaultLengths[ self.fieldType] # noqa: E501