def encodeHostBlock(self, hostlist):
result = ""
try:
i = 0
while (i < 32):
if (i == 0 or i > len(hostlist)):
address = "127.0.0.1"
else:
address = hostlist[i-1]
a,b,c,d = map(string.atoi, string.split(address, '.'))
result += struct.pack("BBBB", a, b, c, d)
i += 1
except Exception as e:
pass
return result
# Take a 128 byte host block and turns it back into an array
hostlist.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录