Package ifaceinfotools Documentation

Class Conn

this class provide a quick interface to read /proc/net/tcp and give the informations about the current connexion to host

https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt

__init__


def __init__(self, procfilename, protocole)

initialization method that inherit IfaceInfoTools class

conn


def conn(self)

(alias) same is connexion(self)

conn_by_status


def conn_by_status(self, connstatus)

get {tcp, udp} connexion with last_ack '09' {tcp, udp} status

connexion


def connexion(self)

return a list of all {tcp, udp} connexion

get_close_conn


def get_close_conn(self)

get {tcp, udp} connexion with close '07' {tcp, udp} status

get_close_wait_conn


def get_close_wait_conn(self)

get_closing_conn


def get_closing_conn(self)

get {tcp, udp} connexion with closing '0B' {tcp, udp} status

get_established_conn


def get_established_conn(self)

get {tcp, udp} connexion with established '01' {tcp, udp} status

get_fin_wait1_conn


def get_fin_wait1_conn(self)

get {tcp, udp} connexion with fin_wait1 '04' {tcp, udp} status

get_fin_wait2_conn


def get_fin_wait2_conn(self)

get {tcp, udp} connexion with fin_wait2 '05' {tcp, udp} status

get_last_ack_conn


def get_last_ack_conn(self)

get {tcp, udp} connexion with last_ack '09' {tcp, udp} status

get_listen_conn


def get_listen_conn(self)

get {tcp, udp} connexion with listen '0A' {tcp, udp} status

get_max_state_conn


def get_max_state_conn(self)

get {tcp, udp} connexion with max_state '0C' {tcp, udp} status

get_syn_recv_conn


def get_syn_recv_conn(self)

get {tcp, udp} connexion with recv '03' {tcp, udp} status

get_syn_sent_conn


def get_syn_sent_conn(self)

get {tcp, udp} connexion with syn_sent '02' {tcp, udp} status

get_time_wait_conn


def get_time_wait_conn(self)

get {tcp, udp} connexion with time_wait '06' {tcp, udp} status

hex2ip


def hex2ip(self, x_addr)

private methode convert hexadecimal representation to string decimal ip address return string (as ip address representation)

ip2hex


def ip2hex(self, addr)

private methode convert string decimal ip address to hexadecimal representation return string (as hex representation)

ip_address


def ip_address(self, ifacename)

private methode get ip address of interface using socket interface

local_addrs


def local_addrs(self)

get dict of local address and ports list { 'local_host_ip': [list of ports] }

local_ports


def local_ports(self)

get list of ports used by local host [listen, established, ...]

network_address


def network_address(self, ipaddr, mask)

private methode used to calculate the network address

network_mask


def network_mask(self, ifacename)

private methode get net mask address of interface using socket interface

read_file_as_table


def read_file_as_table(self, filename)

private method that read given file completly and return it as list of lines

remote_addrs


def remote_addrs(self)

get dict of remote address and ports list { 'remote_host_ip': [list of ports], }

remote_ports


def remote_ports(self)

get list of ports used by remote host

reverse_ip


def reverse_ip(self, ipaddress)

Private method that reverse ip address

Class FileReader

None

read_file_as_table


def read_file_as_table(self, filename)

private method that read given file completly and return it as list of lines

Class IfaceInfoTools

None

__init__


def __init__(self)

hex2ip


def hex2ip(self, x_addr)

private methode convert hexadecimal representation to string decimal ip address return string (as ip address representation)

ip2hex


def ip2hex(self, addr)

private methode convert string decimal ip address to hexadecimal representation return string (as hex representation)

ip_address


def ip_address(self, ifacename)

private methode get ip address of interface using socket interface

network_address


def network_address(self, ipaddr, mask)

private methode used to calculate the network address

network_mask


def network_mask(self, ifacename)

private methode get net mask address of interface using socket interface

reverse_ip


def reverse_ip(self, ipaddress)

Private method that reverse ip address