本文整理汇总了Python中cybox.objects.address_object.Address.from_obj方法的典型用法代码示例。如果您正苦于以下问题:Python Address.from_obj方法的具体用法?Python Address.from_obj怎么用?Python Address.from_obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cybox.objects.address_object.Address
的用法示例。
在下文中一共展示了Address.from_obj方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_obj
# 需要导入模块: from cybox.objects.address_object import Address [as 别名]
# 或者: from cybox.objects.address_object.Address import from_obj [as 别名]
def from_obj(header_obj):
header = EmailHeader()
header.to = EmailRecipients.from_obj(header_obj.get_To())
header.cc = EmailRecipients.from_obj(header_obj.get_CC())
header.bcc = EmailRecipients.from_obj(header_obj.get_BCC())
header.from_ = Address.from_obj(header_obj.get_From())
header.subject = String.from_obj(header_obj.get_Subject())
header.in_reply_to = String.from_obj(header_obj.get_In_Reply_To())
header.date = DateTime.from_obj(header_obj.get_Date())
header.message_id = String.from_obj(header_obj.get_Message_ID())
header.sender = Address.from_obj(header_obj.get_Sender())
header.reply_to = Address.from_obj(header_obj.get_Reply_To())
header.errors_to = String.from_obj(header_obj.get_Errors_To())
return header
示例2: from_obj
# 需要导入模块: from cybox.objects.address_object import Address [as 别名]
# 或者: from cybox.objects.address_object.Address import from_obj [as 别名]
def from_obj(socket_address_obj):
if not socket_address_obj:
return None
socket_address_ = SocketAddress()
socket_address_.ip_address = Address.from_obj(socket_address_obj.get_IP_Address())
socket_address_.port = Port.from_obj(socket_address_obj.get_Port())
return socket_address_
示例3: from_obj
# 需要导入模块: from cybox.objects.address_object import Address [as 别名]
# 或者: from cybox.objects.address_object.Address import from_obj [as 别名]
def from_obj(contact_obj, contact=None):
if not contact_obj:
return None
if contact is None:
contact = WhoisContact()
contact.contact_type = contact_obj.get_contact_type()
contact.contact_id = String.from_obj(contact_obj.get_Contact_ID())
contact.name = String.from_obj(contact_obj.get_Name())
contact.email_address = Address.from_obj(contact_obj.get_Email_Address())
contact.phone_number = String.from_obj(contact_obj.get_Phone_Number())
contact.address = String.from_obj(contact_obj.get_Address())
return contact
示例4: from_obj
# 需要导入模块: from cybox.objects.address_object import Address [as 别名]
# 或者: from cybox.objects.address_object.Address import from_obj [as 别名]
def from_obj(dns_record_obj):
if not dns_record_obj:
return None
dns_record_ = DNSRecord()
dns_record_.description = StructuredText.from_obj(dns_record_obj.get_Description())
dns_record_.domain_name = URI.from_obj(dns_record_obj.get_Domain_Name())
dns_record_.ip_address = Address.from_obj(dns_record_obj.get_IP_Address())
dns_record_.address_class = String.from_obj(dns_record_obj.get_Address_Class())
dns_record_.entry_type = String.from_obj(dns_record_obj.get_Entry_Type())
dns_record_.record_name = String.from_obj(dns_record_obj.get_Record_Name())
dns_record_.record_type = String.from_obj(dns_record_obj.get_Record_Type())
dns_record_.ttl = Integer.from_obj(dns_record_obj.get_TTL())
dns_record_.flags = HexBinary.from_obj(dns_record_obj.get_Flags())
dns_record_.data_length = Integer.from_obj(dns_record_obj.get_Length())
dns_record_.record_data = dns_record_obj.get_Record_Data()
return dns_record_