当前位置: 首页>>代码示例>>Python>>正文


Python AS_resolver_riswhois._resolve_one方法代码示例

本文整理汇总了Python中scapy.as_resolvers.AS_resolver_riswhois._resolve_one方法的典型用法代码示例。如果您正苦于以下问题:Python AS_resolver_riswhois._resolve_one方法的具体用法?Python AS_resolver_riswhois._resolve_one怎么用?Python AS_resolver_riswhois._resolve_one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scapy.as_resolvers.AS_resolver_riswhois的用法示例。


在下文中一共展示了AS_resolver_riswhois._resolve_one方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _resolve_one

# 需要导入模块: from scapy.as_resolvers import AS_resolver_riswhois [as 别名]
# 或者: from scapy.as_resolvers.AS_resolver_riswhois import _resolve_one [as 别名]
def _resolve_one(self, ip):
        """
        overloaded version to provide a Whois resolution on the
        embedded IPv4 address if the address is 6to4 or Teredo. 
        Otherwise, the native IPv6 address is passed.
        """

        if in6_isaddr6to4(ip): # for 6to4, use embedded @
            tmp = inet_pton(socket.AF_INET6, ip)
            addr = inet_ntop(socket.AF_INET, tmp[2:6])
        elif in6_isaddrTeredo(ip): # for Teredo, use mapped address
            addr = teredoAddrExtractInfo(ip)[2]
        else:
            addr = ip
        
        _, asn, desc = AS_resolver_riswhois._resolve_one(self, addr)

        return ip,asn,desc 
开发者ID:medbenali,项目名称:CyberScan,代码行数:20,代码来源:inet6.py

示例2: _resolve_one

# 需要导入模块: from scapy.as_resolvers import AS_resolver_riswhois [as 别名]
# 或者: from scapy.as_resolvers.AS_resolver_riswhois import _resolve_one [as 别名]
def _resolve_one(self, ip):
        """
        overloaded version to provide a Whois resolution on the
        embedded IPv4 address if the address is 6to4 or Teredo.
        Otherwise, the native IPv6 address is passed.
        """

        if in6_isaddr6to4(ip):  # for 6to4, use embedded @
            tmp = inet_pton(socket.AF_INET6, ip)
            addr = inet_ntop(socket.AF_INET, tmp[2:6])
        elif in6_isaddrTeredo(ip):  # for Teredo, use mapped address
            addr = teredoAddrExtractInfo(ip)[2]
        else:
            addr = ip

        _, asn, desc = AS_resolver_riswhois._resolve_one(self, addr)

        if asn.startswith("AS"):
            try:
                asn = int(asn[2:])
            except ValueError:
                pass

        return ip, asn, desc 
开发者ID:secdev,项目名称:scapy,代码行数:26,代码来源:inet6.py


注:本文中的scapy.as_resolvers.AS_resolver_riswhois._resolve_one方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。