def packet_socket():
'''
Function to return a list of pids and process names utilizing packet sockets.
'''
packetcontent = _packetload()
packetresult = []
for line in packetcontent:
line_array = _remove_empty(line.split(' '))
inode = line_array[8].rstrip()
pid = _get_pid_of_inode(inode)
try:
exe = os.readlink('/proc/' + pid + '/exe')
except BaseException:
exe = None
nline = [pid, exe]
packetresult.append(nline)
return packetresult
评论列表
文章目录