Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143865422
D53252.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D53252.diff
View Options
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -83,7 +83,7 @@
const int);
#endif
#ifdef INET6
-static int udp_done, tcp_done, sdp_done;
+static int udp_done, udplite_done, tcp_done, sdp_done;
#endif /* INET6 */
static int
@@ -100,6 +100,9 @@
case IPPROTO_UDP:
mibvar = "net.inet.udp.pcblist";
break;
+ case IPPROTO_UDPLITE:
+ mibvar = "net.inet.udplite.pcblist";
+ break;
default:
mibvar = "net.inet.raw.pcblist";
break;
@@ -220,13 +223,20 @@
return;
else
udp_done = 1;
+#endif
+ break;
+ case IPPROTO_UDPLITE:
+#ifdef INET6
+ if (udplite_done != 0)
+ return;
+ else
+ udplite_done = 1;
#endif
break;
}
if (!pcblist_sysctl(proto, name, &buf))
return;
-
if (istcp && (cflag || Cflag)) {
fnamelen = strlen("Stack");
cnamelen = strlen("CC");
@@ -318,18 +328,18 @@
"Proto", "Listen", "Local Address");
else if (Tflag)
xo_emit((Aflag && !Wflag) ?
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%s}" :
+ "{T:/%-9.9s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%s}" :
((!Wflag || af1 == AF_INET) ?
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}" :
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-45.45s} {T:/%s}"),
+ "{T:/%-9.9s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}" :
+ "{T:/%-9.9s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-45.45s} {T:/%s}"),
"Proto", "Rexmit", "OOORcv", "0-win",
"Local Address", "Foreign Address");
else {
xo_emit((Aflag && !Wflag) ?
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%-18.18s}" :
+ "{T:/%-9.9s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%-18.18s}" :
((!Wflag || af1 == AF_INET) ?
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%-22.22s}" :
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-45.45s} {T:/%-45.45s}"),
+ "{T:/%-9.9s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%-22.22s}" :
+ "{T:/%-9.9s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-45.45s} {T:/%-45.45s}"),
"Proto", "Recv-Q", "Send-Q",
"Local Address", "Foreign Address");
if (!xflag && !Rflag)
@@ -382,9 +392,14 @@
vchar = ((inp->inp_vflag & INP_IPV4) != 0) ?
"4" : "";
if (istcp && (tp->t_flags & TF_TOE) != 0)
- xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", "toe", vchar);
- else
- xo_emit("{:protocol/%-3.3s%-2.2s/%s%s} ", name, vchar);
+ xo_emit("{:protocol/%-3.3s%-6.6s/%s%s} ", "toe", vchar);
+ else {
+ int len;
+
+ len = max (2, 9 - strlen(name));
+ xo_emit("{:protocol/%.7s%-*.*s/%s%s} ", name, len, len,
+ vchar);
+ }
if (Lflag) {
char buf1[33];
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -83,6 +83,8 @@
tcp_stats, NULL, "tcp", 1, IPPROTO_TCP },
{ -1 , N_UDPSTAT, 1, protopr,
udp_stats, NULL, "udp", 1, IPPROTO_UDP },
+ { -1, -1, 1, protopr,
+ NULL, NULL, "udplite", 1, IPPROTO_UDPLITE },
#ifdef SCTP
{ -1, N_SCTPSTAT, 1, sctp_protopr,
sctp_stats, NULL, "sctp", 1, IPPROTO_SCTP },
@@ -131,6 +133,8 @@
tcp_stats, NULL, "tcp", 1, IPPROTO_TCP },
{ -1 , N_UDPSTAT, 1, protopr,
udp_stats, NULL, "udp", 1, IPPROTO_UDP },
+ { -1, -1, 1, protopr,
+ NULL, NULL, "udplite", 1, IPPROTO_UDPLITE },
{ -1 , N_IP6STAT, 1, protopr,
ip6_stats, ip6_ifstats, "ip6", 1, IPPROTO_RAW },
{ -1 , N_ICMP6STAT, 1, protopr,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 2, 5:42 AM (21 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28410244
Default Alt Text
D53252.diff (3 KB)
Attached To
Mode
D53252: netstat: add support for UDP-Lite endpoints
Attached
Detach File
Event Timeline
Log In to Comment