本文整理汇总了Python中scapy.packet.Packet.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Packet.__init__方法的具体用法?Python Packet.__init__怎么用?Python Packet.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scapy.packet.Packet
的用法示例。
在下文中一共展示了Packet.__init__方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from scapy.packet import Packet [as 别名]
# 或者: from scapy.packet.Packet import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from scapy.packet import Packet [as 别名]
# 或者: from scapy.packet.Packet import __init__ [as 别名]
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)
示例3: __init__
# 需要导入模块: from scapy.packet import Packet [as 别名]
# 或者: from scapy.packet.Packet import __init__ [as 别名]
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)
示例4: __init__
# 需要导入模块: from scapy.packet import Packet [as 别名]
# 或者: from scapy.packet.Packet import __init__ [as 别名]
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)
示例5: __init__
# 需要导入模块: from scapy.packet import Packet [as 别名]
# 或者: from scapy.packet.Packet import __init__ [as 别名]
def __init__(self, _pkt=None, index=0, **kwargs):
self._restart_indentation(index)
Packet.__init__(self, _pkt, **kwargs)
示例6: __init__
# 需要导入模块: from scapy.packet import Packet [as 别名]
# 或者: from scapy.packet.Packet import __init__ [as 别名]
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