Page MenuHomeFreeBSD

sockstat: improve output formatting
ClosedPublic

Authored by tuexen on Wed, Oct 8, 7:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 18, 1:44 AM
Unknown Object (File)
Mon, Oct 13, 1:54 AM
Unknown Object (File)
Mon, Oct 13, 1:54 AM
Unknown Object (File)
Mon, Oct 13, 1:54 AM
Unknown Object (File)
Sun, Oct 12, 2:07 PM
Unknown Object (File)
Fri, Oct 10, 1:54 PM
Unknown Object (File)
Fri, Oct 10, 9:59 AM
Unknown Object (File)
Thu, Oct 9, 8:21 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tuexen requested review of this revision.Wed, Oct 8, 7:26 PM

Could you please give an example of the before and after output?

Could you please give an example of the before and after output?

Sure. Here is the output without the fix:

tuexen@head:~/freebsd-src/usr.bin/sockstat % sockstat -Ptcp,sctp
USER   COMMAND     PID FD PROTO LOCAL ADDRESS         FOREIGN ADDRESS      
tuexen nc         1671  3 sctp4 127.0.0.1:10061       127.0.0.1:1234       ??     ??           ?? ?? 192.168.1.71:10061    ??                   
tuexen nc         1670  3 sctp4 127.0.0.1:1234        *:*                  
tuexen nc         1670  4 sctp4 127.0.0.1:1234        127.0.0.1:10061      ??     ??           ?? ?? ??                    192.168.1.71:10061   
tuexen sshd-sessi 1661  7 tcp4  192.168.1.71:22       192.168.1.195:56451  
root   sshd-sessi 1659  7 tcp4  192.168.1.71:22       192.168.1.195:56451  
tuexen sshd-sessi 1654  7 tcp4  192.168.1.71:22       192.168.1.195:56448  
root   sshd-sessi 1652  7 tcp4  192.168.1.71:22       192.168.1.195:56448  
tuexen sshd-sessi 1647  7 tcp4  192.168.1.71:22       192.168.1.195:56445  
root   sshd-sessi 1645  7 tcp4  192.168.1.71:22       192.168.1.195:56445  
root   sshd       1586  6 tcp6  *:22                  *:*                  
root   sshd       1586  7 tcp4  *:22                  *:*

Here is the output with the patch applied:

tuexen@head:~/freebsd-src/usr.bin/sockstat % sockstat -Ptcp,sctp
USER   COMMAND     PID FD PROTO LOCAL ADDRESS         FOREIGN ADDRESS      
tuexen nc         1671  3 sctp4 127.0.0.1:10061       127.0.0.1:1234       
??     ??           ?? ?? ??    192.168.1.71:10061    ??                   
tuexen nc         1670  3 sctp4 127.0.0.1:1234        *:*                  
tuexen nc         1670  4 sctp4 127.0.0.1:1234        127.0.0.1:10061      
??     ??           ?? ?? ??    ??                    192.168.1.71:10061   
tuexen sshd-sessi 1661  7 tcp4  192.168.1.71:22       192.168.1.195:56451  
root   sshd-sessi 1659  7 tcp4  192.168.1.71:22       192.168.1.195:56451  
tuexen sshd-sessi 1654  7 tcp4  192.168.1.71:22       192.168.1.195:56448  
root   sshd-sessi 1652  7 tcp4  192.168.1.71:22       192.168.1.195:56448  
tuexen sshd-sessi 1647  7 tcp4  192.168.1.71:22       192.168.1.195:56445  
root   sshd-sessi 1645  7 tcp4  192.168.1.71:22       192.168.1.195:56445  
root   sshd       1586  6 tcp6  *:22                  *:*                  
root   sshd       1586  7 tcp4  *:22                  *:*
This revision is now accepted and ready to land.Thu, Oct 9, 3:02 PM
This revision was automatically updated to reflect the committed changes.