摘要: 这两天在测试IPV6与DNS,晚上查了下资料,写了个DNS客户端,其中请求消息编码部分参考网上实例。 刚完成了编码,功能还没有测试。1、代码:#!/usr/bin/env python# -*- coding: utf-8 -*-import ConfigParserimport socketimport time import stringimport osimport reimport structdef dns_codec(hostname): ''' Function:请求消息编码 Input:hostname:主机名,如www.baidu.com Out... 阅读全文
posted @ 2012-12-15 00:33 Socrates 阅读(3156) 评论(0) 推荐(0) 编辑