Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add state of UDP connection and remote/foreign address #7

Open
patrickelectric opened this issue Jan 27, 2022 · 4 comments
Open

Add state of UDP connection and remote/foreign address #7

patrickelectric opened this issue Jan 27, 2022 · 4 comments

Comments

@patrickelectric
Copy link

As in netstat -u

@capveg-netdebug
Copy link

Aah - my #11 seems to be a dup of this. Are you still interested in this functionality? I may try to add it.

@patrickelectric
Copy link
Author

That would be a neat feature to have! That would help with https://github.com/patrickelectric/linux2rest

@capveg-netdebug
Copy link

capveg-netdebug commented Sep 2, 2023

I know how to add this for MacOs and Linux but oddly for windows, it's not clear. The main call at https://github.com/ohadravid/netstat2-rs/blob/master/src/integrations/windows/socket_table_extended.rs#L150 does not ever appear to return a remote IP + port, despite the fact that netstat on windows clearly returns that information:

C:\Windows\System32>netstat -a -p udp

Active Connections

  Proto  Local Address          Foreign Address        State
  UDP    0.0.0.0:123            *:*
  UDP    0.0.0.0:3702           *:*
  UDP    0.0.0.0:3702           *:*
  UDP    0.0.0.0:3702           *:*
  UDP    0.0.0.0:3702           *:*
  UDP    0.0.0.0:5050           *:*
  UDP    0.0.0.0:5353           *:*
  UDP    0.0.0.0:5353           *:*
  UDP    0.0.0.0:5353           *:*
  UDP    0.0.0.0:5355           *:*
  UDP    0.0.0.0:27036          *:*
  UDP    0.0.0.0:50127          0.0.0.94:443
  UDP    0.0.0.0:50949          *:*
  UDP    0.0.0.0:51213          *:*
  UDP    0.0.0.0:53689          0.0.0.95:443
  UDP    0.0.0.0:54675          *:*
  UDP    0.0.0.0:55262          *:*
  UDP    0.0.0.0:56871          0.0.32.3:443
  UDP    0.0.0.0:57128          0.0.0.95:443
  UDP    0.0.0.0:57659          0.0.0.2:443
  UDP    0.0.0.0:58755          0.0.0.103:443
  UDP    0.0.0.0:59343          0.0.0.100:443
  UDP    0.0.0.0:59534          *:*
  UDP    0.0.0.0:62222          *:*
  UDP    0.0.0.0:63202          0.0.0.95:443

Though some of the IPs appear odd (0.0.0.100!?). Anyone know what's going on here or where this info is coming from? Stackoverflow seems to have some erroneous data in it with respect to "No OS's track remote UDP state because UDP is connectionless", so my research has not found any reasonable answers.

[edit] Posted question to stackoverflow in search of wisdom:
https://stackoverflow.com/questions/77029015/remote-ips-in-netstat-for-udp-in-windows-where-to-get-them-and-why-are-they-w

@joaoantoniocardoso
Copy link

I might be wrong, but I'd think 0.0.0.100 as x.x.x.100 from some address with mask 255.255.255.0, like 192.168.0.100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants