networks.py 文件源码

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

项目:darkc0de-old-stuff 作者: tuwid 项目源码 文件源码
def _getNetworksNetstatProto(self, proto) :
        if(proto == "tcp") :
            current_list = self.networks_netstat.list_tcp
            argproto = "-t"
        elif(proto == "udp") :
            current_list = self.networks_netstat.list_udp
            argproto = "-u"

        i, o = os.popen2("/bin/netstat -an " + argproto)

        j = o.readline()
        j = o.readline()
        j = o.readline()
        while(j != ""):
            liste = j.split()
            if(proto == "tcp") :
                current_list.append([liste[3], liste[4], liste[5]])
            elif(proto == "udp") :
                current_list.append([liste[3], liste[4], None])

            j = o.readline()

        o.close()
        i.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号