-
Notifications
You must be signed in to change notification settings - Fork 399
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 cmds/core/netstat #2976
Add cmds/core/netstat #2976
Conversation
28ca4ad
to
6e8b4f7
Compare
What socket types and address families should be supported? Socket types:
Address families:
@ChriMarMe evaluated the socket type usage as follows: unix tcp/udp ax25 ipx netrom Proposal: |
38f6fd7
to
4375dfa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is pretty amazing. See my one comment. You might put the info on what is done, and what is not done, in doc.go
I would be ready to approve as it is now if you want.
f26af0f
to
29d9aed
Compare
When implementing the So my takeaway is that routing cache was removed for IPv4/6 some time ago already and the For now I will skip the implementation of |
16e4b6d
to
e69dd3d
Compare
@ChriMarMe @jensdrenhaus Hi, srry for the delay! -- re. socket types and address family. I mostly agree with the assesment put by @jensdrenhaus , except we would like TCP/UDP included too. I think that is beneficial to include. So the requirements from my end are as follows. Socket types:
Address Family
|
In that case, how do we display routing cache ? -- and how do we different route from cache versus new lookup need happen ? I tried on my 6.6 kernel devbox, which has
|
Thanks for the clarification. I didnt mention TCP/UDP and IPv4/IPv6 because I assumed it as required already :)
Will have a look at it again. Prolly misunderstood some of the information. |
BTW: The output you have here is not route cache. It's IPv6 sockets listing. |
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
…formation regarding route cache printing for IPv4 and IPv6 Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
* now returns a string to the caller. Allows for more control where printing happens Change AddressFamily interface function PrintRoutes to RoutesFormatString * now returns a string to the caller. Allows for more control where printing happens Add ClearOutput function to AddressFamily interface and implement for IPv4/6 * Allows to reset the output string builder. Required for continuous printing Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
…ction as it should be done in the first place Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
* Implement flag struct and move parsing into main function * Add io.Writer to run function to have more control over output (important for tests) Signed-off-by: Christopher Meis <[email protected]>
Signed-off-by: Christopher Meis <[email protected]>
Do I miss anything? Anything I can do to speed up the process? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go. Maybe this is incomplete, but that can be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline, we will go with this version for now.
If we need squash this, after discussion, we prefer to keep commit hisotry in this PR to show the trajectory, otherwise, this PR is too large to understand.
Next steps,
Andrew / David integrate it, try it and share feedback on if there need anything else from Chris
Snapshot of status quo netstat implementation in u-root compared to net-tools/netstat
netstat has five main capabilities:
Status of implementation:
--tcp
,--udp
(for IPv4, IPv6)--all
(display all connections, default: connected)--verbose
,-v
(Provides errors for unsupported address families of the kernel)--wide
(don't truncate IP addresses)--extend
(display other/more information)--programs
(display PID/Program name for sockets)--timers
(display timers)--listening
(display listening server sockets)--continuous
(continuous listing)--cache
(display routing cache instead of FIB)--numeric
(don't resolve names)--numeric-host
(don't resolve host names)--numeric-user
(don't resolve user names)--numeric-port
(don't resolve port names)--symbolic
(resolve hardware names)raw
unix