resolve.py 文件源码

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

项目:dane-monitoring-plugins 作者: siccegge 项目源码 文件源码
def format_address(data, datatype):
    """Given a answer packet for an A or AAAA query, return the string
       representation of the address
    """
    if datatype == RR_TYPE_A:
        return '.'.join([str(a) for a in data])
    elif datatype == RR_TYPE_AAAA:
        data = list(struct.iter_unpack("!H", data))
        return ":".join(["%x" % a for a in data])
    else:
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号