James Hulka
2015-01-13 18:30:29 UTC
In looking for faster way to retrieve information about open sockets on
a system I stumbled across python-inet_diag.
The library is very useful however it was missing the query / filter
code found in socketstat (Alexey Kuznetsov) which it seems to be based on.
I would like to propose the following patches to implement source and
destination IP and port filters for the inet_diag.create function.
Best Regards,
James Hulka
socketstat_filter.patch :
inet_diag.c: added filter building code from socketstat (Alexey
Kuznetsov, <***@ms2.inr.ac.ru>)
added filter options to create function
added create function documentation
diag_filter.h: new header file
added various filter condition constants
added diag_filter structure
process_info.patch :
inet_diag.c: added process info parsing from socketstat (Alexey
Kuznetsov, <***@ms2.inr.ac.ru>)
req_v2.patch :
inet_diag.c: using req_v2 and specifying protocol type in header
retreiving full process path
return proc as struct
leak_fixes.patch :
inet_diag.c: cleanup memory leaks and reformat
memory cleanup user_ent_hash
inet_diag_copy.h: unused removed
listening_states.patch :
inet_diag.c: added listening states constant
added process, pid and fd getter functions
cleanup memory leaks and reformat
memory cleanup user_ent_hash
a system I stumbled across python-inet_diag.
The library is very useful however it was missing the query / filter
code found in socketstat (Alexey Kuznetsov) which it seems to be based on.
I would like to propose the following patches to implement source and
destination IP and port filters for the inet_diag.create function.
Best Regards,
James Hulka
socketstat_filter.patch :
inet_diag.c: added filter building code from socketstat (Alexey
Kuznetsov, <***@ms2.inr.ac.ru>)
added filter options to create function
added create function documentation
diag_filter.h: new header file
added various filter condition constants
added diag_filter structure
process_info.patch :
inet_diag.c: added process info parsing from socketstat (Alexey
Kuznetsov, <***@ms2.inr.ac.ru>)
req_v2.patch :
inet_diag.c: using req_v2 and specifying protocol type in header
retreiving full process path
return proc as struct
leak_fixes.patch :
inet_diag.c: cleanup memory leaks and reformat
memory cleanup user_ent_hash
inet_diag_copy.h: unused removed
listening_states.patch :
inet_diag.c: added listening states constant
added process, pid and fd getter functions
cleanup memory leaks and reformat
memory cleanup user_ent_hash