radiuslib.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:nav 作者: UNINETT 项目源码 文件源码
def lookup_ip_address(self, ip):
        """
        Perform a reverse DNS lookup for ip.

        Uses self.cache to speed up results when the same ip is
        lookup up several times during one session.

        :param ip: IP address to look up
        """

        if ip is None:
            return None
        if ip not in self.cache:
            try:
                self.cache[ip] = gethostbyaddr(ip)[0]
            except (herror, gaierror):
                # if lookup fails, return the input address
                self.cache[ip] = ip

        return self.cache[ip]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号