svinota / pyroute2

Python Netlink and PF_ROUTE library — network configuration and monitoring
https://pyroute2.org/
Other
932 stars 243 forks source link

NETLINK_SOCK_DIAG support? #291

Open est opened 7 years ago

est commented 7 years ago

I wanna use this library to build my own ss command utility from iproute2 suite.

Is it possible to include NETLINK_SOCK_DIAG in pyroute2?

Thanks!

est commented 7 years ago

btw

http://www.spinics.net/lists/linux-man/msg10393.html

As NETLINK_INET_DIAG should not longer be used, NETLINK_SOCK_DIAG should be written instead.

Should we update pyroute2/netlink/__init__.py definitions?

svinota commented 7 years ago

Yes, I hope it is possible :) Right now I'm a bit busy porting the compat code to the master branch, so almost all the tickets are on «hold», but I hope to finish the porting this weekend, so we'll see.

svinota commented 7 years ago

Yep, it is possible. Give me some time to make a proof-of-concept, I hope it'll be ready the next week.

svinota commented 7 years ago

The initial commit. I managed to get the AF_UNIX socket info response (see comments in the code). More functions will follow the next week, but you can already start to play with the module.

svinota commented 7 years ago

get_sock_stats() is working (but only unix_diag_req/unix_diag_msg are implemented yet)

You're welcome to try it out. Tcp diag structures will follow soon — as I said, the next week.

ghost commented 3 years ago

Can I assign good friends to handle this

DavidAntliff commented 1 year ago

Tcp diag structures will follow soon — as I said, the next week.

Just curious - did tcp_diag support via NETLINK_SOCK_DIAG get into pyroute2 in the end?

svinota commented 1 year ago

@DavidAntliff you can take a quick look at the current status here: https://github.com/svinota/pyroute2/blob/master/pyroute2/netlink/diag/__init__.py

DavidAntliff commented 1 year ago

@svinota that looks promising - thank you.