ping.py 文件源码

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

项目:Theseus 作者: Dylan-halls 项目源码 文件源码
def __init__(self, interface):
        global s, sent, rev
        sent = 0
        rev = 0
        super(Arp_Ping, self).__init__()
        s = socket.socket(socket.PF_PACKET, socket.SOCK_RAW, socket.ntohs(0x0800))
        try:
            s.bind((interface, socket.htons(0x0800)))
        except socket.error:
            print("\033[1;31mUnable to bind to interface... unknown type\033[00m")
            exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号