summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Foster <tim.foster@joyent.com>2019-10-25 13:00:51 +0000
committerTim Foster <tim.foster@joyent.com>2019-10-25 14:03:36 +0000
commitf4b6c0de737058d0e1624e50536bcbe149b3206c (patch)
tree402b11d0a54882c7d5e7daffc1087fe620104f41
parent29de67cafe15bb9e2c61bd58e6183182a7735036 (diff)
parent7284664a1faa361af4ff33ba5435d43d3ee07bf2 (diff)
downloadillumos-joyent-merge-20191025T123815.tar.gz
[illumos-gate merge]merge-20191025T123815
commit 7284664a1faa361af4ff33ba5435d43d3ee07bf2 11816 iscsi initiator gets confused if attached before root file system mount commit 55908bd733fe029d49237b91c700655997242419 11843 update Intel microcode to 20190918 commit b9c9c3595312927fb362936529c5679117843b93 11826 Buffer overflow and memory leak in "libbsm" commit 78a2e113edb6fe0a0382b403b55d92e8f0bba78f 9531 Want netstat -u to show PIDs associated with sockets 11707 provide 64-bit libdhcpagent 11708 netstat should be smatch and CERRWARN clean Conflicts: usr/src/data/ucode/Makefile usr/src/data/ucode/README.ucode In addition, this change makes all of usr/src/data/ucode/intel and corresponding usr/src/data/ucode/Makefile[.links] match upstream, with corresponding manifest changes.
-rw-r--r--exception_lists/packaging2
-rw-r--r--manifest273
-rw-r--r--usr/src/Targetdirs6
-rw-r--r--usr/src/cmd/cmd-inet/common/compat.c6
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile19
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c2171
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c243
-rw-r--r--usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs5
-rw-r--r--usr/src/cmd/stat/common/statcommon.h8
-rw-r--r--usr/src/data/ucode/Makefile6
-rw-r--r--usr/src/data/ucode/Makefile.links383
-rw-r--r--usr/src/data/ucode/README.ucode10
-rw-r--r--usr/src/data/ucode/intel/00000F32-04bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F32-08bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F33-04bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F33-08bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F34-04bin7168 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F34-08bin7168 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F34-10bin7168 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F41-04bin5120 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F41-08bin5120 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F41-10bin5120 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F41-20bin5120 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F41-80bin5120 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F43-04bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F43-08bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F43-10bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F43-80bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F44-04bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F44-08bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F44-10bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F44-80bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F47-04bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F47-08bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F47-10bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F47-80bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F48-08bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F48-10bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F48-40bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F49-04bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F49-08bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F49-10bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F49-20bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F49-80bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F4A-08bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F4A-10bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F4A-40bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F64-10bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F64-20bin3072 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00000F68-20bin2048 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/0001067A-10bin8192 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/0001067A-40bin8192 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/0001067A-80bin8192 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000106A4-02bin14336 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000106A5-02bin12288 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000106E5-02bin9216 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000106E5-10bin9216 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00020652-10bin9216 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00020655-10bin4096 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00020655-80bin4096 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206A7-10bin12288 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206C2-02bin11264 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D6-01bin18432 -> 18432 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D6-04bin18432 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D6-08bin18432 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D6-20bin18432 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D6-40bin18432 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D7-01bin19456 -> 19456 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D7-04bin19456 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D7-08bin19456 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D7-20bin19456 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206D7-40bin19456 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000206F2-04bin14336 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00030678-02bin0 -> 52224 bytes
-rw-r--r--usr/src/data/ucode/intel/00030678-04bin0 -> 52224 bytes
-rw-r--r--usr/src/data/ucode/intel/00030679-01bin0 -> 52224 bytes
-rw-r--r--usr/src/data/ucode/intel/000306A9-10bin14336 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306C3-10bin23552 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306C3-20bin23552 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306D4-40bin19456 -> 19456 bytes
-rw-r--r--usr/src/data/ucode/intel/000306D4-80bin19456 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E4-04bin16384 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E4-08bin16384 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E4-20bin16384 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E4-40bin16384 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E4-80bin16384 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E6-04bin11264 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E6-08bin11264 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E6-20bin11264 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E6-40bin11264 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E6-80bin11264 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E7-04bin17408 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E7-08bin17408 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E7-20bin17408 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E7-40bin17408 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306E7-80bin17408 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306F2-02bin34816 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306F2-04bin34816 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306F2-08bin34816 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306F2-20bin34816 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306F2-40bin34816 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000306F4-80bin18432 -> 18432 bytes
-rw-r--r--usr/src/data/ucode/intel/00040651-10bin21504 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00040651-20bin21504 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00040651-40bin21504 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00040661-10bin25600 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00040661-20bin25600 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00040671-02bin14336 -> 14336 bytes
-rw-r--r--usr/src/data/ucode/intel/00040671-20bin14336 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406C3-01bin0 -> 69632 bytes
-rw-r--r--usr/src/data/ucode/intel/000406C4-01bin0 -> 68608 bytes
-rw-r--r--usr/src/data/ucode/intel/000406E3-80bin100352 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-01bin30720 -> 30720 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-02bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-04bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-08bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-20bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-40bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000406F1-80bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050653-01bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050653-02bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050653-04bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050653-10bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050653-80bin30720 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050654-01bin32768 -> 33792 bytes
-rw-r--r--usr/src/data/ucode/intel/00050654-02bin32768 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050654-04bin32768 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050654-10bin32768 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050654-20bin32768 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050654-80bin32768 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050655-01bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050655-02bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050655-04bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050655-10bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050655-20bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050655-80bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-01bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-02bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-04bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-08bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-10bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-20bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050656-80bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-01bin47104 -> 51200 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-02bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-04bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-08bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-10bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-20bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050657-80bin47104 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/00050662-10bin32768 -> 32768 bytes
-rw-r--r--usr/src/data/ucode/intel/00050663-10bin24576 -> 24576 bytes
-rw-r--r--usr/src/data/ucode/intel/00050664-10bin23552 -> 24576 bytes
-rw-r--r--usr/src/data/ucode/intel/00050665-10bin19456 -> 19456 bytes
-rw-r--r--usr/src/data/ucode/intel/000506C9-02bin17408 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000506CA-01bin15360 -> 15360 bytes
-rw-r--r--usr/src/data/ucode/intel/000506CA-02bin15360 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000506E3-04bin100352 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000506E3-10bin100352 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000506E3-20bin100352 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000806E9-80bin99328 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000806EA-80bin99328 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000806EB-40bin98304 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000806EB-80bin98304 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000806EC-10bin97280 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000806EC-80bin97280 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000906E9-08bin99328 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000906E9-20bin99328 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000906EA-20bin98304 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000906EC-20bin98304 -> 0 bytes
-rw-r--r--usr/src/data/ucode/intel/000906ED-20bin97280 -> 0 bytes
-rwxr-xr-xusr/src/data/ucode/update.intel95
-rw-r--r--usr/src/lib/README.Makefiles9
-rw-r--r--usr/src/lib/libbsm/common/au_preselect.c29
-rw-r--r--usr/src/lib/libdhcpagent/Makefile6
-rw-r--r--usr/src/lib/libdhcpagent/Makefile.com8
-rw-r--r--usr/src/lib/libdhcpagent/amd64/Makefile32
-rw-r--r--usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h17
-rw-r--r--usr/src/lib/libdhcpagent/i386/Makefile4
-rw-r--r--usr/src/lib/libdhcpagent/sparc/Makefile4
-rw-r--r--usr/src/man/man1m/netstat.1m177
-rw-r--r--usr/src/pkg/manifests/system-kernel-platform.mf653
-rw-r--r--usr/src/pkg/manifests/system-library.mf4
-rw-r--r--usr/src/uts/common/fs/sockfs/sockcommon.h21
-rw-r--r--usr/src/uts/common/fs/sockfs/sockcommon_sops.c22
-rw-r--r--usr/src/uts/common/fs/sockfs/socksubr.c100
-rw-r--r--usr/src/uts/common/fs/specfs/specvnops.c10
-rw-r--r--usr/src/uts/common/inet/ip/ipclassifier.c100
-rw-r--r--usr/src/uts/common/inet/ipclassifier.h30
-rw-r--r--usr/src/uts/common/inet/mib2.h61
-rw-r--r--usr/src/uts/common/inet/sctp/sctp_snmp.c33
-rw-r--r--usr/src/uts/common/inet/sockmods/socksctp.c27
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_stats.c132
-rw-r--r--usr/src/uts/common/inet/udp/udp_stats.c80
-rw-r--r--usr/src/uts/common/io/scsi/adapters/iscsi/iscsi.c511
-rw-r--r--usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_net.c13
-rw-r--r--usr/src/uts/common/io/scsi/adapters/iscsi/iscsid.c28
-rw-r--r--usr/src/uts/common/os/streamio.c5
-rw-r--r--usr/src/uts/common/sys/socket_proto.h3
-rw-r--r--usr/src/uts/common/sys/socketvar.h41
-rw-r--r--usr/src/uts/common/sys/strsubr.h15
201 files changed, 4027 insertions, 1375 deletions
diff --git a/exception_lists/packaging b/exception_lists/packaging
index e2f96e919e..101d735400 100644
--- a/exception_lists/packaging
+++ b/exception_lists/packaging
@@ -200,6 +200,7 @@ usr/include/sys/kmdb.h
# for customer use, so the files are excluded from packaging.
#
lib/libdhcpagent.so
+lib/amd64/libdhcpagent.so
lib/libdhcputil.so
lib/amd64/libdhcputil.so i386
lib/sparcv9/libdhcputil.so sparc
@@ -212,6 +213,7 @@ usr/include/dhcpagent_ipc.h
usr/include/dhcpagent_util.h
usr/include/dhcpmsg.h
usr/lib/libdhcpagent.so
+usr/lib/amd64/libdhcpagent.so
usr/lib/libdhcputil.so
usr/lib/amd64/libdhcputil.so i386
usr/lib/sparcv9/libdhcputil.so sparc
diff --git a/manifest b/manifest
index 66d5d46b6c..3f0ec0b297 100644
--- a/manifest
+++ b/manifest
@@ -2087,62 +2087,24 @@ f platform/i86pc/ucode/GenuineIntel/00000F29-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F29-04 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F29-08 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F32-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F32-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F32-08 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F33-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F33-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F33-08 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F34-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F34-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F34-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F34-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F41-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F41-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F41-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F41-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F41-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F41-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F41-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F43-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F43-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F43-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F43-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F43-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F44-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F44-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F44-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F44-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F44-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F47-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F47-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F47-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F47-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F47-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F48-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F48-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F48-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F48-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F48-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F48-40 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F49-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F49-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F49-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F49-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F49-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F49-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F4A-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F4A-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F4A-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F4A-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F4A-40 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F62-04 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F64-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F64-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F64-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F64-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F65-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00000F68-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00000F68-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00001632-00 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00010661-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00010661-02 0444 root sys
@@ -2155,14 +2117,9 @@ f platform/i86pc/ucode/GenuineIntel/00010676-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00010677-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/0001067A-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/0001067A-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/0001067A-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/0001067A-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/0001067A-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/0001067A-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106A4-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000106A4-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106A5-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000106A5-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106C2-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106C2-04 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106C2-08 0444 root sys
@@ -2172,149 +2129,183 @@ f platform/i86pc/ucode/GenuineIntel/000106CA-08 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106CA-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106D1-08 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000106E5-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000106E5-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000106E5-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00020652-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00020652-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00020655-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00020655-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00020655-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00020661-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00020661-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000206A7-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206A7-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000206C2-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206C2-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000206D6-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D6-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D6-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D6-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D6-40 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000206D7-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D7-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D7-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D7-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206D7-40 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000206E6-04 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000206F2-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000206F2-04 0444 root sys
+f platform/i86pc/ucode/GenuineIntel/00030678-02 0444 root sys
+f platform/i86pc/ucode/GenuineIntel/00030678-04 0444 root sys
+f platform/i86pc/ucode/GenuineIntel/00030679-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306A9-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306A9-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306C3-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306C3-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306C3-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306D4-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306D4-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306E4-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E4-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E4-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E4-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E4-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E4-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306E6-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E6-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E6-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E6-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E6-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E6-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306E7-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E7-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E7-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E7-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E7-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306E7-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306F2-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306F2-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306F2-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306F2-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306F2-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000306F2-40 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000306F4-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00040651-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00040651-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00040651-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00040651-40 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00040661-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00040661-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00040661-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00040671-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00040671-20 0444 root sys
+f platform/i86pc/ucode/GenuineIntel/000406C3-01 0444 root sys
+f platform/i86pc/ucode/GenuineIntel/000406C4-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000406E3-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406E3-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000406F1-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406F1-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406F1-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406F1-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406F1-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406F1-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000406F1-80 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050653-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050653-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050653-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050653-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050653-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00050654-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050654-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050654-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050654-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050654-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050654-80 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050655-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050655-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050655-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050655-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050655-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050655-80 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050656-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00050657-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050657-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050657-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050657-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050657-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050657-20 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/00050657-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00050662-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00050663-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00050664-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/00050665-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000506C2-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000506C9-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000506C9-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000506CA-01 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000506CA-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000506E3-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000506E3-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000506E3-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000506E3-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000506F1-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000706A1-01 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000806E9-10 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000806E9-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000806E9-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000806EA-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000806EA-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000806EB-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000806EB-40 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000806EB-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000806EC-04 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000806EC-10 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000806EC-80 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000906E9-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000906E9-08 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000906E9-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000906EA-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000906EA-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000906EB-02 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000906EC-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000906EC-20 0444 root sys
f platform/i86pc/ucode/GenuineIntel/000906ED-02 0444 root sys
-f platform/i86pc/ucode/GenuineIntel/000906ED-20 0444 root sys
+h platform/i86pc/ucode/GenuineIntel/00000F32-04=platform/i86pc/ucode/GenuineIntel/00000F32-01
+h platform/i86pc/ucode/GenuineIntel/00000F32-08=platform/i86pc/ucode/GenuineIntel/00000F32-01
+h platform/i86pc/ucode/GenuineIntel/00000F33-04=platform/i86pc/ucode/GenuineIntel/00000F33-01
+h platform/i86pc/ucode/GenuineIntel/00000F33-08=platform/i86pc/ucode/GenuineIntel/00000F33-01
+h platform/i86pc/ucode/GenuineIntel/00000F34-04=platform/i86pc/ucode/GenuineIntel/00000F34-01
+h platform/i86pc/ucode/GenuineIntel/00000F34-08=platform/i86pc/ucode/GenuineIntel/00000F34-01
+h platform/i86pc/ucode/GenuineIntel/00000F34-10=platform/i86pc/ucode/GenuineIntel/00000F34-01
+h platform/i86pc/ucode/GenuineIntel/00000F41-04=platform/i86pc/ucode/GenuineIntel/00000F41-01
+h platform/i86pc/ucode/GenuineIntel/00000F41-08=platform/i86pc/ucode/GenuineIntel/00000F41-01
+h platform/i86pc/ucode/GenuineIntel/00000F41-10=platform/i86pc/ucode/GenuineIntel/00000F41-01
+h platform/i86pc/ucode/GenuineIntel/00000F41-20=platform/i86pc/ucode/GenuineIntel/00000F41-01
+h platform/i86pc/ucode/GenuineIntel/00000F41-80=platform/i86pc/ucode/GenuineIntel/00000F41-01
+h platform/i86pc/ucode/GenuineIntel/00000F43-04=platform/i86pc/ucode/GenuineIntel/00000F43-01
+h platform/i86pc/ucode/GenuineIntel/00000F43-08=platform/i86pc/ucode/GenuineIntel/00000F43-01
+h platform/i86pc/ucode/GenuineIntel/00000F43-10=platform/i86pc/ucode/GenuineIntel/00000F43-01
+h platform/i86pc/ucode/GenuineIntel/00000F43-80=platform/i86pc/ucode/GenuineIntel/00000F43-01
+h platform/i86pc/ucode/GenuineIntel/00000F44-04=platform/i86pc/ucode/GenuineIntel/00000F44-01
+h platform/i86pc/ucode/GenuineIntel/00000F44-08=platform/i86pc/ucode/GenuineIntel/00000F44-01
+h platform/i86pc/ucode/GenuineIntel/00000F44-10=platform/i86pc/ucode/GenuineIntel/00000F44-01
+h platform/i86pc/ucode/GenuineIntel/00000F44-80=platform/i86pc/ucode/GenuineIntel/00000F44-01
+h platform/i86pc/ucode/GenuineIntel/00000F47-04=platform/i86pc/ucode/GenuineIntel/00000F47-01
+h platform/i86pc/ucode/GenuineIntel/00000F47-08=platform/i86pc/ucode/GenuineIntel/00000F47-01
+h platform/i86pc/ucode/GenuineIntel/00000F47-10=platform/i86pc/ucode/GenuineIntel/00000F47-01
+h platform/i86pc/ucode/GenuineIntel/00000F47-80=platform/i86pc/ucode/GenuineIntel/00000F47-01
+h platform/i86pc/ucode/GenuineIntel/00000F48-08=platform/i86pc/ucode/GenuineIntel/00000F48-04
+h platform/i86pc/ucode/GenuineIntel/00000F48-10=platform/i86pc/ucode/GenuineIntel/00000F48-04
+h platform/i86pc/ucode/GenuineIntel/00000F48-40=platform/i86pc/ucode/GenuineIntel/00000F48-04
+h platform/i86pc/ucode/GenuineIntel/00000F49-04=platform/i86pc/ucode/GenuineIntel/00000F49-01
+h platform/i86pc/ucode/GenuineIntel/00000F49-08=platform/i86pc/ucode/GenuineIntel/00000F49-01
+h platform/i86pc/ucode/GenuineIntel/00000F49-10=platform/i86pc/ucode/GenuineIntel/00000F49-01
+h platform/i86pc/ucode/GenuineIntel/00000F49-20=platform/i86pc/ucode/GenuineIntel/00000F49-01
+h platform/i86pc/ucode/GenuineIntel/00000F49-80=platform/i86pc/ucode/GenuineIntel/00000F49-01
+h platform/i86pc/ucode/GenuineIntel/00000F4A-08=platform/i86pc/ucode/GenuineIntel/00000F4A-04
+h platform/i86pc/ucode/GenuineIntel/00000F4A-10=platform/i86pc/ucode/GenuineIntel/00000F4A-04
+h platform/i86pc/ucode/GenuineIntel/00000F4A-40=platform/i86pc/ucode/GenuineIntel/00000F4A-04
+h platform/i86pc/ucode/GenuineIntel/00000F64-10=platform/i86pc/ucode/GenuineIntel/00000F64-04
+h platform/i86pc/ucode/GenuineIntel/00000F64-20=platform/i86pc/ucode/GenuineIntel/00000F64-04
+h platform/i86pc/ucode/GenuineIntel/00000F68-20=platform/i86pc/ucode/GenuineIntel/00000F68-02
+h platform/i86pc/ucode/GenuineIntel/0001067A-10=platform/i86pc/ucode/GenuineIntel/0001067A-01
+h platform/i86pc/ucode/GenuineIntel/0001067A-40=platform/i86pc/ucode/GenuineIntel/0001067A-04
+h platform/i86pc/ucode/GenuineIntel/0001067A-80=platform/i86pc/ucode/GenuineIntel/0001067A-20
+h platform/i86pc/ucode/GenuineIntel/000106A4-02=platform/i86pc/ucode/GenuineIntel/000106A4-01
+h platform/i86pc/ucode/GenuineIntel/000106A5-02=platform/i86pc/ucode/GenuineIntel/000106A5-01
+h platform/i86pc/ucode/GenuineIntel/000106E5-02=platform/i86pc/ucode/GenuineIntel/000106E5-01
+h platform/i86pc/ucode/GenuineIntel/000106E5-10=platform/i86pc/ucode/GenuineIntel/000106E5-01
+h platform/i86pc/ucode/GenuineIntel/00020652-10=platform/i86pc/ucode/GenuineIntel/00020652-02
+h platform/i86pc/ucode/GenuineIntel/00020655-10=platform/i86pc/ucode/GenuineIntel/00020655-02
+h platform/i86pc/ucode/GenuineIntel/00020655-80=platform/i86pc/ucode/GenuineIntel/00020655-02
+h platform/i86pc/ucode/GenuineIntel/000206A7-10=platform/i86pc/ucode/GenuineIntel/000206A7-02
+h platform/i86pc/ucode/GenuineIntel/000206C2-02=platform/i86pc/ucode/GenuineIntel/000206C2-01
+h platform/i86pc/ucode/GenuineIntel/000206D6-04=platform/i86pc/ucode/GenuineIntel/000206D6-01
+h platform/i86pc/ucode/GenuineIntel/000206D6-08=platform/i86pc/ucode/GenuineIntel/000206D6-01
+h platform/i86pc/ucode/GenuineIntel/000206D6-20=platform/i86pc/ucode/GenuineIntel/000206D6-01
+h platform/i86pc/ucode/GenuineIntel/000206D6-40=platform/i86pc/ucode/GenuineIntel/000206D6-01
+h platform/i86pc/ucode/GenuineIntel/000206D7-04=platform/i86pc/ucode/GenuineIntel/000206D7-01
+h platform/i86pc/ucode/GenuineIntel/000206D7-08=platform/i86pc/ucode/GenuineIntel/000206D7-01
+h platform/i86pc/ucode/GenuineIntel/000206D7-20=platform/i86pc/ucode/GenuineIntel/000206D7-01
+h platform/i86pc/ucode/GenuineIntel/000206D7-40=platform/i86pc/ucode/GenuineIntel/000206D7-01
+h platform/i86pc/ucode/GenuineIntel/000206F2-04=platform/i86pc/ucode/GenuineIntel/000206F2-01
+h platform/i86pc/ucode/GenuineIntel/00030678-08=platform/i86pc/ucode/GenuineIntel/00030678-04
+h platform/i86pc/ucode/GenuineIntel/00030679-02=platform/i86pc/ucode/GenuineIntel/00030679-01
+h platform/i86pc/ucode/GenuineIntel/00030679-04=platform/i86pc/ucode/GenuineIntel/00030679-01
+h platform/i86pc/ucode/GenuineIntel/00030679-08=platform/i86pc/ucode/GenuineIntel/00030679-01
+h platform/i86pc/ucode/GenuineIntel/000306A9-10=platform/i86pc/ucode/GenuineIntel/000306A9-02
+h platform/i86pc/ucode/GenuineIntel/000306C3-10=platform/i86pc/ucode/GenuineIntel/000306C3-02
+h platform/i86pc/ucode/GenuineIntel/000306C3-20=platform/i86pc/ucode/GenuineIntel/000306C3-02
+h platform/i86pc/ucode/GenuineIntel/000306D4-80=platform/i86pc/ucode/GenuineIntel/000306D4-40
+h platform/i86pc/ucode/GenuineIntel/000306E4-04=platform/i86pc/ucode/GenuineIntel/000306E4-01
+h platform/i86pc/ucode/GenuineIntel/000306E4-08=platform/i86pc/ucode/GenuineIntel/000306E4-01
+h platform/i86pc/ucode/GenuineIntel/000306E4-20=platform/i86pc/ucode/GenuineIntel/000306E4-01
+h platform/i86pc/ucode/GenuineIntel/000306E4-40=platform/i86pc/ucode/GenuineIntel/000306E4-01
+h platform/i86pc/ucode/GenuineIntel/000306E4-80=platform/i86pc/ucode/GenuineIntel/000306E4-01
+h platform/i86pc/ucode/GenuineIntel/000306E6-04=platform/i86pc/ucode/GenuineIntel/000306E6-01
+h platform/i86pc/ucode/GenuineIntel/000306E6-08=platform/i86pc/ucode/GenuineIntel/000306E6-01
+h platform/i86pc/ucode/GenuineIntel/000306E6-20=platform/i86pc/ucode/GenuineIntel/000306E6-01
+h platform/i86pc/ucode/GenuineIntel/000306E6-40=platform/i86pc/ucode/GenuineIntel/000306E6-01
+h platform/i86pc/ucode/GenuineIntel/000306E6-80=platform/i86pc/ucode/GenuineIntel/000306E6-01
+h platform/i86pc/ucode/GenuineIntel/000306E7-04=platform/i86pc/ucode/GenuineIntel/000306E7-01
+h platform/i86pc/ucode/GenuineIntel/000306E7-08=platform/i86pc/ucode/GenuineIntel/000306E7-01
+h platform/i86pc/ucode/GenuineIntel/000306E7-20=platform/i86pc/ucode/GenuineIntel/000306E7-01
+h platform/i86pc/ucode/GenuineIntel/000306E7-40=platform/i86pc/ucode/GenuineIntel/000306E7-01
+h platform/i86pc/ucode/GenuineIntel/000306E7-80=platform/i86pc/ucode/GenuineIntel/000306E7-01
+h platform/i86pc/ucode/GenuineIntel/000306F2-02=platform/i86pc/ucode/GenuineIntel/000306F2-01
+h platform/i86pc/ucode/GenuineIntel/000306F2-04=platform/i86pc/ucode/GenuineIntel/000306F2-01
+h platform/i86pc/ucode/GenuineIntel/000306F2-08=platform/i86pc/ucode/GenuineIntel/000306F2-01
+h platform/i86pc/ucode/GenuineIntel/000306F2-20=platform/i86pc/ucode/GenuineIntel/000306F2-01
+h platform/i86pc/ucode/GenuineIntel/000306F2-40=platform/i86pc/ucode/GenuineIntel/000306F2-01
+h platform/i86pc/ucode/GenuineIntel/00040651-10=platform/i86pc/ucode/GenuineIntel/00040651-02
+h platform/i86pc/ucode/GenuineIntel/00040651-20=platform/i86pc/ucode/GenuineIntel/00040651-02
+h platform/i86pc/ucode/GenuineIntel/00040651-40=platform/i86pc/ucode/GenuineIntel/00040651-02
+h platform/i86pc/ucode/GenuineIntel/00040661-10=platform/i86pc/ucode/GenuineIntel/00040661-02
+h platform/i86pc/ucode/GenuineIntel/00040661-20=platform/i86pc/ucode/GenuineIntel/00040661-02
+h platform/i86pc/ucode/GenuineIntel/00040671-20=platform/i86pc/ucode/GenuineIntel/00040671-02
+h platform/i86pc/ucode/GenuineIntel/000406E3-80=platform/i86pc/ucode/GenuineIntel/000406E3-40
+h platform/i86pc/ucode/GenuineIntel/000406F1-02=platform/i86pc/ucode/GenuineIntel/000406F1-01
+h platform/i86pc/ucode/GenuineIntel/000406F1-04=platform/i86pc/ucode/GenuineIntel/000406F1-01
+h platform/i86pc/ucode/GenuineIntel/000406F1-08=platform/i86pc/ucode/GenuineIntel/000406F1-01
+h platform/i86pc/ucode/GenuineIntel/000406F1-20=platform/i86pc/ucode/GenuineIntel/000406F1-01
+h platform/i86pc/ucode/GenuineIntel/000406F1-40=platform/i86pc/ucode/GenuineIntel/000406F1-01
+h platform/i86pc/ucode/GenuineIntel/000406F1-80=platform/i86pc/ucode/GenuineIntel/000406F1-01
+h platform/i86pc/ucode/GenuineIntel/00050654-02=platform/i86pc/ucode/GenuineIntel/00050654-01
+h platform/i86pc/ucode/GenuineIntel/00050654-04=platform/i86pc/ucode/GenuineIntel/00050654-01
+h platform/i86pc/ucode/GenuineIntel/00050654-10=platform/i86pc/ucode/GenuineIntel/00050654-01
+h platform/i86pc/ucode/GenuineIntel/00050654-20=platform/i86pc/ucode/GenuineIntel/00050654-01
+h platform/i86pc/ucode/GenuineIntel/00050654-80=platform/i86pc/ucode/GenuineIntel/00050654-01
+h platform/i86pc/ucode/GenuineIntel/00050657-02=platform/i86pc/ucode/GenuineIntel/00050657-01
+h platform/i86pc/ucode/GenuineIntel/00050657-04=platform/i86pc/ucode/GenuineIntel/00050657-01
+h platform/i86pc/ucode/GenuineIntel/00050657-08=platform/i86pc/ucode/GenuineIntel/00050657-01
+h platform/i86pc/ucode/GenuineIntel/00050657-10=platform/i86pc/ucode/GenuineIntel/00050657-01
+h platform/i86pc/ucode/GenuineIntel/00050657-20=platform/i86pc/ucode/GenuineIntel/00050657-01
+h platform/i86pc/ucode/GenuineIntel/00050657-80=platform/i86pc/ucode/GenuineIntel/00050657-01
+h platform/i86pc/ucode/GenuineIntel/000506C9-02=platform/i86pc/ucode/GenuineIntel/000506C9-01
+h platform/i86pc/ucode/GenuineIntel/000506CA-02=platform/i86pc/ucode/GenuineIntel/000506CA-01
+h platform/i86pc/ucode/GenuineIntel/000506E3-04=platform/i86pc/ucode/GenuineIntel/000506E3-02
+h platform/i86pc/ucode/GenuineIntel/000506E3-10=platform/i86pc/ucode/GenuineIntel/000506E3-02
+h platform/i86pc/ucode/GenuineIntel/000506E3-20=platform/i86pc/ucode/GenuineIntel/000506E3-02
+h platform/i86pc/ucode/GenuineIntel/000806E9-80=platform/i86pc/ucode/GenuineIntel/000806E9-40
+h platform/i86pc/ucode/GenuineIntel/000806EA-80=platform/i86pc/ucode/GenuineIntel/000806EA-40
+h platform/i86pc/ucode/GenuineIntel/000806EB-40=platform/i86pc/ucode/GenuineIntel/000806EB-10
+h platform/i86pc/ucode/GenuineIntel/000806EB-80=platform/i86pc/ucode/GenuineIntel/000806EB-10
+h platform/i86pc/ucode/GenuineIntel/000806EC-10=platform/i86pc/ucode/GenuineIntel/000806EC-04
+h platform/i86pc/ucode/GenuineIntel/000806EC-80=platform/i86pc/ucode/GenuineIntel/000806EC-04
+h platform/i86pc/ucode/GenuineIntel/000906E9-08=platform/i86pc/ucode/GenuineIntel/000906E9-02
+h platform/i86pc/ucode/GenuineIntel/000906E9-20=platform/i86pc/ucode/GenuineIntel/000906E9-02
+h platform/i86pc/ucode/GenuineIntel/000906EA-20=platform/i86pc/ucode/GenuineIntel/000906EA-02
+h platform/i86pc/ucode/GenuineIntel/000906EC-20=platform/i86pc/ucode/GenuineIntel/000906EC-02
+h platform/i86pc/ucode/GenuineIntel/000906ED-20=platform/i86pc/ucode/GenuineIntel/000906ED-02
d proc 0755 root root
d root 0755 root root
f root/.bash_profile 0644 root root
diff --git a/usr/src/Targetdirs b/usr/src/Targetdirs
index 7844777e24..bb212bbeec 100644
--- a/usr/src/Targetdirs
+++ b/usr/src/Targetdirs
@@ -996,6 +996,10 @@ $(ROOT)/usr/lib/$(MACH64)/libdevinfo.so.1:= \
REALPATH=../../../lib/$(MACH64)/libdevinfo.so.1
$(ROOT)/usr/lib/$(MACH64)/libdevinfo.so:= \
REALPATH=../../../lib/$(MACH64)/libdevinfo.so.1
+$(ROOT)/usr/lib/$(MACH64)/libdhcpagent.so.1:= \
+ REALPATH=../../../lib/$(MACH64)/libdhcpagent.so.1
+$(ROOT)/usr/lib/$(MACH64)/libdhcpagent.so:= \
+ REALPATH=../../../lib/$(MACH64)/libdhcpagent.so.1
$(ROOT)/usr/lib/$(MACH64)/libdhcputil.so.1:= \
REALPATH=../../../lib/$(MACH64)/libdhcputil.so.1
$(ROOT)/usr/lib/$(MACH64)/libdhcputil.so:= \
@@ -1401,6 +1405,8 @@ SYM.USRLIB64= \
/usr/lib/$(MACH64)/libdevid.so.1 \
/usr/lib/$(MACH64)/libdevinfo.so \
/usr/lib/$(MACH64)/libdevinfo.so.1 \
+ /usr/lib/$(MACH64)/libdhcpagent.so \
+ /usr/lib/$(MACH64)/libdhcpagent.so.1 \
/usr/lib/$(MACH64)/libdhcputil.so \
/usr/lib/$(MACH64)/libdhcputil.so.1 \
/usr/lib/$(MACH64)/libdl.so \
diff --git a/usr/src/cmd/cmd-inet/common/compat.c b/usr/src/cmd/cmd-inet/common/compat.c
index ec055db910..7041762a87 100644
--- a/usr/src/cmd/cmd-inet/common/compat.c
+++ b/usr/src/cmd/cmd-inet/common/compat.c
@@ -22,10 +22,10 @@
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <deflt.h>
#include <string.h>
#include <stddef.h>
@@ -58,7 +58,7 @@ get_compat_flag(char **value)
TURNOFF(flags, DC_CASE);
(void) defcntl(DC_SETFLAGS, flags);
- if (cp = defread(DEFAULT_IP_LINE))
+ if ((cp = defread(DEFAULT_IP_LINE)) != NULL)
*value = strdup(cp);
/* close */
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile b/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile
index 9c2565656f..c3051e7ef8 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile
@@ -25,13 +25,19 @@
# Copyright (c) 1990 Mentat Inc.
#
# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
PROG= netstat
-LOCALOBJS= netstat.o unix.o
+LOCALOBJS= netstat.o
COMMONOBJS= compat.o
include ../../../Makefile.cmd
+# netstat uses libproc to grab processes and extract information about their
+# sockets. In order to be able to grab 64-bit processes, netstat itself must
+# be built 64-bit.
+$(BUILD64) include ../../../Makefile.cmd.64
+
include ../../Makefile.cmd-inet
LOCALSRCS= $(LOCALOBJS:%.o=%.c)
@@ -46,12 +52,9 @@ OBJS= $(LOCALOBJS) $(COMMONOBJS) $(STAT_COMMON_OBJS)
SRCS= $(LOCALSRCS) $(COMMONSRCS) $(STAT_COMMON_SRCS)
CPPFLAGS += -DNDEBUG -I$(CMDINETCOMMONDIR) -I$(STATCOMMONDIR)
-CERRWARN += $(CNOWARN_UNINIT)
-CERRWARN += -_gcc=-Wno-parentheses
-LDLIBS += -ldhcpagent -lsocket -lnsl -lkstat -ltsnet -ltsol
+LDLIBS += -ldhcpagent -lsocket -lnsl -lkstat -ltsnet -ltsol -lproc
-# not linted
-SMATCH=off
+CSTD= $(CSTD_GNU99)
.KEEP_STATE:
@@ -67,12 +70,10 @@ $(PROG): $(OBJS)
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
-install: all $(ROOTPROG)
+install: all $(ROOTPROG)
clean:
$(RM) $(OBJS)
-lint: lint_SRCS
-
include ../../../Makefile.targ
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
index 223e582072..a6249ae566 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
@@ -24,22 +24,12 @@
* netstat.c 2.2, last change 9/9/91
* MROUTING Revision 3.5
* Copyright 2018, Joyent, Inc.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
/*
* simple netstat based on snmp/mib-2 interface to the TCP/IP stack
*
- * NOTES:
- * 1. A comment "LINTED: (note 1)" appears before certain lines where
- * lint would have complained, "pointer cast may result in improper
- * alignment". These are lines where lint had suspected potential
- * improper alignment of a data structure; in each such situation
- * we have relied on the kernel guaranteeing proper alignment.
- * 2. Some 'for' loops have been commented as "'for' loop 1", etc
- * because they have 'continue' or 'break' statements in their
- * bodies. 'continue' statements have been used inside some loops
- * where avoiding them would have led to deep levels of indentation.
- *
* TODO:
* Add ability to request subsets from kernel (with level = MIB2_IP;
* name = 0 meaning everything for compatibility)
@@ -58,14 +48,21 @@
#include <locale.h>
#include <synch.h>
#include <thread.h>
+#include <pwd.h>
+#include <limits.h>
+#include <sys/ccompile.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/stream.h>
#include <stropts.h>
#include <sys/strstat.h>
#include <sys/tihdr.h>
+#include <procfs.h>
+#include <dirent.h>
#include <sys/socket.h>
+#include <sys/socketvar.h>
#include <sys/sockio.h>
#include <netinet/in.h>
#include <net/if.h>
@@ -88,13 +85,14 @@
#include <dhcpagent_ipc.h>
#include <dhcpagent_util.h>
#include <compat.h>
+#include <sys/mkdev.h>
#include <libtsnet.h>
#include <tsol/label.h>
-#include "statcommon.h"
+#include <libproc.h>
-extern void unixpr(kstat_ctl_t *kc);
+#include "statcommon.h"
#define STR_EXPAND 4
@@ -138,25 +136,24 @@ struct iflist {
struct ifstat tot;
};
+static void fatal(int, char *, ...) __NORETURN;
+
static mib_item_t *mibget(int sd);
static void mibfree(mib_item_t *firstitem);
static int mibopen(void);
static void mib_get_constants(mib_item_t *item);
static mib_item_t *mib_item_dup(mib_item_t *item);
-static mib_item_t *mib_item_diff(mib_item_t *item1,
- mib_item_t *item2);
+static mib_item_t *mib_item_diff(mib_item_t *item1, mib_item_t *item2);
static void mib_item_destroy(mib_item_t **item);
static boolean_t octetstrmatch(const Octet_t *a, const Octet_t *b);
static char *octetstr(const Octet_t *op, int code,
char *dst, uint_t dstlen);
-static char *pr_addr(uint_t addr,
- char *dst, uint_t dstlen);
+static char *pr_addr(uint_t addr, char *dst, uint_t dstlen);
static char *pr_addrnz(ipaddr_t addr, char *dst, uint_t dstlen);
static char *pr_addr6(const in6_addr_t *addr,
char *dst, uint_t dstlen);
-static char *pr_mask(uint_t addr,
- char *dst, uint_t dstlen);
+static char *pr_mask(uint_t addr, char *dst, uint_t dstlen);
static char *pr_prefix6(const struct in6_addr *addr,
uint_t prefixlen, char *dst, uint_t dstlen);
static char *pr_ap(uint_t addr, uint_t port,
@@ -194,6 +191,7 @@ static void if_report_ip6(mib2_ipv6AddrEntry_t *ap6,
static void ire_report(const mib_item_t *item);
static void tcp_report(const mib_item_t *item);
static void udp_report(const mib_item_t *item);
+static void uds_report(kstat_ctl_t *);
static void group_report(mib_item_t *item);
static void dce_report(mib_item_t *item);
static void print_ip_stats(mib2_ip_t *ip);
@@ -225,7 +223,10 @@ static char *ifindex2str(uint_t, char *);
static boolean_t family_selected(int family);
static void usage(char *);
-static void fatal(int errcode, char *str1, ...);
+static char *get_username(uid_t);
+
+static void process_hash_build(void);
+static void process_hash_free(void);
#define PLURAL(n) plural((int)n)
#define PLURALY(n) pluraly((int)n)
@@ -234,7 +235,6 @@ static void fatal(int errcode, char *str1, ...);
#define MDIFF(diff, elem2, elem1, member) (diff)->member = \
(elem2)->member - (elem1)->member
-
static boolean_t Aflag = B_FALSE; /* All sockets/ifs/rtng-tbls */
static boolean_t CIDRflag = B_FALSE; /* CIDR for IPv4 -i/-r addrs */
static boolean_t Dflag = B_FALSE; /* DCE info */
@@ -245,6 +245,7 @@ static boolean_t Rflag = B_FALSE; /* Routing Tables */
static boolean_t RSECflag = B_FALSE; /* Security attributes */
static boolean_t Sflag = B_FALSE; /* Per-protocol Statistics */
static boolean_t Vflag = B_FALSE; /* Verbose */
+static boolean_t Uflag = B_FALSE; /* Show PID and UID info. */
static boolean_t Pflag = B_FALSE; /* Net to Media Tables */
static boolean_t Gflag = B_FALSE; /* Multicast group membership */
static boolean_t MMflag = B_FALSE; /* Multicast routing table */
@@ -406,11 +407,9 @@ ns_warning_thr(void *unsued)
mutex_exit(&ns_lock);
}
- /* LINTED: E_STMT_NOT_REACHED */
return (NULL);
}
-
int
main(int argc, char **argv)
{
@@ -447,7 +446,7 @@ main(int argc, char **argv)
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "acdimnrspMgvxf:P:I:DRT:")) != -1) {
+ while ((c = getopt(argc, argv, "acdimnrspMguvxf:P:I:DRT:")) != -1) {
switch ((char)c) {
case 'a': /* all connections */
Aflag = B_TRUE;
@@ -511,6 +510,10 @@ main(int argc, char **argv)
IFLAGMOD(Iflag_only, 1, 0); /* see macro def'n */
break;
+ case 'u': /* show pid and uid information */
+ Uflag = B_TRUE;
+ break;
+
case 'x': /* turn on debugging */
Xflag = B_TRUE;
break;
@@ -617,8 +620,7 @@ main(int argc, char **argv)
}
}
if (optind < argc) {
- (void) fprintf(stderr,
- "%s: extra arguments\n", name);
+ (void) fprintf(stderr, "%s: extra arguments\n", name);
usage(name);
}
if (interval)
@@ -638,6 +640,9 @@ main(int argc, char **argv)
exit(0);
}
+ if (Uflag)
+ process_hash_build();
+
/*
* Get this process's security label if the -R switch is set.
* We use this label as the current zone's security label.
@@ -672,7 +677,6 @@ main(int argc, char **argv)
count = 1;
once_only = B_TRUE;
}
- /* 'for' loop 1: */
for (;;) {
mib_item_t *curritem = NULL; /* only for -[M]s */
@@ -729,7 +733,7 @@ main(int argc, char **argv)
if (family_selected(AF_UNIX) &&
(!(Dflag || Iflag || Rflag || Sflag || Mflag ||
MMflag || Pflag || Gflag)))
- unixpr(kc);
+ uds_report(kc);
(void) kstat_close(kc);
/* iteration handling code */
@@ -758,16 +762,18 @@ main(int argc, char **argv)
if ((kc = kstat_open()) == NULL)
fail(1, "kstat_open(): can't open /dev/kstat");
- } /* 'for' loop 1 ends */
+ }
mibfree(item);
(void) close(sd);
if (zone_security_label != NULL)
m_label_free(zone_security_label);
+ if (Uflag)
+ process_hash_free();
+
return (0);
}
-
static int
isnum(char *p)
{
@@ -781,6 +787,427 @@ isnum(char *p)
return (1);
}
+/*
+ * ------------------------------ Process Hash -----------------------------
+ *
+ * When passed the -u option, netstat presents additional information against
+ * each socket showing the associated process ID(s), user(s) and command(s).
+ *
+ * The kernel provides some additional information for each socket, namely:
+ * - inode;
+ * - address family;
+ * - socket type;
+ * - major number;
+ * - flags.
+ *
+ * Netstat must correlate this information against processes running on the
+ * system and the files which they have open.
+ *
+ * It does this by traversing /proc and checking each process' open files,
+ * looking for BSD sockets or file descriptors relating to TLI/XTI sockets.
+ * When it finds one, it retrieves information and records it in the
+ * 'process_table' hash table with the entry hashed by its inode.
+ *
+ * For a BSD socket, libproc is used to grab the process and retrieve
+ * further information. This is not necessary for TLI/XTI sockets since the
+ * information can be derived directly via stat().
+ *
+ * Note that each socket can be associated with more than one process.
+ */
+
+/*
+ * The size of the hash table for recording sockets found under /proc.
+ * This should be a prime number. The value below was chosen after testing
+ * on a busy web server to reduce the number of hash table collisions to
+ * fewer than five per slot.
+ */
+#define PROC_HASH_SIZE 2003
+/* Maximum length of a username - anything larger will be truncated */
+#define PROC_USERNAME_SIZE 128
+/* Maximum length of the string representation of a process ID */
+#define PROC_PID_SIZE 15
+
+#define PROC_HASH(k) ((k) % PROC_HASH_SIZE)
+
+typedef struct proc_fdinfo {
+ uint64_t ph_inode;
+ uint64_t ph_fd;
+ mode_t ph_mode;
+ major_t ph_major;
+ int ph_family;
+ int ph_type;
+
+ char ph_fname[PRFNSZ];
+ char ph_psargs[PRARGSZ];
+ char ph_username[PROC_USERNAME_SIZE];
+ pid_t ph_pid;
+ char ph_pidstr[PROC_PID_SIZE];
+
+ struct proc_fdinfo *ph_next; /* Next (for collisions) */
+ struct proc_fdinfo *ph_next_proc; /* Next process with this inode */
+} proc_fdinfo_t;
+
+static proc_fdinfo_t *process_table[PROC_HASH_SIZE];
+
+static proc_fdinfo_t unknown_proc = {
+ .ph_pid = 0,
+ .ph_pidstr = "",
+ .ph_username = "",
+ .ph_fname = "",
+ .ph_psargs = "",
+ .ph_next_proc = NULL
+};
+
+/*
+ * Gets username given uid. It doesn't return NULL.
+ */
+static char *
+get_username(uid_t u)
+{
+ static uid_t saved_uid = UID_MAX;
+ static char saved_username[PROC_USERNAME_SIZE];
+ struct passwd *pw = NULL;
+
+ if (u == UID_MAX)
+ return ("<unknown>");
+
+ if (u == saved_uid && saved_username[0] != '\0')
+ return (saved_username);
+
+ setpwent();
+
+ if ((pw = getpwuid(u)) != NULL) {
+ (void) strlcpy(saved_username, pw->pw_name,
+ sizeof (saved_username));
+ } else {
+ (void) snprintf(saved_username, sizeof (saved_username),
+ "(%u)", u);
+ }
+
+ saved_uid = u;
+ return (saved_username);
+}
+
+static proc_fdinfo_t *
+process_hash_find(const mib2_socketInfoEntry_t *sie, int type, int family)
+{
+ proc_fdinfo_t *ph;
+ uint_t idx = PROC_HASH(sie->sie_inode);
+
+ for (ph = process_table[idx]; ph != NULL; ph = ph->ph_next) {
+ if (ph->ph_inode != sie->sie_inode)
+ continue;
+ if ((sie->sie_flags & MIB2_SOCKINFO_STREAM)) {
+ /* TLI/XTI socket */
+ if (S_ISCHR(ph->ph_mode) &&
+ major(sie->sie_dev) == ph->ph_major) {
+ return (ph);
+ }
+ } else {
+ if (S_ISSOCK(ph->ph_mode) && ph->ph_type == type &&
+ ph->ph_family == family) {
+ return (ph);
+ }
+ }
+ }
+
+ return (NULL);
+}
+
+static proc_fdinfo_t *
+process_hash_get(const mib2_socketInfoEntry_t *sie, int type, int family)
+{
+ proc_fdinfo_t *ph;
+
+ if (sie != NULL && sie->sie_inode > 0 &&
+ (ph = process_hash_find(sie, type, family)) != NULL) {
+ return (ph);
+ }
+
+ return (&unknown_proc);
+}
+
+static void
+process_hash_insert(proc_fdinfo_t *ph)
+{
+ uint_t idx = PROC_HASH(ph->ph_inode);
+ proc_fdinfo_t *slotp;
+
+ mib2_socketInfoEntry_t sie = {
+ .sie_inode = ph->ph_inode,
+ .sie_dev = makedev(ph->ph_major, 0),
+ .sie_flags = S_ISCHR(ph->ph_mode) ? MIB2_SOCKINFO_STREAM : 0
+ };
+
+ slotp = process_hash_find(&sie, ph->ph_type, ph->ph_family);
+
+ if (slotp == NULL) {
+ ph->ph_next = process_table[idx];
+ process_table[idx] = ph;
+ } else {
+ ph->ph_next_proc = slotp->ph_next_proc;
+ slotp->ph_next_proc = ph;
+ }
+}
+
+static void
+process_hash_dump(void)
+{
+ unsigned int i;
+
+ (void) printf("--- Process hash table\n");
+ for (i = 0; i < PROC_HASH_SIZE; i++) {
+ proc_fdinfo_t *ph;
+
+ if (process_table[i] == NULL)
+ continue;
+
+ (void) printf("Slot %d\n", i);
+
+ for (ph = process_table[i]; ph != NULL; ph = ph->ph_next) {
+ proc_fdinfo_t *ph2;
+
+ (void) printf(" -> Inode %" PRIu64 "\n",
+ ph->ph_inode);
+
+ for (ph2 = ph; ph2 != NULL; ph2 = ph2->ph_next_proc) {
+ (void) printf(" -> "
+ "/proc/%ld/fd/%" PRIu64 " %s - "
+ "fname %s - "
+ "psargs %s - "
+ "major %" PRIx32 " - "
+ "type/fam %d/%d\n",
+ ph2->ph_pid, ph2->ph_fd,
+ S_ISCHR(ph2->ph_mode) ? "CHR" : "SOCK",
+ ph2->ph_fname, ph2->ph_psargs,
+ ph2->ph_major,
+ ph2->ph_type, ph2->ph_family);
+ }
+ }
+ }
+}
+
+static int
+process_hash_iter(const psinfo_t *psinfo, const prfdinfo_t *pr,
+ struct ps_prochandle *Pr)
+{
+ proc_fdinfo_t *ph;
+
+ /*
+ * We are interested both in sockets and in descriptors linked to
+ * network STREAMS character devices.
+ */
+ if (S_ISCHR(pr->pr_mode)) {
+ /*
+ * There's no elegant way to determine if a character device
+ * supports TLI, so just check a hardcoded list of known TLI
+ * devices.
+ */
+ const char *tlidevs[] = {
+ "tcp", "tcp6", "udp", "udp6", NULL
+ };
+ boolean_t istli = B_FALSE;
+ char *dev;
+ int i;
+
+ /* global zone: /devices paths */
+ dev = strrchr(pr->pr_path, ':');
+ /* also check the /dev path for zones */
+ if (dev == NULL)
+ dev = strrchr(pr->pr_path, '/');
+ if (dev == NULL)
+ return (0);
+ dev++; /* skip past the `:' or '/' */
+
+ for (i = 0; tlidevs[i] != NULL; i++) {
+ if (strcmp(dev, tlidevs[i]) == 0) {
+ istli = B_TRUE;
+ break;
+ }
+ }
+ if (!istli)
+ return (0);
+ } else if (!S_ISSOCK(pr->pr_mode)) {
+ return (0);
+ }
+
+ if ((ph = calloc(1, sizeof (proc_fdinfo_t))) == NULL)
+ fatal(1, "out of memory\n");
+
+ ph->ph_pid = psinfo->pr_pid;
+ if (ph->ph_pid > 0)
+ (void) snprintf(ph->ph_pidstr, PROC_PID_SIZE, "%" PRIu64,
+ ph->ph_pid);
+ ph->ph_inode = pr->pr_ino;
+ ph->ph_fd = pr->pr_fd;
+ ph->ph_major = pr->pr_rmajor;
+ ph->ph_mode = pr->pr_mode;
+ (void) strlcpy(ph->ph_fname, psinfo->pr_fname, sizeof (ph->ph_fname));
+ (void) strlcpy(ph->ph_psargs, psinfo->pr_psargs,
+ sizeof (ph->ph_psargs));
+ (void) strlcpy(ph->ph_username, get_username(psinfo->pr_uid),
+ sizeof (ph->ph_username));
+
+ if (S_ISSOCK(pr->pr_mode) && Pr != NULL) {
+ struct sockaddr sa;
+ socklen_t slen;
+ int type, tlen;
+
+ /* Determine the socket type */
+ tlen = sizeof (type);
+ if (pr_getsockopt(Pr, pr->pr_fd, SOL_SOCKET, SO_TYPE, &type,
+ &tlen) == 0)
+ ph->ph_type = type;
+
+ /* Determine the protocol family */
+ slen = sizeof (sa);
+ if (pr_getsockname(Pr, pr->pr_fd, &sa, &slen) == 0)
+ ph->ph_family = sa.sa_family;
+ }
+
+ process_hash_insert(ph);
+
+ return (0);
+}
+
+static void
+process_hash_iterate(psinfo_t *psinfo)
+{
+ char dir_name[PATH_MAX];
+ struct dirent *ent;
+ struct ps_prochandle *ph = NULL;
+ int err;
+
+ DIR *dirp;
+
+ if (snprintf(dir_name, sizeof (dir_name), "/proc/%d/path",
+ psinfo->pr_pid) >= sizeof (dir_name))
+ return;
+ dirp = opendir(dir_name);
+ if (dirp == NULL)
+ return;
+ while ((ent = readdir(dirp)) != NULL) {
+ char path[PATH_MAX];
+ struct stat st;
+ prfdinfo_t info;
+ int fd, len;
+
+ if (!isdigit(ent->d_name[0]))
+ continue;
+
+ fd = atoi(ent->d_name);
+
+ if (snprintf(path, sizeof (path), "/proc/%d/fd/%d",
+ psinfo->pr_pid, fd) >= sizeof (path))
+ continue;
+ if (stat(path, &st) != 0)
+ continue;
+ bzero(&info, sizeof (info));
+ info.pr_fd = fd;
+ info.pr_mode = st.st_mode;
+ info.pr_uid = st.st_uid;
+ info.pr_gid = st.st_gid;
+ info.pr_major = major(st.st_dev);
+ info.pr_minor = minor(st.st_dev);
+ info.pr_rmajor = major(st.st_rdev);
+ info.pr_rminor = minor(st.st_rdev);
+ info.pr_size = st.st_size;
+ info.pr_ino = st.st_ino;
+
+ len = -1;
+ switch (info.pr_mode & S_IFMT) {
+ case S_IFDOOR:
+ break;
+ case S_IFSOCK:
+ /*
+ * Grab the process so that we can interrogate it
+ * for further details on the socket.
+ */
+ if (ph == NULL &&
+ (ph = Pgrab(psinfo->pr_pid,
+ PGRAB_RETAIN | PGRAB_NOSTOP, &err)) == NULL) {
+ /* unreadable or SYS process */
+ if (Xflag) {
+ printf("Could not grab %d - %s\n",
+ psinfo->pr_pid, Pgrab_error(err));
+ }
+ }
+ break;
+ default:
+ /* attempt to determine the path */
+ if (snprintf(path, sizeof (path), "%s/%d",
+ dir_name, fd) < sizeof (path)) {
+ len = readlink(path, info.pr_path,
+ sizeof (info.pr_path) - 1);
+ }
+ break;
+ }
+
+ if (len <= 0)
+ len = 0;
+ info.pr_path[len] = '\0';
+
+ if (process_hash_iter(psinfo, &info, ph) != 0)
+ break;
+ }
+ (void) closedir(dirp);
+
+ if (ph != NULL)
+ Prelease(ph, PRELEASE_RETAIN);
+}
+
+static void
+process_hash_build(void)
+{
+ struct dirent *proce;
+ DIR *proc;
+ int err;
+ pid_t me = getpid();
+
+ if ((proc = opendir("/proc")) == NULL)
+ return;
+
+ while ((proce = readdir(proc)) != NULL) {
+ psinfo_t psinfo;
+ pid_t pid;
+
+ if (!isdigit(proce->d_name[0]))
+ continue;
+
+ pid = proc_arg_psinfo(proce->d_name, PR_ARG_PIDS, &psinfo,
+ &err);
+ if (pid < 0 || pid == me)
+ continue;
+
+ /*
+ * We do not use libproc's Pfdinfo_iter() here as it requires
+ * grabbing the process in read/write mode. Instead, the
+ * process is grabbed if (and only if) details about an open
+ * socket need to be retrieved.
+ */
+ process_hash_iterate(&psinfo);
+ }
+ (void) closedir(proc);
+
+ if (Xflag)
+ process_hash_dump();
+}
+
+static void
+process_hash_free(void)
+{
+ unsigned int i;
+
+ for (i = 0; i < PROC_HASH_SIZE; i++) {
+ proc_fdinfo_t *ph, *ph_next;
+
+ for (ph = process_table[i]; ph != NULL; ph = ph_next) {
+ ph_next = ph->ph_next;
+ free(ph);
+ }
+ process_table[i] = NULL;
+ }
+}
/* --------------------------------- MIBGET -------------------------------- */
@@ -811,7 +1238,6 @@ mibget(int sd)
tor->OPT_length = sizeof (struct opthdr);
tor->MGMT_flags = T_CURRENT;
-
/*
* Note: we use the special level value below so that IP will return
* us information concerning IRE_MARK_TESTHIDDEN routes.
@@ -915,7 +1341,7 @@ mibget(int sd)
if (last_item->valp == NULL)
goto error_exit;
if (Xflag)
- (void) printf("msg %d: group = %4d mib_id = %5d"
+ (void) printf("msg %4d: group = %-4d mib_id = %-5d "
"length = %d\n",
j, last_item->group, last_item->mib_id,
last_item->length);
@@ -1091,21 +1517,19 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
return (diffp);
}
- diffp = (mib_item_t *)calloc(nitems, sizeof (mib_item_t));
+ diffp = calloc(nitems, sizeof (mib_item_t));
if (diffp == NULL)
return (NULL);
diffptr = diffp;
- /* 'for' loop 1: */
for (tempp2 = item2; tempp2 != NULL; tempp2 = tempp2->next_item) {
if (tempp2->mib_id != 0)
- continue; /* 'for' loop 1 */
- /* 'for' loop 2: */
+ continue;
for (tempp1 = item1; tempp1 != NULL;
tempp1 = tempp1->next_item) {
if (!(tempp1->mib_id == 0 &&
tempp1->group == tempp2->group &&
tempp1->mib_id == tempp2->mib_id))
- continue; /* 'for' loop 2 */
+ continue;
/* found comparable data sets */
if (prevp != NULL)
prevp->next_item = diffptr;
@@ -1123,7 +1547,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_ip_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1174,8 +1598,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_ipv6IfStatsEntry_t *)calloc(
- tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1226,7 +1649,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (struct mrtstat *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1264,8 +1687,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (struct igmpstat *)calloc(
- tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1291,7 +1713,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_icmp_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1340,7 +1762,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_ipv6IfIcmpEntry_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1393,7 +1815,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_tcp_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1460,7 +1882,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_udp_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1481,7 +1903,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_sctp_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1538,7 +1960,7 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
diffptr->group = tempp2->group;
diffptr->mib_id = tempp2->mib_id;
diffptr->length = tempp2->length;
- d = (mib2_rawip_t *)calloc(tempp2->length, 1);
+ d = calloc(1, tempp2->length);
if (d == NULL)
goto mibdiff_out_of_memory;
diffptr->valp = d;
@@ -1555,9 +1977,9 @@ mib_item_diff(mib_item_t *item1, mib_item_t *item2)
* required for the -s and -Ms options
*/
}
- } /* 'for' loop 2 ends */
+ }
tempp1 = NULL;
- } /* 'for' loop 1 ends */
+ }
tempp2 = NULL;
diffptr--;
diffptr->next_item = NULL;
@@ -1828,10 +2250,9 @@ prval_end(void)
static void
mib_get_constants(mib_item_t *item)
{
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (item->mib_id != 0)
- continue; /* 'for' loop 1 */
+ continue;
switch (item->group) {
case MIB2_IP: {
@@ -1939,7 +2360,7 @@ mib_get_constants(mib_item_t *item)
break;
}
}
- } /* 'for' loop 1 ends */
+ }
if (Xflag) {
(void) puts("mib_get_constants:");
@@ -1976,7 +2397,6 @@ mib_get_constants(mib_item_t *item)
}
}
-
/* ----------------------------- STAT_REPORT ------------------------------- */
static void
@@ -1985,17 +2405,15 @@ stat_report(mib_item_t *item)
int jtemp = 0;
char ifname[LIFNAMSIZ + 1];
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
"length = %d, valp = 0x%p\n",
- item->group, item->mib_id,
+ jtemp++, item->group, item->mib_id,
item->length, item->valp);
}
if (item->mib_id != 0)
- continue; /* 'for' loop 1 */
+ continue;
switch (item->group) {
case MIB2_IP: {
@@ -2029,10 +2447,8 @@ stat_report(mib_item_t *item)
!(family_selected(AF_INET6)))
break;
bzero(&sum6, sizeof (sum6));
- /* 'for' loop 2a: */
for (ip6 = (mib2_ipv6IfStatsEntry_t *)item->valp;
(char *)ip6 < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
ip6 = (mib2_ipv6IfStatsEntry_t *)((char *)ip6 +
ipv6IfStatsEntrySize)) {
if (ip6->ipv6IfIndex == 0) {
@@ -2041,7 +2457,7 @@ stat_report(mib_item_t *item)
* mib. Just add to the sum.
*/
sum_ip6_stats(ip6, &sum6);
- continue; /* 'for' loop 2a */
+ continue;
}
if (Aflag) {
(void) printf("\nIPv6 for %s\n",
@@ -2050,7 +2466,7 @@ stat_report(mib_item_t *item)
print_ip6_stats(ip6);
}
sum_ip6_stats(ip6, &sum6);
- } /* 'for' loop 2a ends */
+ }
(void) fputs("\nIPv6", stdout);
print_ip6_stats(&sum6);
break;
@@ -2063,7 +2479,6 @@ stat_report(mib_item_t *item)
!(family_selected(AF_INET6)))
break;
bzero(&sum6, sizeof (sum6));
- /* 'for' loop 2b: */
for (icmp6 = (mib2_ipv6IfIcmpEntry_t *)item->valp;
(char *)icmp6 < (char *)item->valp + item->length;
icmp6 = (void *)((char *)icmp6 +
@@ -2074,7 +2489,7 @@ stat_report(mib_item_t *item)
* mib. Just add to the sum.
*/
sum_icmp6_stats(icmp6, &sum6);
- continue; /* 'for' loop 2b: */
+ continue;
}
if (Aflag) {
(void) printf("\nICMPv6 for %s\n",
@@ -2083,7 +2498,7 @@ stat_report(mib_item_t *item)
print_icmp6_stats(icmp6);
}
sum_icmp6_stats(icmp6, &sum6);
- } /* 'for' loop 2b ends */
+ }
(void) fputs("\nICMPv6", stdout);
print_icmp6_stats(&sum6);
break;
@@ -2145,7 +2560,7 @@ stat_report(mib_item_t *item)
break;
}
}
- } /* 'for' loop 1 ends */
+ }
(void) putchar('\n');
(void) fflush(stdout);
}
@@ -2630,15 +3045,13 @@ mrt_stat_report(mib_item_t *curritem)
return;
(void) putchar('\n');
- /* 'for' loop 1: */
for (tempitem = curritem;
tempitem;
tempitem = tempitem->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
"length = %d, valp = 0x%p\n",
- tempitem->group, tempitem->mib_id,
+ jtemp++, tempitem->group, tempitem->mib_id,
tempitem->length, tempitem->valp);
}
@@ -2649,14 +3062,14 @@ mrt_stat_report(mib_item_t *curritem)
mrts = (struct mrtstat *)tempitem->valp;
if (!(family_selected(AF_INET)))
- continue; /* 'for' loop 1 */
+ continue;
print_mrt_stats(mrts);
break;
}
}
}
- } /* 'for' loop 1 ends */
+ }
(void) putchar('\n');
(void) fflush(stdout);
}
@@ -2693,12 +3106,10 @@ if_report(mib_item_t *item, char *matchname,
uint32_t ifindex_v6 = 0;
boolean_t first_header = B_TRUE;
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id, item->length,
item->valp);
}
@@ -2707,7 +3118,7 @@ if_report(mib_item_t *item, char *matchname,
case MIB2_IP:
if (item->mib_id != MIB2_IP_ADDR ||
!family_selected(AF_INET))
- continue; /* 'for' loop 1 */
+ continue;
{
static struct ifstat old = {0L, 0L, 0L, 0L, 0L};
static struct ifstat new = {0L, 0L, 0L, 0L, 0L};
@@ -2729,7 +3140,6 @@ if_report(mib_item_t *item, char *matchname,
(item->length)
/ sizeof (mib2_ipAddrEntry_t));
- /* 'for' loop 2a: */
for (ap = (mib2_ipAddrEntry_t *)item->valp;
(char *)ap < (char *)item->valp
+ item->length;
@@ -2742,7 +3152,7 @@ if_report(mib_item_t *item, char *matchname,
if (matchname != NULL &&
strcmp(matchname, ifname) != 0 &&
strcmp(matchname, logintname) != 0)
- continue; /* 'for' loop 2a */
+ continue;
new_ifindex =
if_nametoindex(logintname);
/*
@@ -2775,19 +3185,22 @@ if_report(mib_item_t *item, char *matchname,
"collisions");
if (first) {
if (!first_header)
- (void) putchar('\n');
+ (void) putchar(
+ '\n');
first_header = B_FALSE;
- (void) printf(
- "%-5.5s %-5.5s%-13.13s "
- "%-14.14s %-6.6s %-5.5s "
- "%-6.6s %-5.5s %-6.6s "
- "%-6.6s\n",
- "Name", "Mtu", "Net/Dest",
- "Address", "Ipkts",
- "Ierrs", "Opkts", "Oerrs",
- "Collis", "Queue");
-
- first = B_FALSE;
+ (void) printf(
+ "%-5.5s %-5.5s"
+ "%-13.13s %-14.14s "
+ "%-6.6s %-5.5s "
+ "%-6.6s %-5.5s "
+ "%-6.6s %-6.6s\n",
+ "Name", "Mtu",
+ "Net/Dest",
+ "Address", "Ipkts",
+ "Ierrs", "Opkts",
+ "Oerrs", "Collis",
+ "Queue");
+ first = B_FALSE;
}
if_report_ip4(ap, ifname,
logintname, &stat, B_TRUE);
@@ -2796,7 +3209,7 @@ if_report(mib_item_t *item, char *matchname,
if_report_ip4(ap, ifname,
logintname, &stat, B_FALSE);
}
- } /* 'for' loop 2a ends */
+ }
} else if (!alreadydone) {
char ifname[LIFNAMSIZ + 1];
char buf[LIFNAMSIZ + 1];
@@ -2819,7 +3232,7 @@ if_report(mib_item_t *item, char *matchname,
}
/*
- * 'for' loop 2b: find the "right" entry:
+ * Find the "right" entry:
* If an interface name to match has been
* supplied then try and find it, otherwise
* match the first non-loopback interface found.
@@ -2836,13 +3249,12 @@ if_report(mib_item_t *item, char *matchname,
if (matchname) {
if (strcmp(matchname,
ifname) == 0) {
- /* 'for' loop 2b */
found_if = B_TRUE;
break;
}
} else if (strcmp(ifname, "lo0") != 0)
- break; /* 'for' loop 2b */
- } /* 'for' loop 2b ends */
+ break;
+ }
if (matchname == NULL) {
matchname = ifname;
@@ -2870,7 +3282,6 @@ if_report(mib_item_t *item, char *matchname,
sum = zerostat;
- /* 'for' loop 2c: */
for (ap = (mib2_ipAddrEntry_t *)item->valp;
(char *)ap < (char *)item->valp
+ item->length;
@@ -2984,7 +3395,7 @@ if_report(mib_item_t *item, char *matchname,
}
}
- } /* 'for' loop 2c ends */
+ }
*nextnew = NULL;
@@ -3019,7 +3430,7 @@ if_report(mib_item_t *item, char *matchname,
case MIB2_IP6:
if (item->mib_id != MIB2_IP6_ADDR ||
!family_selected(AF_INET6))
- continue; /* 'for' loop 1 */
+ continue;
{
static struct ifstat old6 = {0L, 0L, 0L, 0L, 0L};
static struct ifstat new6 = {0L, 0L, 0L, 0L, 0L};
@@ -3040,7 +3451,6 @@ if_report(mib_item_t *item, char *matchname,
(void) printf("if_report: %d items\n",
(item->length)
/ sizeof (mib2_ipv6AddrEntry_t));
- /* 'for' loop 2d: */
for (ap6 = (mib2_ipv6AddrEntry_t *)item->valp;
(char *)ap6 < (char *)item->valp
+ item->length;
@@ -3053,7 +3463,7 @@ if_report(mib_item_t *item, char *matchname,
if (matchname != NULL &&
strcmp(matchname, ifname) != 0 &&
strcmp(matchname, logintname) != 0)
- continue; /* 'for' loop 2d */
+ continue;
new_ifindex =
if_nametoindex(logintname);
@@ -3087,7 +3497,8 @@ if_report(mib_item_t *item, char *matchname,
"collisions");
if (first) {
if (!first_header)
- (void) putchar('\n');
+ (void) putchar(
+ '\n');
first_header = B_FALSE;
(void) printf(
"%-5.5s %-5.5s%"
@@ -3109,7 +3520,7 @@ if_report(mib_item_t *item, char *matchname,
if_report_ip6(ap6, ifname,
logintname, &stat, B_FALSE);
}
- } /* 'for' loop 2d ends */
+ }
} else if (!alreadydone) {
char ifname[LIFNAMSIZ + 1];
char buf[IFNAMSIZ + 1];
@@ -3132,7 +3543,7 @@ if_report(mib_item_t *item, char *matchname,
}
/*
- * 'for' loop 2e: find the "right" entry:
+ * Find the "right" entry:
* If an interface name to match has been
* supplied then try and find it, otherwise
* match the first non-loopback interface found.
@@ -3149,13 +3560,12 @@ if_report(mib_item_t *item, char *matchname,
if (matchname) {
if (strcmp(matchname,
ifname) == 0) {
- /* 'for' loop 2e */
found_if = B_TRUE;
break;
}
} else if (strcmp(ifname, "lo0") != 0)
- break; /* 'for' loop 2e */
- } /* 'for' loop 2e ends */
+ break;
+ }
if (matchname == NULL) {
matchname = ifname;
@@ -3184,7 +3594,6 @@ if_report(mib_item_t *item, char *matchname,
sum6 = zerostat;
- /* 'for' loop 2f: */
for (ap6 = (mib2_ipv6AddrEntry_t *)item->valp;
(char *)ap6 < (char *)item->valp
+ item->length;
@@ -3299,7 +3708,7 @@ if_report(mib_item_t *item, char *matchname,
}
}
- } /* 'for' loop 2f ends */
+ }
*nextnew = NULL;
@@ -3333,7 +3742,7 @@ if_report(mib_item_t *item, char *matchname,
}
}
(void) fflush(stdout);
- } /* 'for' loop 1 ends */
+ }
if ((Iflag_only == 0) && (!once_only))
(void) putchar('\n');
reentry = B_TRUE;
@@ -3581,13 +3990,11 @@ group_report(mib_item_t *item)
ipv6_grpsrc_t *ips6;
boolean_t first, first_src;
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
"length = %d, valp = 0x%p\n",
- item->group, item->mib_id, item->length,
+ jtemp++, item->group, item->mib_id, item->length,
item->valp);
}
if (item->group == MIB2_IP && family_selected(AF_INET)) {
@@ -3633,7 +4040,6 @@ group_report(mib_item_t *item)
first = B_TRUE;
for (ipmp = (ip_member_t *)v4grp->valp;
(char *)ipmp < (char *)v4grp->valp + v4grp->length;
- /* LINTED: (note 1) */
ipmp = (ip_member_t *)((char *)ipmp + ipMemberEntrySize)) {
if (first) {
(void) puts(v4compat ?
@@ -3653,7 +4059,6 @@ group_report(mib_item_t *item)
abuf, sizeof (abuf)),
ipmp->ipGroupMemberRefCnt);
-
if (!Vflag || v4src == NULL)
continue;
@@ -3665,7 +4070,6 @@ group_report(mib_item_t *item)
first_src = B_TRUE;
for (ips = (ip_grpsrc_t *)v4src->valp;
(char *)ips < (char *)v4src->valp + v4src->length;
- /* LINTED: (note 1) */
ips = (ip_grpsrc_t *)((char *)ips +
ipGroupSourceEntrySize)) {
/*
@@ -3709,7 +4113,6 @@ group_report(mib_item_t *item)
first = B_TRUE;
for (ipmp6 = (ipv6_member_t *)v6grp->valp;
(char *)ipmp6 < (char *)v6grp->valp + v6grp->length;
- /* LINTED: (note 1) */
ipmp6 = (ipv6_member_t *)((char *)ipmp6 +
ipv6MemberEntrySize)) {
if (first) {
@@ -3739,7 +4142,6 @@ group_report(mib_item_t *item)
first_src = B_TRUE;
for (ips6 = (ipv6_grpsrc_t *)v6src->valp;
(char *)ips6 < (char *)v6src->valp + v6src->length;
- /* LINTED: (note 1) */
ips6 = (ipv6_grpsrc_t *)((char *)ips6 +
ipv6GroupSourceEntrySize)) {
/* same assumption as in the v4 case above */
@@ -3810,12 +4212,10 @@ dce_report(mib_item_t *item)
boolean_t first;
dest_cache_entry_t *dce;
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id, item->length,
item->valp);
}
@@ -3841,7 +4241,6 @@ dce_report(mib_item_t *item)
first = B_TRUE;
for (dce = (dest_cache_entry_t *)v4dce->valp;
(char *)dce < (char *)v4dce->valp + v4dce->length;
- /* LINTED: (note 1) */
dce = (dest_cache_entry_t *)((char *)dce +
ipDestEntrySize)) {
if (first) {
@@ -3869,7 +4268,6 @@ dce_report(mib_item_t *item)
first = B_TRUE;
for (dce = (dest_cache_entry_t *)v6dce->valp;
(char *)dce < (char *)v6dce->valp + v6dce->length;
- /* LINTED: (note 1) */
dce = (dest_cache_entry_t *)((char *)dce +
ipDestEntrySize)) {
if (first) {
@@ -3914,17 +4312,15 @@ arp_report(mib_item_t *item)
if (!(family_selected(AF_INET)))
return;
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id, item->length,
item->valp);
}
if (!(item->group == MIB2_IP && item->mib_id == MIB2_IP_MEDIA))
- continue; /* 'for' loop 1 */
+ continue;
if (Xflag)
(void) printf("%u records for "
@@ -3932,10 +4328,8 @@ arp_report(mib_item_t *item)
item->length/sizeof (mib2_ipNetToMediaEntry_t));
first = B_TRUE;
- /* 'for' loop 2: */
for (np = (mib2_ipNetToMediaEntry_t *)item->valp;
(char *)np < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
np = (mib2_ipNetToMediaEntry_t *)((char *)np +
ipNetToMediaEntrySize)) {
if (first) {
@@ -3987,8 +4381,8 @@ arp_report(mib_item_t *item)
flbuf,
octetstr(&np->ipNetToMediaPhysAddress, 'h',
xbuf, sizeof (xbuf)));
- } /* 'for' loop 2 ends */
- } /* 'for' loop 1 ends */
+ }
+ }
(void) fflush(stdout);
}
@@ -4009,7 +4403,6 @@ ndp_report(mib_item_t *item)
if (!(family_selected(AF_INET6)))
return;
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
(void) printf("\n--- Entry %d ---\n", ++jtemp);
@@ -4020,13 +4413,11 @@ ndp_report(mib_item_t *item)
}
if (!(item->group == MIB2_IP6 &&
item->mib_id == MIB2_IP6_MEDIA))
- continue; /* 'for' loop 1 */
+ continue;
first = B_TRUE;
- /* 'for' loop 2: */
for (np6 = (mib2_ipv6NetToMediaEntry_t *)item->valp;
(char *)np6 < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
np6 = (mib2_ipv6NetToMediaEntry_t *)((char *)np6 +
ipv6NetToMediaEntrySize)) {
if (first) {
@@ -4075,6 +4466,8 @@ ndp_report(mib_item_t *item)
case 4:
type = "local";
break;
+ default:
+ type = "UNKNOWN";
}
(void) printf("%-5s %-17s %-7s %-12s %-27s\n",
ifindex2str(np6->ipv6NetToMediaIfIndex, ifname),
@@ -4084,8 +4477,8 @@ ndp_report(mib_item_t *item)
state,
pr_addr6(&np6->ipv6NetToMediaNetAddress,
abuf, sizeof (abuf)));
- } /* 'for' loop 2 ends */
- } /* 'for' loop 1 ends */
+ }
+ }
(void) putchar('\n');
(void) fflush(stdout);
}
@@ -4173,7 +4566,6 @@ ire_report(const mib_item_t *item)
}
for (iae = iptr->valp;
(char *)iae < (char *)iptr->valp + iptr->length;
- /* LINTED: (note 1) */
iae = (mib2_ipAttributeEntry_t *)((char *)iae +
ipRouteAttributeSize)) {
aptr->sal_next = alp[iae->iae_routeidx];
@@ -4182,14 +4574,12 @@ ire_report(const mib_item_t *item)
}
}
- /* 'for' loop 1: */
v4a = v4_attrs;
v6a = v6_attrs;
for (; item != NULL; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id,
item->length, item->valp);
}
@@ -4197,12 +4587,12 @@ ire_report(const mib_item_t *item)
item->mib_id == MIB2_IP_ROUTE) ||
(item->group == MIB2_IP6 &&
item->mib_id == MIB2_IP6_ROUTE)))
- continue; /* 'for' loop 1 */
+ continue;
if (item->group == MIB2_IP && !family_selected(AF_INET))
- continue; /* 'for' loop 1 */
+ continue;
else if (item->group == MIB2_IP6 && !family_selected(AF_INET6))
- continue; /* 'for' loop 1 */
+ continue;
if (Xflag) {
if (item->group == MIB2_IP) {
@@ -4220,7 +4610,6 @@ ire_report(const mib_item_t *item)
if (item->group == MIB2_IP) {
for (rp = (mib2_ipRouteEntry_t *)item->valp;
(char *)rp < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
rp = (mib2_ipRouteEntry_t *)((char *)rp +
ipRouteEntrySize)) {
aptr = v4a == NULL ? NULL : *v4a++;
@@ -4230,7 +4619,6 @@ ire_report(const mib_item_t *item)
} else {
for (rp6 = (mib2_ipv6RouteEntry_t *)item->valp;
(char *)rp6 < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
rp6 = (mib2_ipv6RouteEntry_t *)((char *)rp6 +
ipv6RouteEntrySize)) {
aptr = v6a == NULL ? NULL : *v6a++;
@@ -4238,7 +4626,7 @@ ire_report(const mib_item_t *item)
print_hdr_once_v6, aptr);
}
}
- } /* 'for' loop 1 ends */
+ }
(void) fflush(stdout);
ire_report_done:
if (v4_attrs != NULL)
@@ -4305,9 +4693,7 @@ v4_addr_match(IpAddress addr, IpAddress mask, const filter_t *fp)
mask = fmask;
}
for (app = fp->u.a.f_address->h_addr_list; (aptr = *app) != NULL; app++)
- /* LINTED: (note 1) */
if (IN6_IS_ADDR_V4MAPPED((in6_addr_t *)aptr)) {
- /* LINTED: (note 1) */
IN6_V4MAPPED_TO_IPADDR((in6_addr_t *)aptr, faddr);
if (((faddr ^ addr) & mask) == 0)
return (B_TRUE);
@@ -4327,39 +4713,36 @@ ire_filter_match_v4(const mib2_ipRouteEntry_t *rp, uint_t flag_b)
filter_t *fp;
int idx;
- /* 'for' loop 1: */
for (idx = 0; idx < NFILTERKEYS; idx++)
if ((fp = filters[idx]) != NULL) {
- /* 'for' loop 2: */
for (; fp != NULL; fp = fp->f_next) {
switch (idx) {
case FK_AF:
if (fp->u.f_family != AF_INET)
- continue; /* 'for' loop 2 */
+ continue;
break;
case FK_OUTIF:
if (!dev_name_match(&rp->ipRouteIfIndex,
fp->u.f_ifname))
- continue; /* 'for' loop 2 */
+ continue;
break;
case FK_DST:
if (!v4_addr_match(rp->ipRouteDest,
rp->ipRouteMask, fp))
- continue; /* 'for' loop 2 */
+ continue;
break;
case FK_FLAGS:
if ((flag_b & fp->u.f.f_flagset) !=
fp->u.f.f_flagset ||
(flag_b & fp->u.f.f_flagclear))
- continue; /* 'for' loop 2 */
+ continue;
break;
}
break;
- } /* 'for' loop 2 ends */
+ }
if (fp == NULL)
return (B_FALSE);
}
- /* 'for' loop 1 ends */
return (B_TRUE);
}
@@ -4425,20 +4808,74 @@ form_v4_route_flags(const mib2_ipRouteEntry_t *rp, char *flags)
return (flag_b);
}
+/*
+ * Central definitions for the columns used in the reports.
+ * For each column, there's a definition for the heading, the underline and
+ * the formatted value.
+ * Since most reports select different columns depending on command line
+ * options, defining everything here avoids duplication in the report
+ * format strings and makes it easy to make changes as necessary.
+ */
+#define IRE_V4_DEST " Destination "
+#define IRE_V4_DEST_ "--------------------"
+#define IRE_V4_DEST_F "%-20s"
+#define IRE_V4_MASK " Mask "
+#define IRE_V4_MASK_ "---------------"
+#define IRE_V4_MASK_F "%-15s"
+#define IRE_V4_GATEWAY " Gateway "
+#define IRE_V4_GATEWAY_ "--------------------"
+#define IRE_V4_GATEWAY_F "%-20s"
+#define IRE_V4_DEVICE "Device"
+#define IRE_V4_DEVICE_ "------"
+#define IRE_V4_DEVICE_F "%-6s"
+#define IRE_V4_MTU " MTU "
+#define IRE_V4_MTU_ "-----"
+#define IRE_V4_MTU_F "%5u"
+#define IRE_V4_REF "Ref"
+#define IRE_V4_REF_ "---"
+#define IRE_V4_REF_F "%3u"
+#define IRE_V4_FLAGS "Flg"
+#define IRE_V4_FLAGS_ "---"
+#define IRE_V4_FLAGS_F "%-4s"
+#define IRE_V4_OUT " Out "
+#define IRE_V4_OUT_ "------"
+#define IRE_V4_OUT_F "%-6s"
+#define IRE_V4_INFWD "In/Fwd"
+#define IRE_V4_INFWD_ "------"
+#define IRE_V4_INFWD_F "%6u"
+#define IRE_V4_LFLAGS "Flags"
+#define IRE_V4_LFLAGS_ "-----"
+#define IRE_V4_LFLAGS_F "%-5s"
+#define IRE_V4_LREF " Ref "
+#define IRE_V4_LREF_ "-----"
+#define IRE_V4_LREF_F " %4u"
+#define IRE_V4_USE " Use "
+#define IRE_V4_USE_ "----------"
+#define IRE_V4_USE_F "%10u"
+#define IRE_V4_INTERFACE "Interface"
+#define IRE_V4_INTERFACE_ "---------"
+#define IRE_V4_INTERFACE_F "%-9s"
+
static const char ire_hdr_v4[] =
"\n%s Table: IPv4\n";
static const char ire_hdr_v4_compat[] =
"\n%s Table:\n";
+
static const char ire_hdr_v4_verbose[] =
-" Destination Mask Gateway Device "
-" MTU Ref Flg Out In/Fwd %s\n"
-"-------------------- --------------- -------------------- ------ "
-"----- --- --- ----- ------ %s\n";
+ IRE_V4_DEST " " IRE_V4_MASK " " IRE_V4_GATEWAY " " IRE_V4_DEVICE " "
+ IRE_V4_MTU " " IRE_V4_REF " " IRE_V4_FLAGS " "
+ IRE_V4_OUT " " IRE_V4_INFWD " %s\n"
+ IRE_V4_DEST_" " IRE_V4_MASK_" " IRE_V4_GATEWAY_" " IRE_V4_DEVICE_" "
+ IRE_V4_MTU_" " IRE_V4_REF_" " IRE_V4_FLAGS_" "
+ IRE_V4_OUT_" " IRE_V4_INFWD_" %s\n";
static const char ire_hdr_v4_normal[] =
-" Destination Gateway Flags Ref Use Interface"
-" %s\n-------------------- -------------------- ----- ----- ---------- "
-"--------- %s\n";
+ IRE_V4_DEST " " IRE_V4_GATEWAY " "
+ IRE_V4_LFLAGS " " IRE_V4_LREF " " IRE_V4_USE " "
+ IRE_V4_INTERFACE " %s\n"
+ IRE_V4_DEST_" " IRE_V4_GATEWAY_" "
+ IRE_V4_LFLAGS_" " IRE_V4_LREF_" " IRE_V4_USE_" "
+ IRE_V4_INTERFACE_" %s\n";
static boolean_t
ire_report_item_v4(const mib2_ipRouteEntry_t *rp, boolean_t first,
@@ -4480,8 +4917,10 @@ ire_report_item_v4(const mib2_ipRouteEntry_t *rp, boolean_t first,
dstbuf, sizeof (dstbuf));
}
if (Vflag) {
- (void) printf("%-20s %-15s %-20s %-6s %5u %3u "
- "%-4s%6u %6u %s\n",
+ (void) printf(
+ IRE_V4_DEST_F " " IRE_V4_MASK_F " " IRE_V4_GATEWAY_F " "
+ IRE_V4_DEVICE_F " " IRE_V4_MTU_F " " IRE_V4_REF_F " "
+ IRE_V4_FLAGS_F IRE_V4_INFWD_F " " IRE_V4_INFWD_F " %s\n",
dstbuf,
pr_mask(rp->ipRouteMask, maskbuf, sizeof (maskbuf)),
pr_addrnz(rp->ipRouteNextHop, gwbuf, sizeof (gwbuf)),
@@ -4493,7 +4932,10 @@ ire_report_item_v4(const mib2_ipRouteEntry_t *rp, boolean_t first,
rp->ipRouteInfo.re_ibpkt,
pr_secattr(attrs));
} else {
- (void) printf("%-20s %-20s %-5s %4u %10u %-9s %s\n",
+ (void) printf(
+ IRE_V4_DEST_F " " IRE_V4_GATEWAY_F " "
+ IRE_V4_LFLAGS_F " " IRE_V4_LREF_F " "
+ IRE_V4_USE_F " " IRE_V4_INTERFACE_F " %s\n",
dstbuf,
pr_addrnz(rp->ipRouteNextHop, gwbuf, sizeof (gwbuf)),
flags,
@@ -4530,36 +4972,33 @@ v6_addr_match(const Ip6Address *addr, int masklen, const filter_t *fp)
return (IN6_IS_ADDR_UNSPECIFIED(addr)); /* "none" */
}
fmasklen = 0;
- /* 'for' loop 1a: */
for (ucp = fp->u.a.f_mask.s6_addr;
ucp < fp->u.a.f_mask.s6_addr + sizeof (fp->u.a.f_mask.s6_addr);
ucp++) {
if (*ucp != 0xff) {
if (*ucp != 0)
fmasklen += 9 - ffs(*ucp);
- break; /* 'for' loop 1a */
+ break;
}
fmasklen += 8;
- } /* 'for' loop 1a ends */
+ }
if (fmasklen != IPV6_ABITS) {
if (fmasklen > masklen)
return (B_FALSE);
masklen = fmasklen;
}
- /* 'for' loop 1b: */
for (app = fp->u.a.f_address->h_addr_list;
(aptr = (uint8_t *)*app) != NULL; app++) {
- /* LINTED: (note 1) */
if (IN6_IS_ADDR_V4MAPPED((in6_addr_t *)aptr))
- continue; /* 'for' loop 1b */
+ continue;
ucp = addr->s6_addr;
for (i = masklen; i >= 8; i -= 8)
if (*ucp++ != *aptr++)
- break; /* 'for' loop 1b */
+ break;
if (i == 0 ||
(i < 8 && ((*ucp ^ *aptr) & ~(0xff >> i)) == 0))
return (B_TRUE);
- } /* 'for' loop 1b ends */
+ }
return (B_FALSE);
}
@@ -4576,43 +5015,36 @@ ire_filter_match_v6(const mib2_ipv6RouteEntry_t *rp6, uint_t flag_b)
filter_t *fp;
int idx;
- /* 'for' loop 1: */
for (idx = 0; idx < NFILTERKEYS; idx++)
if ((fp = filters[idx]) != NULL) {
- /* 'for' loop 2: */
for (; fp != NULL; fp = fp->f_next) {
switch (idx) {
case FK_AF:
if (fp->u.f_family != AF_INET6)
- /* 'for' loop 2 */
continue;
break;
case FK_OUTIF:
if (!dev_name_match(&rp6->
ipv6RouteIfIndex, fp->u.f_ifname))
- /* 'for' loop 2 */
continue;
break;
case FK_DST:
if (!v6_addr_match(&rp6->ipv6RouteDest,
rp6->ipv6RoutePfxLength, fp))
- /* 'for' loop 2 */
continue;
break;
case FK_FLAGS:
if ((flag_b & fp->u.f.f_flagset) !=
fp->u.f.f_flagset ||
(flag_b & fp->u.f.f_flagclear))
- /* 'for' loop 2 */
continue;
break;
}
break;
- } /* 'for' loop 2 ends */
+ }
if (fp == NULL)
return (B_FALSE);
}
- /* 'for' loop 1 ends */
return (B_TRUE);
}
@@ -4676,18 +5108,54 @@ form_v6_route_flags(const mib2_ipv6RouteEntry_t *rp6, char *flags)
return (flag_b);
}
+/*
+ * Central definitions for the columns used in the reports.
+ * For each column, there's a definition for the heading, the underline and
+ * the formatted value.
+ * Since most reports select different columns depending on command line
+ * options, defining everything here avoids duplication in the report
+ * format strings and makes it easy to make changes as necessary.
+ */
+#define IRE_V6_DEST " Destination/Mask "
+#define IRE_V6_DEST_ "---------------------------"
+#define IRE_V6_DEST_F "%-27s"
+#define IRE_V6_GATEWAY " Gateway "
+#define IRE_V6_GATEWAY_ "---------------------------"
+#define IRE_V6_GATEWAY_F "%-27s"
+#define IRE_V6_IF " If "
+#define IRE_V6_IF_ "-----"
+#define IRE_V6_IF_F "%-5s"
+#define IRE_V6_MTU " MTU "
+#define IRE_V6_MTU_ "-----"
+#define IRE_V6_MTU_F "%5u"
+#define IRE_V6_REF "Ref"
+#define IRE_V6_REF_ "---"
+#define IRE_V6_REF_F "%3u"
+#define IRE_V6_USE " Use "
+#define IRE_V6_USE_ "-------"
+#define IRE_V6_USE_F "%7u"
+#define IRE_V6_FLAGS "Flags"
+#define IRE_V6_FLAGS_ "-----"
+#define IRE_V6_FLAGS_F "%-5s"
+#define IRE_V6_OUT " Out "
+#define IRE_V6_OUT_ "------"
+#define IRE_V6_OUT_F "%6u"
+#define IRE_V6_INFWD "In/Fwd"
+#define IRE_V6_INFWD_ "------"
+#define IRE_V6_INFWD_F "%6u"
+
static const char ire_hdr_v6[] =
"\n%s Table: IPv6\n";
static const char ire_hdr_v6_verbose[] =
-" Destination/Mask Gateway If MTU "
-"Ref Flags Out In/Fwd %s\n"
-"--------------------------- --------------------------- ----- ----- "
-"--- ----- ------ ------ %s\n";
+ IRE_V6_DEST " " IRE_V6_GATEWAY " " IRE_V6_IF " " IRE_V6_MTU " "
+ IRE_V6_REF " " IRE_V6_FLAGS " " IRE_V6_OUT " " IRE_V6_INFWD " %s\n"
+ IRE_V6_DEST_" " IRE_V6_GATEWAY_" " IRE_V6_IF_" " IRE_V6_MTU_" "
+ IRE_V6_REF_" " IRE_V6_FLAGS_" " IRE_V6_OUT_" " IRE_V6_INFWD_" %s\n";
static const char ire_hdr_v6_normal[] =
-" Destination/Mask Gateway Flags Ref Use "
-" If %s\n"
-"--------------------------- --------------------------- ----- --- ------- "
-"----- %s\n";
+ IRE_V6_DEST " " IRE_V6_GATEWAY " "
+ IRE_V6_FLAGS " " IRE_V6_REF " " IRE_V6_USE " " IRE_V6_IF " %s\n"
+ IRE_V6_DEST_" " IRE_V6_GATEWAY_" "
+ IRE_V6_FLAGS_" " IRE_V6_REF_" " IRE_V6_USE_" " IRE_V6_IF_" %s\n";
static boolean_t
ire_report_item_v6(const mib2_ipv6RouteEntry_t *rp6, boolean_t first,
@@ -4720,8 +5188,10 @@ ire_report_item_v6(const mib2_ipv6RouteEntry_t *rp6, boolean_t first,
}
if (Vflag) {
- (void) printf("%-27s %-27s %-5s %5u %3u "
- "%-5s %6u %6u %s\n",
+ (void) printf(
+ IRE_V6_DEST_F " " IRE_V6_GATEWAY_F " "
+ IRE_V6_IF_F " " IRE_V6_MTU_F " " IRE_V6_REF_F " "
+ IRE_V6_FLAGS_F " " IRE_V6_OUT_F " " IRE_V6_INFWD_F " %s\n",
pr_prefix6(&rp6->ipv6RouteDest,
rp6->ipv6RoutePfxLength, dstbuf, sizeof (dstbuf)),
IN6_IS_ADDR_UNSPECIFIED(&rp6->ipv6RouteNextHop) ?
@@ -4736,7 +5206,10 @@ ire_report_item_v6(const mib2_ipv6RouteEntry_t *rp6, boolean_t first,
rp6->ipv6RouteInfo.re_ibpkt,
pr_secattr(attrs));
} else {
- (void) printf("%-27s %-27s %-5s %3u %7u %-5s %s\n",
+ (void) printf(
+ IRE_V6_DEST_F " " IRE_V6_GATEWAY_F " "
+ IRE_V6_FLAGS_F " " IRE_V6_REF_F " "
+ IRE_V6_USE_F " " IRE_V6_IF_F " %s\n",
pr_prefix6(&rp6->ipv6RouteDest,
rp6->ipv6RoutePfxLength, dstbuf, sizeof (dstbuf)),
IN6_IS_ADDR_UNSPECIFIED(&rp6->ipv6RouteNextHop) ?
@@ -4758,26 +5231,36 @@ ire_report_item_v6(const mib2_ipv6RouteEntry_t *rp6, boolean_t first,
static mib2_transportMLPEntry_t **
gather_attrs(const mib_item_t *item, int group, int mib_id, int esize)
{
- int transport_count = 0;
+ size_t transport_count = 0;
const mib_item_t *iptr;
mib2_transportMLPEntry_t **attrs, *tme;
for (iptr = item; iptr != NULL; iptr = iptr->next_item) {
- if (iptr->group == group && iptr->mib_id == mib_id)
- transport_count += iptr->length / esize;
+ if (iptr->group == group && iptr->mib_id == mib_id) {
+ size_t els = iptr->length / esize;
+ if (transport_count > SIZE_MAX - els) {
+ fprintf(stderr, "Connection table too large\n");
+ return (NULL);
+ } else {
+ transport_count += els;
+ }
+ }
}
- if (transport_count <= 0)
+
+ if (transport_count == 0)
return (NULL);
- attrs = calloc(transport_count, sizeof (*attrs));
+
+ attrs = recallocarray(NULL, 0, transport_count, sizeof (*attrs));
+
if (attrs == NULL) {
- perror("gather_attrs calloc failed");
+ perror("gather_attrs allocation failed");
return (NULL);
}
+
for (iptr = item; iptr != NULL; iptr = iptr->next_item) {
if (iptr->group == group && iptr->mib_id == EXPER_XPORT_MLP) {
for (tme = iptr->valp;
(char *)tme < (char *)iptr->valp + iptr->length;
- /* LINTED: (note 1) */
tme = (mib2_transportMLPEntry_t *)((char *)tme +
transportMLPSize)) {
attrs[tme->tme_connidx] = tme;
@@ -4788,6 +5271,89 @@ gather_attrs(const mib_item_t *item, int group, int mib_id, int esize)
}
static void
+sie_report(const mib2_socketInfoEntry_t *sie)
+{
+ if (sie == NULL)
+ return;
+
+ (void) printf("INFO[%" PRIu64 "] = "
+ "inode %" PRIu64 ", "
+ "major %" PRIx32 ", "
+ "flags %#" PRIx64 "\n",
+ sie->sie_connidx, sie->sie_inode,
+ major((dev_t)sie->sie_dev), sie->sie_flags);
+}
+
+/*
+ * Common info-gathering routine for all transports.
+ *
+ * The linked list of MIB data pointed to by item consists of a number of
+ * tables covering several protocol families and socket types, one after
+ * another. These are generally tables containing information about network
+ * connections, such as mib2_tcpConnEntry, as defined in RFC 1213/4022.
+ *
+ * There are also ancilliary tables which contain optional additional
+ * information about each socket. The data in these ancilliary tables is
+ * indexed by the table position of the connection to which it relates, and
+ * data may not be available for all connections.
+ *
+ * The code here determines the size of the connection table, allocates an
+ * array of that size to hold the ancilliary data and then fills that in
+ * if data is present.
+ *
+ * As an example, if the data contains a mib2_tcpConnEntry table containing
+ * three connections, but there is no ancilliary data for the second, then
+ * the accompanying mib2_socketInfoEntry table will only contain two entries.
+ * However, the first entry is tagged as referring to connection slot 0, and
+ * the second is tagged with connection slot 2.
+ * This function would return an array with:
+ * { <data for conn0>, NULL, <data for conn2> }
+ *
+ */
+static mib2_socketInfoEntry_t **
+gather_info(const mib_item_t *item, int group, int mib_id, int esize)
+{
+ size_t transport_count = 0;
+ const mib_item_t *iptr;
+ mib2_socketInfoEntry_t **info, *sie;
+
+ for (iptr = item; iptr != NULL; iptr = iptr->next_item) {
+ if (iptr->group == group && iptr->mib_id == mib_id) {
+ size_t els = iptr->length / esize;
+ if (transport_count > SIZE_MAX - els) {
+ fprintf(stderr, "Connection table too large\n");
+ return (NULL);
+ } else {
+ transport_count += els;
+ }
+ }
+ }
+
+ if (transport_count == 0)
+ return (NULL);
+
+ info = recallocarray(NULL, 0, transport_count, sizeof (*info));
+
+ if (info == NULL) {
+ perror("gather_info allocation failed");
+ return (NULL);
+ }
+
+ for (iptr = item; iptr != NULL; iptr = iptr->next_item) {
+ if (iptr->group != group || iptr->mib_id != EXPER_SOCK_INFO)
+ continue;
+
+ for (sie = (mib2_socketInfoEntry_t *)iptr->valp;
+ (uintptr_t)sie < (uintptr_t)iptr->valp + iptr->length;
+ sie++) {
+ assert(sie->sie_connidx < transport_count);
+ info[sie->sie_connidx] = sie;
+ }
+ }
+ return (info);
+}
+
+static void
print_transport_label(const mib2_transportMLPEntry_t *attr)
{
if (!RSECflag || attr == NULL ||
@@ -4811,55 +5377,226 @@ static const char tcp_hdr_v4[] =
"\nTCP: IPv4\n";
static const char tcp_hdr_v4_compat[] =
"\nTCP\n";
-static const char tcp_hdr_v4_verbose[] =
-"Local/Remote Address Swind Snext Suna Rwind Rnext Rack "
-" Rto Mss State\n"
-"-------------------- ----- -------- -------- ----- -------- -------- "
-"----- ----- -----------\n";
+
+/*
+ * Central definitions for the columns used in the reports.
+ * For each column, there's a definition for the heading, the underline and
+ * the formatted value.
+ * Since most reports select different columns depending on command line
+ * options, defining everything here avoids duplication in the report
+ * format strings and makes it easy to make changes as necessary.
+ */
+#define TCP_V4_LOCAL " Local Address "
+#define TCP_V4_LOCAL_ "--------------------"
+#define TCP_V4_LOCAL_F "%-20s"
+#define TCP_V4_REMOTE " Remote Address "
+#define TCP_V4_REMOTE_ "--------------------"
+#define TCP_V4_REMOTE_F "%-20s"
+#define TCP_V4_ADDRESS "Local/Remote Address"
+#define TCP_V4_ADDRESS_ "--------------------"
+#define TCP_V4_ADDRESS_F "%-20s"
+#define TCP_V4_SWIND "Swind "
+#define TCP_V4_SWIND_ "------"
+#define TCP_V4_SWIND_F "%6u"
+#define TCP_V4_SENDQ "Send-Q"
+#define TCP_V4_SENDQ_ "------"
+#define TCP_V4_SENDQ_F "%6" PRId64
+#define TCP_V4_RWIND "Rwind "
+#define TCP_V4_RWIND_ "------"
+#define TCP_V4_RWIND_F "%6u"
+#define TCP_V4_RECVQ "Recv-Q"
+#define TCP_V4_RECVQ_ "------"
+#define TCP_V4_RECVQ_F "%6" PRId64
+#define TCP_V4_SNEXT " Snext "
+#define TCP_V4_SNEXT_ "--------"
+#define TCP_V4_SNEXT_F "%08x"
+#define TCP_V4_SUNA " Suna "
+#define TCP_V4_SUNA_ "--------"
+#define TCP_V4_SUNA_F "%08x"
+#define TCP_V4_RNEXT " Rnext "
+#define TCP_V4_RNEXT_ "--------"
+#define TCP_V4_RNEXT_F "%08x"
+#define TCP_V4_RACK " Rack "
+#define TCP_V4_RACK_ "--------"
+#define TCP_V4_RACK_F "%08x"
+#define TCP_V4_RTO " Rto "
+#define TCP_V4_RTO_ "-----"
+#define TCP_V4_RTO_F "%5u"
+#define TCP_V4_MSS " Mss "
+#define TCP_V4_MSS_ "-----"
+#define TCP_V4_MSS_F "%5u"
+#define TCP_V4_STATE " State "
+#define TCP_V4_STATE_ "-----------"
+#define TCP_V4_STATE_F "%-11s"
+#define TCP_V4_USER " User "
+#define TCP_V4_USER_ "--------"
+#define TCP_V4_USER_F "%-8.8s"
+#define TCP_V4_PID " Pid "
+#define TCP_V4_PID_ "------"
+#define TCP_V4_PID_F "%6s"
+#define TCP_V4_COMMAND " Command "
+#define TCP_V4_COMMAND_ "--------------"
+#define TCP_V4_COMMAND_F "%-14.14s"
+
static const char tcp_hdr_v4_normal[] =
-" Local Address Remote Address Swind Send-Q Rwind Recv-Q "
-" State\n"
-"-------------------- -------------------- ----- ------ ----- ------ "
-"-----------\n";
+ TCP_V4_LOCAL " " TCP_V4_REMOTE " "
+ TCP_V4_SWIND " " TCP_V4_SENDQ " " TCP_V4_RWIND " " TCP_V4_RECVQ " "
+ TCP_V4_STATE "\n"
+ TCP_V4_LOCAL_" " TCP_V4_REMOTE_" "
+ TCP_V4_SWIND_" " TCP_V4_SENDQ_" " TCP_V4_RWIND_" " TCP_V4_RECVQ_" "
+ TCP_V4_STATE_"\n";
+static const char tcp_hdr_v4_normal_pid[] =
+ TCP_V4_LOCAL " " TCP_V4_REMOTE " "
+ TCP_V4_USER " " TCP_V4_PID " " TCP_V4_COMMAND " "
+ TCP_V4_SWIND " " TCP_V4_SENDQ " " TCP_V4_RWIND " " TCP_V4_RECVQ " "
+ TCP_V4_STATE "\n"
+ TCP_V4_LOCAL_" " TCP_V4_REMOTE_" "
+ TCP_V4_USER_" " TCP_V4_PID_" " TCP_V4_COMMAND_" "
+ TCP_V4_SWIND_" " TCP_V4_SENDQ_" " TCP_V4_RWIND_" " TCP_V4_RECVQ_" "
+ TCP_V4_STATE_"\n";
+static const char tcp_hdr_v4_verbose[] =
+ TCP_V4_ADDRESS " "
+ TCP_V4_SWIND " " TCP_V4_SNEXT " " TCP_V4_SUNA " "
+ TCP_V4_RWIND " " TCP_V4_RNEXT " " TCP_V4_RACK " "
+ TCP_V4_RTO " " TCP_V4_MSS " " TCP_V4_STATE "\n"
+ TCP_V4_ADDRESS_" "
+ TCP_V4_SWIND_" " TCP_V4_SNEXT_" " TCP_V4_SUNA_" "
+ TCP_V4_RWIND_" " TCP_V4_RNEXT_" " TCP_V4_RACK_" "
+ TCP_V4_RTO_" " TCP_V4_MSS_" " TCP_V4_STATE_"\n";
+static const char tcp_hdr_v4_verbose_pid[] =
+ TCP_V4_ADDRESS " "
+ TCP_V4_SWIND " " TCP_V4_SNEXT " " TCP_V4_SUNA " "
+ TCP_V4_RWIND " " TCP_V4_RNEXT " " TCP_V4_RACK " "
+ TCP_V4_RTO " " TCP_V4_MSS " " TCP_V4_STATE " "
+ TCP_V4_USER " " TCP_V4_PID " " TCP_V4_COMMAND "\n"
+ TCP_V4_ADDRESS_" "
+ TCP_V4_SWIND_" " TCP_V4_SNEXT_" " TCP_V4_SUNA_" "
+ TCP_V4_RWIND_" " TCP_V4_RNEXT_" " TCP_V4_RACK_" "
+ TCP_V4_RTO_" " TCP_V4_MSS_" " TCP_V4_STATE_" "
+ TCP_V4_USER_" " TCP_V4_PID_" " TCP_V4_COMMAND_"\n";
+
+#define TCP_V6_LOCAL " Local Address "
+#define TCP_V6_LOCAL_ "---------------------------------"
+#define TCP_V6_LOCAL_F "%-33s"
+#define TCP_V6_REMOTE " Remote Address "
+#define TCP_V6_REMOTE_ "---------------------------------"
+#define TCP_V6_REMOTE_F "%-33s"
+#define TCP_V6_ADDRESS "Local/Remote Address "
+#define TCP_V6_ADDRESS_ "---------------------------------"
+#define TCP_V6_ADDRESS_F "%-33s"
+#define TCP_V6_IF " If "
+#define TCP_V6_IF_ "-----"
+#define TCP_V6_IF_F "%-5.5s"
+#define TCP_V6_SWIND TCP_V4_SWIND
+#define TCP_V6_SWIND_ TCP_V4_SWIND_
+#define TCP_V6_SWIND_F TCP_V4_SWIND_F
+#define TCP_V6_SENDQ TCP_V4_SENDQ
+#define TCP_V6_SENDQ_ TCP_V4_SENDQ_
+#define TCP_V6_SENDQ_F TCP_V4_SENDQ_F
+#define TCP_V6_RWIND TCP_V4_RWIND
+#define TCP_V6_RWIND_ TCP_V4_RWIND_
+#define TCP_V6_RWIND_F TCP_V4_RWIND_F
+#define TCP_V6_RECVQ TCP_V4_RECVQ
+#define TCP_V6_RECVQ_ TCP_V4_RECVQ_
+#define TCP_V6_RECVQ_F TCP_V4_RECVQ_F
+#define TCP_V6_SNEXT TCP_V4_SNEXT
+#define TCP_V6_SNEXT_ TCP_V4_SNEXT_
+#define TCP_V6_SNEXT_F TCP_V4_SNEXT_F
+#define TCP_V6_SUNA TCP_V4_SUNA
+#define TCP_V6_SUNA_ TCP_V4_SUNA_
+#define TCP_V6_SUNA_F TCP_V4_SUNA_F
+#define TCP_V6_RNEXT TCP_V4_RNEXT
+#define TCP_V6_RNEXT_ TCP_V4_RNEXT_
+#define TCP_V6_RNEXT_F TCP_V4_RNEXT_F
+#define TCP_V6_RACK TCP_V4_RACK
+#define TCP_V6_RACK_ TCP_V4_RACK_
+#define TCP_V6_RACK_F TCP_V4_RACK_F
+#define TCP_V6_RTO TCP_V4_RTO
+#define TCP_V6_RTO_ TCP_V4_RTO_
+#define TCP_V6_RTO_F TCP_V4_RTO_F
+#define TCP_V6_MSS TCP_V4_MSS
+#define TCP_V6_MSS_ TCP_V4_MSS_
+#define TCP_V6_MSS_F TCP_V4_MSS_F
+#define TCP_V6_STATE TCP_V4_STATE
+#define TCP_V6_STATE_ TCP_V4_STATE_
+#define TCP_V6_STATE_F TCP_V4_STATE_F
+#define TCP_V6_USER TCP_V4_USER
+#define TCP_V6_USER_ TCP_V4_USER_
+#define TCP_V6_USER_F TCP_V4_USER_F
+#define TCP_V6_PID TCP_V4_PID
+#define TCP_V6_PID_ TCP_V4_PID_
+#define TCP_V6_PID_F TCP_V4_PID_F
+#define TCP_V6_COMMAND TCP_V4_COMMAND
+#define TCP_V6_COMMAND_ TCP_V4_COMMAND_
+#define TCP_V6_COMMAND_F TCP_V4_COMMAND_F
static const char tcp_hdr_v6[] =
"\nTCP: IPv6\n";
-static const char tcp_hdr_v6_verbose[] =
-"Local/Remote Address Swind Snext Suna Rwind Rnext "
-" Rack Rto Mss State If\n"
-"--------------------------------- ----- -------- -------- ----- -------- "
-"-------- ----- ----- ----------- -----\n";
static const char tcp_hdr_v6_normal[] =
-" Local Address Remote Address "
-"Swind Send-Q Rwind Recv-Q State If\n"
-"--------------------------------- --------------------------------- "
-"----- ------ ----- ------ ----------- -----\n";
+ TCP_V6_LOCAL " " TCP_V6_REMOTE " "
+ TCP_V6_SWIND " " TCP_V6_SENDQ " " TCP_V6_RWIND " " TCP_V6_RECVQ " "
+ TCP_V6_STATE " " TCP_V6_IF "\n"
+ TCP_V6_LOCAL_" " TCP_V6_REMOTE_" "
+ TCP_V6_SWIND_" " TCP_V6_SENDQ_" " TCP_V6_RWIND_" " TCP_V6_RECVQ_" "
+ TCP_V6_STATE_" " TCP_V6_IF_"\n";
+static const char tcp_hdr_v6_normal_pid[] =
+ TCP_V6_LOCAL " " TCP_V6_REMOTE " "
+ TCP_V6_USER " " TCP_V6_PID " " TCP_V6_COMMAND " "
+ TCP_V6_SWIND " " TCP_V6_SENDQ " " TCP_V6_RWIND " " TCP_V6_RECVQ " "
+ TCP_V6_STATE " " TCP_V6_IF "\n"
+ TCP_V6_LOCAL_" " TCP_V6_REMOTE_" "
+ TCP_V6_USER_" " TCP_V6_PID_" " TCP_V6_COMMAND_" "
+ TCP_V6_SWIND_" " TCP_V6_SENDQ_" " TCP_V6_RWIND_" " TCP_V6_RECVQ_" "
+ TCP_V6_STATE_" " TCP_V6_IF_"\n";
+static const char tcp_hdr_v6_verbose[] =
+ TCP_V6_ADDRESS " "
+ TCP_V6_SWIND " " TCP_V6_SNEXT " " TCP_V6_SUNA " "
+ TCP_V6_RWIND " " TCP_V6_RNEXT " " TCP_V6_RACK " "
+ TCP_V6_RTO " " TCP_V6_MSS " " TCP_V6_STATE " " TCP_V6_IF "\n"
+ TCP_V6_ADDRESS_" "
+ TCP_V6_SWIND_" " TCP_V6_SNEXT_" " TCP_V6_SUNA_" "
+ TCP_V6_RWIND_" " TCP_V6_RNEXT_" " TCP_V6_RACK_" "
+ TCP_V6_RTO_" " TCP_V6_MSS_" " TCP_V6_STATE_" " TCP_V6_IF_"\n";
+static const char tcp_hdr_v6_verbose_pid[] =
+ TCP_V6_ADDRESS " "
+ TCP_V6_SWIND " " TCP_V6_SNEXT " " TCP_V6_SUNA " "
+ TCP_V6_RWIND " " TCP_V6_RNEXT " " TCP_V6_RACK " "
+ TCP_V6_RTO " " TCP_V6_MSS " " TCP_V6_STATE " " TCP_V6_IF " "
+ TCP_V6_USER " " TCP_V6_PID " " TCP_V6_COMMAND "\n"
+ TCP_V6_ADDRESS_" "
+ TCP_V6_SWIND_" " TCP_V6_SNEXT_" " TCP_V6_SUNA_" "
+ TCP_V6_RWIND_" " TCP_V6_RNEXT_" " TCP_V6_RACK_" "
+ TCP_V6_RTO_" " TCP_V6_MSS_" " TCP_V6_STATE_" " TCP_V6_IF_" "
+ TCP_V6_USER_" " TCP_V6_PID_" " TCP_V6_COMMAND_"\n";
static boolean_t tcp_report_item_v4(const mib2_tcpConnEntry_t *,
- boolean_t first, const mib2_transportMLPEntry_t *);
+ boolean_t first, const mib2_transportMLPEntry_t *,
+ const mib2_socketInfoEntry_t *);
static boolean_t tcp_report_item_v6(const mib2_tcp6ConnEntry_t *,
- boolean_t first, const mib2_transportMLPEntry_t *);
+ boolean_t first, const mib2_transportMLPEntry_t *,
+ const mib2_socketInfoEntry_t *);
static void
tcp_report(const mib_item_t *item)
{
- int jtemp = 0;
- boolean_t print_hdr_once_v4 = B_TRUE;
- boolean_t print_hdr_once_v6 = B_TRUE;
- mib2_tcpConnEntry_t *tp;
- mib2_tcp6ConnEntry_t *tp6;
- mib2_transportMLPEntry_t **v4_attrs, **v6_attrs;
- mib2_transportMLPEntry_t **v4a, **v6a;
- mib2_transportMLPEntry_t *aptr;
+ int jtemp = 0;
+ boolean_t print_hdr_once_v4 = B_TRUE;
+ boolean_t print_hdr_once_v6 = B_TRUE;
+ mib2_tcpConnEntry_t *tp;
+ mib2_tcp6ConnEntry_t *tp6;
+ mib2_transportMLPEntry_t **v4_attrs, **v6_attrs, **v4a, **v6a;
+ mib2_transportMLPEntry_t *aptr;
+ mib2_socketInfoEntry_t **v4_info, **v6_info, **v4i, **v6i;
+ mib2_socketInfoEntry_t *iptr;
if (!protocol_selected(IPPROTO_TCP))
return;
/*
* Preparation pass: the kernel returns separate entries for TCP
- * connection table entries and Multilevel Port attributes. We loop
- * through the attributes first and set up an array for each address
- * family.
+ * connection table entries, Multilevel Port attributes and extra
+ * socket information. We loop through the attributes first and set up
+ * an array for each address family.
*/
v4_attrs = family_selected(AF_INET) && RSECflag ?
gather_attrs(item, MIB2_TCP, MIB2_TCP_CONN, tcpConnEntrySize) :
@@ -4868,14 +5605,21 @@ tcp_report(const mib_item_t *item)
gather_attrs(item, MIB2_TCP6, MIB2_TCP6_CONN, tcp6ConnEntrySize) :
NULL;
- /* 'for' loop 1: */
+ v4_info = Uflag && family_selected(AF_INET) ?
+ gather_info(item, MIB2_TCP, MIB2_TCP_CONN, tcpConnEntrySize) :
+ NULL;
+ v6_info = Uflag && family_selected(AF_INET6) ?
+ gather_info(item, MIB2_TCP6, MIB2_TCP6_CONN, tcp6ConnEntrySize) :
+ NULL;
+
v4a = v4_attrs;
v6a = v6_attrs;
+ v4i = v4_info;
+ v6i = v6_info;
for (; item != NULL; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id,
item->length, item->valp);
}
@@ -4884,46 +5628,46 @@ tcp_report(const mib_item_t *item)
item->mib_id == MIB2_TCP_CONN) ||
(item->group == MIB2_TCP6 &&
item->mib_id == MIB2_TCP6_CONN)))
- continue; /* 'for' loop 1 */
+ continue;
if (item->group == MIB2_TCP && !family_selected(AF_INET))
- continue; /* 'for' loop 1 */
- else if (item->group == MIB2_TCP6 && !family_selected(AF_INET6))
- continue; /* 'for' loop 1 */
+ continue;
+ if (item->group == MIB2_TCP6 && !family_selected(AF_INET6))
+ continue;
if (item->group == MIB2_TCP) {
for (tp = (mib2_tcpConnEntry_t *)item->valp;
(char *)tp < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
tp = (mib2_tcpConnEntry_t *)((char *)tp +
tcpConnEntrySize)) {
aptr = v4a == NULL ? NULL : *v4a++;
+ iptr = v4i == NULL ? NULL : *v4i++;
print_hdr_once_v4 = tcp_report_item_v4(tp,
- print_hdr_once_v4, aptr);
+ print_hdr_once_v4, aptr, iptr);
}
} else {
for (tp6 = (mib2_tcp6ConnEntry_t *)item->valp;
(char *)tp6 < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
tp6 = (mib2_tcp6ConnEntry_t *)((char *)tp6 +
tcp6ConnEntrySize)) {
aptr = v6a == NULL ? NULL : *v6a++;
+ iptr = v6i == NULL ? NULL : *v6i++;
print_hdr_once_v6 = tcp_report_item_v6(tp6,
- print_hdr_once_v6, aptr);
+ print_hdr_once_v6, aptr, iptr);
}
}
- } /* 'for' loop 1 ends */
+ }
(void) fflush(stdout);
- if (v4_attrs != NULL)
- free(v4_attrs);
- if (v6_attrs != NULL)
- free(v6_attrs);
+ free(v4_attrs);
+ free(v6_attrs);
+ free(v4_info);
+ free(v6_info);
}
static boolean_t
tcp_report_item_v4(const mib2_tcpConnEntry_t *tp, boolean_t first,
- const mib2_transportMLPEntry_t *attr)
+ const mib2_transportMLPEntry_t *attr, const mib2_socketInfoEntry_t *sie)
{
/*
* lname and fname below are for the hostname as well as the portname
@@ -4932,18 +5676,44 @@ tcp_report_item_v4(const mib2_tcpConnEntry_t *tp, boolean_t first,
*/
char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
char fname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
+ proc_fdinfo_t *ph;
if (!(Aflag || tp->tcpConnEntryInfo.ce_state >= TCPS_ESTABLISHED))
return (first); /* Nothing to print */
if (first) {
(void) printf(v4compat ? tcp_hdr_v4_compat : tcp_hdr_v4);
- (void) printf(Vflag ? tcp_hdr_v4_verbose : tcp_hdr_v4_normal);
+ if (Vflag)
+ (void) printf(Uflag ? tcp_hdr_v4_verbose_pid :
+ tcp_hdr_v4_verbose);
+ else
+ (void) printf(Uflag ? tcp_hdr_v4_normal_pid :
+ tcp_hdr_v4_normal);
}
- if (Vflag) {
- (void) printf("%-20s\n%-20s %5u %08x %08x %5u %08x %08x "
- "%5u %5u %s\n",
+ int64_t sq = (int64_t)tp->tcpConnEntryInfo.ce_snxt -
+ (int64_t)tp->tcpConnEntryInfo.ce_suna - 1;
+ int64_t rq = (int64_t)tp->tcpConnEntryInfo.ce_rnxt -
+ (int64_t)tp->tcpConnEntryInfo.ce_rack;
+
+ if (Xflag)
+ sie_report(sie);
+
+ if (Uflag) {
+ ph = process_hash_get(sie, SOCK_STREAM, AF_INET);
+ if (ph->ph_pid == 0 && sie != NULL &&
+ (sie->sie_flags & MIB2_SOCKINFO_IPV6)) {
+ ph = process_hash_get(sie, SOCK_STREAM, AF_INET6);
+ }
+ }
+
+ if (!Uflag && Vflag) {
+ (void) printf(
+ TCP_V4_LOCAL_F "\n" TCP_V4_REMOTE_F " "
+ TCP_V4_SWIND_F " " TCP_V4_SNEXT_F " "
+ TCP_V4_SUNA_F " " TCP_V4_RWIND_F " "
+ TCP_V4_RNEXT_F " " TCP_V4_RACK_F " "
+ TCP_V4_RTO_F " " TCP_V4_MSS_F " %s\n",
pr_ap(tp->tcpConnLocalAddress,
tp->tcpConnLocalPort, "tcp", lname, sizeof (lname)),
pr_ap(tp->tcpConnRemAddress,
@@ -4957,13 +5727,11 @@ tcp_report_item_v4(const mib2_tcpConnEntry_t *tp, boolean_t first,
tp->tcpConnEntryInfo.ce_rto,
tp->tcpConnEntryInfo.ce_mss,
mitcp_state(tp->tcpConnEntryInfo.ce_state, attr));
- } else {
- int sq = (int)tp->tcpConnEntryInfo.ce_snxt -
- (int)tp->tcpConnEntryInfo.ce_suna - 1;
- int rq = (int)tp->tcpConnEntryInfo.ce_rnxt -
- (int)tp->tcpConnEntryInfo.ce_rack;
-
- (void) printf("%-20s %-20s %5u %6d %5u %6d %s\n",
+ } else if (!Uflag) {
+ (void) printf(
+ TCP_V4_LOCAL_F " " TCP_V4_REMOTE_F " "
+ TCP_V4_SWIND_F " " TCP_V4_SENDQ_F " "
+ TCP_V4_RWIND_F " " TCP_V4_RECVQ_F " %s\n",
pr_ap(tp->tcpConnLocalAddress,
tp->tcpConnLocalPort, "tcp", lname, sizeof (lname)),
pr_ap(tp->tcpConnRemAddress,
@@ -4973,6 +5741,50 @@ tcp_report_item_v4(const mib2_tcpConnEntry_t *tp, boolean_t first,
tp->tcpConnEntryInfo.ce_rwnd,
(rq >= 0) ? rq : 0,
mitcp_state(tp->tcpConnEntryInfo.ce_state, attr));
+ } else if (Uflag && Vflag) {
+ for (; ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf(
+ TCP_V4_LOCAL_F "\n" TCP_V4_REMOTE_F " "
+ TCP_V4_SWIND_F " " TCP_V4_SNEXT_F " "
+ TCP_V4_SUNA_F " " TCP_V4_RWIND_F " "
+ TCP_V4_RNEXT_F " " TCP_V4_RACK_F " "
+ TCP_V4_RTO_F " " TCP_V4_MSS_F " "
+ TCP_V4_STATE_F " " TCP_V4_USER_F " "
+ TCP_V4_PID_F " %s\n",
+ pr_ap(tp->tcpConnLocalAddress,
+ tp->tcpConnLocalPort, "tcp", lname, sizeof (lname)),
+ pr_ap(tp->tcpConnRemAddress,
+ tp->tcpConnRemPort, "tcp", fname, sizeof (fname)),
+ tp->tcpConnEntryInfo.ce_swnd,
+ tp->tcpConnEntryInfo.ce_snxt,
+ tp->tcpConnEntryInfo.ce_suna,
+ tp->tcpConnEntryInfo.ce_rwnd,
+ tp->tcpConnEntryInfo.ce_rnxt,
+ tp->tcpConnEntryInfo.ce_rack,
+ tp->tcpConnEntryInfo.ce_rto,
+ tp->tcpConnEntryInfo.ce_mss,
+ mitcp_state(tp->tcpConnEntryInfo.ce_state, attr),
+ ph->ph_username, ph->ph_pidstr, ph->ph_psargs);
+ }
+ } else if (Uflag) {
+ for (; ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf(
+ TCP_V4_LOCAL_F " " TCP_V4_REMOTE_F " "
+ TCP_V4_USER_F " "TCP_V4_PID_F " "
+ TCP_V4_COMMAND_F " "
+ TCP_V4_SWIND_F " " TCP_V4_SENDQ_F " "
+ TCP_V4_RWIND_F " " TCP_V4_RECVQ_F " %s\n",
+ pr_ap(tp->tcpConnLocalAddress,
+ tp->tcpConnLocalPort, "tcp", lname, sizeof (lname)),
+ pr_ap(tp->tcpConnRemAddress,
+ tp->tcpConnRemPort, "tcp", fname, sizeof (fname)),
+ ph->ph_username, ph->ph_pidstr, ph->ph_fname,
+ tp->tcpConnEntryInfo.ce_swnd,
+ (sq >= 0) ? sq : 0,
+ tp->tcpConnEntryInfo.ce_rwnd,
+ (rq >= 0) ? rq : 0,
+ mitcp_state(tp->tcpConnEntryInfo.ce_state, attr));
+ }
}
print_transport_label(attr);
@@ -4982,7 +5794,7 @@ tcp_report_item_v4(const mib2_tcpConnEntry_t *tp, boolean_t first,
static boolean_t
tcp_report_item_v6(const mib2_tcp6ConnEntry_t *tp6, boolean_t first,
- const mib2_transportMLPEntry_t *attr)
+ const mib2_transportMLPEntry_t *attr, const mib2_socketInfoEntry_t *sie)
{
/*
* lname and fname below are for the hostname as well as the portname
@@ -4993,13 +5805,19 @@ tcp_report_item_v6(const mib2_tcp6ConnEntry_t *tp6, boolean_t first,
char fname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
char ifname[LIFNAMSIZ + 1];
char *ifnamep;
+ proc_fdinfo_t *ph;
if (!(Aflag || tp6->tcp6ConnEntryInfo.ce_state >= TCPS_ESTABLISHED))
return (first); /* Nothing to print */
if (first) {
(void) printf(tcp_hdr_v6);
- (void) printf(Vflag ? tcp_hdr_v6_verbose : tcp_hdr_v6_normal);
+ if (Vflag)
+ (void) printf(Uflag ? tcp_hdr_v6_verbose_pid :
+ tcp_hdr_v6_verbose);
+ else
+ (void) printf(Uflag ? tcp_hdr_v6_normal_pid :
+ tcp_hdr_v6_normal);
}
ifnamep = (tp6->tcp6ConnIfIndex != 0) ?
@@ -5007,9 +5825,22 @@ tcp_report_item_v6(const mib2_tcp6ConnEntry_t *tp6, boolean_t first,
if (ifnamep == NULL)
ifnamep = "";
- if (Vflag) {
- (void) printf("%-33s\n%-33s %5u %08x %08x %5u %08x %08x "
- "%5u %5u %-11s %s\n",
+ int64_t sq = (int64_t)tp6->tcp6ConnEntryInfo.ce_snxt -
+ (int64_t)tp6->tcp6ConnEntryInfo.ce_suna - 1;
+ int64_t rq = (int64_t)tp6->tcp6ConnEntryInfo.ce_rnxt -
+ (int64_t)tp6->tcp6ConnEntryInfo.ce_rack;
+
+ if (Xflag)
+ sie_report(sie);
+
+ if (!Uflag && Vflag) {
+ (void) printf(
+ TCP_V6_LOCAL_F "\n" TCP_V6_REMOTE_F " "
+ TCP_V6_SWIND_F " " TCP_V6_SNEXT_F " "
+ TCP_V6_SUNA_F " " TCP_V6_RWIND_F " "
+ TCP_V6_RNEXT_F " " TCP_V6_RACK_F " "
+ TCP_V6_RTO_F " " TCP_V6_MSS_F " "
+ TCP_V6_STATE_F " %s\n",
pr_ap6(&tp6->tcp6ConnLocalAddress,
tp6->tcp6ConnLocalPort, "tcp", lname, sizeof (lname)),
pr_ap6(&tp6->tcp6ConnRemAddress,
@@ -5024,13 +5855,12 @@ tcp_report_item_v6(const mib2_tcp6ConnEntry_t *tp6, boolean_t first,
tp6->tcp6ConnEntryInfo.ce_mss,
mitcp_state(tp6->tcp6ConnEntryInfo.ce_state, attr),
ifnamep);
- } else {
- int sq = (int)tp6->tcp6ConnEntryInfo.ce_snxt -
- (int)tp6->tcp6ConnEntryInfo.ce_suna - 1;
- int rq = (int)tp6->tcp6ConnEntryInfo.ce_rnxt -
- (int)tp6->tcp6ConnEntryInfo.ce_rack;
-
- (void) printf("%-33s %-33s %5u %6d %5u %6d %-11s %s\n",
+ } else if (!Uflag) {
+ (void) printf(
+ TCP_V6_LOCAL_F " " TCP_V6_REMOTE_F " "
+ TCP_V6_SWIND_F " " TCP_V6_SENDQ_F " "
+ TCP_V6_RWIND_F " " TCP_V6_RECVQ_F " "
+ TCP_V6_STATE_F " %s\n",
pr_ap6(&tp6->tcp6ConnLocalAddress,
tp6->tcp6ConnLocalPort, "tcp", lname, sizeof (lname)),
pr_ap6(&tp6->tcp6ConnRemAddress,
@@ -5041,6 +5871,58 @@ tcp_report_item_v6(const mib2_tcp6ConnEntry_t *tp6, boolean_t first,
(rq >= 0) ? rq : 0,
mitcp_state(tp6->tcp6ConnEntryInfo.ce_state, attr),
ifnamep);
+ } else if (Uflag && Vflag) {
+ for (ph = process_hash_get(sie, SOCK_STREAM, AF_INET6);
+ ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf(
+ TCP_V6_LOCAL_F "\n" TCP_V6_REMOTE_F " "
+ TCP_V6_SWIND_F " " TCP_V6_SNEXT_F " "
+ TCP_V6_SUNA_F " " TCP_V6_RWIND_F " "
+ TCP_V6_RNEXT_F " " TCP_V6_RACK_F " "
+ TCP_V6_RTO_F " " TCP_V6_MSS_F " "
+ TCP_V6_STATE_F " " TCP_V6_IF_F " "
+ TCP_V6_USER_F " " TCP_V6_PID_F " %s\n",
+ pr_ap6(&tp6->tcp6ConnLocalAddress,
+ tp6->tcp6ConnLocalPort, "tcp", lname,
+ sizeof (lname)),
+ pr_ap6(&tp6->tcp6ConnRemAddress,
+ tp6->tcp6ConnRemPort, "tcp", fname,
+ sizeof (fname)),
+ tp6->tcp6ConnEntryInfo.ce_swnd,
+ tp6->tcp6ConnEntryInfo.ce_snxt,
+ tp6->tcp6ConnEntryInfo.ce_suna,
+ tp6->tcp6ConnEntryInfo.ce_rwnd,
+ tp6->tcp6ConnEntryInfo.ce_rnxt,
+ tp6->tcp6ConnEntryInfo.ce_rack,
+ tp6->tcp6ConnEntryInfo.ce_rto,
+ tp6->tcp6ConnEntryInfo.ce_mss,
+ mitcp_state(tp6->tcp6ConnEntryInfo.ce_state, attr),
+ ifnamep,
+ ph->ph_username, ph->ph_pidstr, ph->ph_psargs);
+ }
+ } else if (Uflag) {
+ for (ph = process_hash_get(sie, SOCK_STREAM, AF_INET6);
+ ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf(
+ TCP_V6_LOCAL_F " " TCP_V6_REMOTE_F " "
+ TCP_V6_USER_F " " TCP_V6_PID_F " "
+ TCP_V6_COMMAND_F " "
+ TCP_V6_SWIND_F " " TCP_V6_SENDQ_F " "
+ TCP_V6_RWIND_F " " TCP_V6_RECVQ_F " "
+ TCP_V6_STATE_F " %s\n",
+ pr_ap6(&tp6->tcp6ConnLocalAddress,
+ tp6->tcp6ConnLocalPort, "tcp", lname,
+ sizeof (lname)),
+ pr_ap6(&tp6->tcp6ConnRemAddress,
+ tp6->tcp6ConnRemPort, "tcp", fname, sizeof (fname)),
+ ph->ph_username, ph->ph_pidstr, ph->ph_fname,
+ tp6->tcp6ConnEntryInfo.ce_swnd,
+ (sq >= 0) ? sq : 0,
+ tp6->tcp6ConnEntryInfo.ce_rwnd,
+ (rq >= 0) ? rq : 0,
+ mitcp_state(tp6->tcp6ConnEntryInfo.ce_state, attr),
+ ifnamep);
+ }
}
print_transport_label(attr);
@@ -5050,32 +5932,109 @@ tcp_report_item_v6(const mib2_tcp6ConnEntry_t *tp6, boolean_t first,
/* ------------------------------- UDP_REPORT------------------------------- */
-static boolean_t udp_report_item_v4(const mib2_udpEntry_t *ude,
- boolean_t first, const mib2_transportMLPEntry_t *attr);
-static boolean_t udp_report_item_v6(const mib2_udp6Entry_t *ude6,
- boolean_t first, const mib2_transportMLPEntry_t *attr);
+static boolean_t udp_report_item_v4(const mib2_udpEntry_t *, boolean_t,
+ const mib2_transportMLPEntry_t *, const mib2_socketInfoEntry_t *);
+static boolean_t udp_report_item_v6(const mib2_udp6Entry_t *, boolean_t,
+ const mib2_transportMLPEntry_t *, const mib2_socketInfoEntry_t *);
+
+/*
+ * Central definitions for the columns used in the reports.
+ * For each column, there's a definition for the heading, the underline and
+ * the formatted value.
+ * Since most reports select different columns depending on command line
+ * options, defining everything here avoids duplication in the report
+ * format strings and makes it easy to make changes as necessary.
+ */
+#define UDP_V4_LOCAL " Local Address "
+#define UDP_V4_LOCAL_ "--------------------"
+#define UDP_V4_LOCAL_F "%-20s"
+#define UDP_V4_REMOTE " Remote Address "
+#define UDP_V4_REMOTE_ "--------------------"
+#define UDP_V4_REMOTE_F "%-20s"
+#define UDP_V4_STATE " State "
+#define UDP_V4_STATE_ "----------"
+#define UDP_V4_STATE_F "%-10.10s"
+#define UDP_V4_USER " User "
+#define UDP_V4_USER_ "--------"
+#define UDP_V4_USER_F "%-8.8s"
+#define UDP_V4_PID " Pid "
+#define UDP_V4_PID_ "------"
+#define UDP_V4_PID_F "%6s"
+#define UDP_V4_COMMAND " Command "
+#define UDP_V4_COMMAND_ "--------------"
+#define UDP_V4_COMMAND_F "%-14.14s"
static const char udp_hdr_v4[] =
-" Local Address Remote Address State\n"
-"-------------------- -------------------- ----------\n";
+ UDP_V4_LOCAL " " UDP_V4_REMOTE " " UDP_V4_STATE "\n"
+ UDP_V4_LOCAL_" " UDP_V4_REMOTE_" " UDP_V4_STATE_"\n";
+
+static const char udp_hdr_v4_pid[] =
+ UDP_V4_LOCAL " " UDP_V4_REMOTE " "
+ UDP_V4_USER " " UDP_V4_PID " " UDP_V4_COMMAND " " UDP_V4_STATE "\n"
+ UDP_V4_LOCAL_" " UDP_V4_REMOTE_" "
+ UDP_V4_USER_" " UDP_V4_PID_" " UDP_V4_COMMAND_" " UDP_V4_STATE_"\n";
+static const char udp_hdr_v4_pid_verbose[] =
+ UDP_V4_LOCAL " " UDP_V4_REMOTE " "
+ UDP_V4_USER " " UDP_V4_PID " " UDP_V4_STATE " " UDP_V4_COMMAND "\n"
+ UDP_V4_LOCAL_" " UDP_V4_REMOTE_" "
+ UDP_V4_USER_" " UDP_V4_PID_" " UDP_V4_STATE_" " UDP_V4_COMMAND_"\n";
+
+#define UDP_V6_LOCAL " Local Address "
+#define UDP_V6_LOCAL_ "---------------------------------"
+#define UDP_V6_LOCAL_F "%-33s"
+#define UDP_V6_REMOTE " Remote Address "
+#define UDP_V6_REMOTE_ "---------------------------------"
+#define UDP_V6_REMOTE_F "%-33s"
+#define UDP_V6_STATE UDP_V4_STATE
+#define UDP_V6_STATE_ UDP_V4_STATE_
+#define UDP_V6_STATE_F UDP_V4_STATE_F
+#define UDP_V6_USER UDP_V4_USER
+#define UDP_V6_USER_ UDP_V4_USER_
+#define UDP_V6_USER_F UDP_V4_USER_F
+#define UDP_V6_PID UDP_V4_PID
+#define UDP_V6_PID_ UDP_V4_PID_
+#define UDP_V6_PID_F UDP_V4_PID_F
+#define UDP_V6_COMMAND UDP_V4_COMMAND
+#define UDP_V6_COMMAND_ UDP_V4_COMMAND_
+#define UDP_V6_COMMAND_F UDP_V4_COMMAND_F
+#define UDP_V6_IF " If "
+#define UDP_V6_IF_ "-----"
+#define UDP_V6_IF_F "%-5.5s"
static const char udp_hdr_v6[] =
-" Local Address Remote Address "
-" State If\n"
-"--------------------------------- --------------------------------- "
-"---------- -----\n";
+ UDP_V6_LOCAL " " UDP_V6_REMOTE " " UDP_V6_STATE " "
+ UDP_V6_IF "\n"
+ UDP_V6_LOCAL_" " UDP_V6_REMOTE_" " UDP_V6_STATE_" "
+ UDP_V6_IF_"\n";
+
+static const char udp_hdr_v6_pid[] =
+ UDP_V6_LOCAL " " UDP_V6_REMOTE " "
+ UDP_V6_USER " " UDP_V6_PID " " UDP_V6_COMMAND " "
+ UDP_V6_STATE " " UDP_V6_IF "\n"
+ UDP_V6_LOCAL_" " UDP_V6_REMOTE_" "
+ UDP_V6_USER_" " UDP_V6_PID_" " UDP_V6_COMMAND_" "
+ UDP_V6_STATE_" " UDP_V6_IF_"\n";
+
+static const char udp_hdr_v6_pid_verbose[] =
+ UDP_V6_LOCAL " " UDP_V6_REMOTE " "
+ UDP_V6_USER " " UDP_V6_PID " " UDP_V6_STATE " "
+ UDP_V6_IF " " UDP_V6_COMMAND "\n"
+ UDP_V6_LOCAL_" " UDP_V6_REMOTE_" "
+ UDP_V6_USER_" " UDP_V6_PID_" " UDP_V6_STATE_" "
+ UDP_V6_IF_" " UDP_V6_COMMAND_ "\n";
static void
udp_report(const mib_item_t *item)
{
- int jtemp = 0;
- boolean_t print_hdr_once_v4 = B_TRUE;
- boolean_t print_hdr_once_v6 = B_TRUE;
- mib2_udpEntry_t *ude;
- mib2_udp6Entry_t *ude6;
- mib2_transportMLPEntry_t **v4_attrs, **v6_attrs;
- mib2_transportMLPEntry_t **v4a, **v6a;
- mib2_transportMLPEntry_t *aptr;
+ int jtemp = 0;
+ boolean_t print_hdr_once_v4 = B_TRUE;
+ boolean_t print_hdr_once_v6 = B_TRUE;
+ mib2_udpEntry_t *ude;
+ mib2_udp6Entry_t *ude6;
+ mib2_transportMLPEntry_t **v4_attrs, **v6_attrs, **v4a, **v6a;
+ mib2_transportMLPEntry_t *aptr;
+ mib2_socketInfoEntry_t **v4_info, **v6_info, **v4i, **v6i;
+ mib2_socketInfoEntry_t *iptr;
if (!protocol_selected(IPPROTO_UDP))
return;
@@ -5092,14 +6051,21 @@ udp_report(const mib_item_t *item)
gather_attrs(item, MIB2_UDP6, MIB2_UDP6_ENTRY, udp6EntrySize) :
NULL;
+ v4_info = Uflag && family_selected(AF_INET) ?
+ gather_info(item, MIB2_UDP, MIB2_UDP_ENTRY, udpEntrySize) :
+ NULL;
+ v6_info = Uflag && family_selected(AF_INET6) ?
+ gather_info(item, MIB2_UDP6, MIB2_UDP6_ENTRY, udp6EntrySize) :
+ NULL;
+
v4a = v4_attrs;
v6a = v6_attrs;
- /* 'for' loop 1: */
+ v4i = v4_info;
+ v6i = v6_info;
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id,
item->length, item->valp);
}
@@ -5107,121 +6073,263 @@ udp_report(const mib_item_t *item)
item->mib_id == MIB2_UDP_ENTRY) ||
(item->group == MIB2_UDP6 &&
item->mib_id == MIB2_UDP6_ENTRY)))
- continue; /* 'for' loop 1 */
+ continue;
if (item->group == MIB2_UDP && !family_selected(AF_INET))
- continue; /* 'for' loop 1 */
+ continue;
else if (item->group == MIB2_UDP6 && !family_selected(AF_INET6))
- continue; /* 'for' loop 1 */
+ continue;
- /* xxx.xxx.xxx.xxx,pppp sss... */
if (item->group == MIB2_UDP) {
for (ude = (mib2_udpEntry_t *)item->valp;
(char *)ude < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
ude = (mib2_udpEntry_t *)((char *)ude +
udpEntrySize)) {
aptr = v4a == NULL ? NULL : *v4a++;
+ iptr = v4i == NULL ? NULL : *v4i++;
print_hdr_once_v4 = udp_report_item_v4(ude,
- print_hdr_once_v4, aptr);
+ print_hdr_once_v4, aptr, iptr);
}
} else {
for (ude6 = (mib2_udp6Entry_t *)item->valp;
(char *)ude6 < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
ude6 = (mib2_udp6Entry_t *)((char *)ude6 +
udp6EntrySize)) {
aptr = v6a == NULL ? NULL : *v6a++;
+ iptr = v6i == NULL ? NULL : *v6i++;
print_hdr_once_v6 = udp_report_item_v6(ude6,
- print_hdr_once_v6, aptr);
+ print_hdr_once_v6, aptr, iptr);
}
}
- } /* 'for' loop 1 ends */
+
+ }
(void) fflush(stdout);
- if (v4_attrs != NULL)
- free(v4_attrs);
- if (v6_attrs != NULL)
- free(v6_attrs);
+ free(v4_attrs);
+ free(v6_attrs);
+ free(v4_info);
+ free(v6_info);
}
static boolean_t
udp_report_item_v4(const mib2_udpEntry_t *ude, boolean_t first,
- const mib2_transportMLPEntry_t *attr)
+ const mib2_transportMLPEntry_t *attr, const mib2_socketInfoEntry_t *sie)
{
+ char *leadin;
char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
/* hostname + portname */
+ proc_fdinfo_t *ph;
if (!(Aflag || ude->udpEntryInfo.ue_state >= MIB2_UDP_connected))
return (first); /* Nothing to print */
if (first) {
(void) printf(v4compat ? "\nUDP\n" : "\nUDP: IPv4\n");
- (void) printf(udp_hdr_v4);
+
+ if (Uflag)
+ (void) printf(Vflag ? udp_hdr_v4_pid_verbose :
+ udp_hdr_v4_pid);
+ else
+ (void) printf(udp_hdr_v4);
+
first = B_FALSE;
}
- (void) printf("%-20s ",
+ if (Xflag)
+ sie_report(sie);
+
+ if (asprintf(&leadin,
+ UDP_V4_LOCAL_F " " UDP_V4_REMOTE_F " ",
pr_ap(ude->udpLocalAddress, ude->udpLocalPort, "udp",
- lname, sizeof (lname)));
- (void) printf("%-20s %s\n",
+ lname, sizeof (lname)),
ude->udpEntryInfo.ue_state == MIB2_UDP_connected ?
pr_ap(ude->udpEntryInfo.ue_RemoteAddress,
ude->udpEntryInfo.ue_RemotePort, "udp", lname, sizeof (lname)) :
- "",
- miudp_state(ude->udpEntryInfo.ue_state, attr));
+ "") == -1) {
+ fatal(1, "Out of memory");
+ }
+ if (!Uflag) {
+ (void) printf("%s%s\n",
+ leadin, miudp_state(ude->udpEntryInfo.ue_state, attr));
+ } else {
+ ph = process_hash_get(sie, SOCK_DGRAM, AF_INET);
+ if (ph->ph_pid == 0 && sie != NULL &&
+ (sie->sie_flags & MIB2_SOCKINFO_IPV6))
+ ph = process_hash_get(sie, SOCK_DGRAM, AF_INET6);
+ for (; ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf("%s" UDP_V4_USER_F " " UDP_V4_PID_F " ",
+ leadin, ph->ph_username, ph->ph_pidstr);
+ if (Vflag) {
+ (void) printf(UDP_V4_STATE_F " %s\n",
+ miudp_state(ude->udpEntryInfo.ue_state,
+ attr),
+ ph->ph_psargs);
+ } else {
+ (void) printf(UDP_V4_COMMAND_F " %s\n",
+ ph->ph_fname,
+ miudp_state(ude->udpEntryInfo.ue_state,
+ attr));
+ }
+ }
+ }
print_transport_label(attr);
+ free(leadin);
+
return (first);
}
static boolean_t
udp_report_item_v6(const mib2_udp6Entry_t *ude6, boolean_t first,
- const mib2_transportMLPEntry_t *attr)
+ const mib2_transportMLPEntry_t *attr, const mib2_socketInfoEntry_t *sie)
{
- char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
+ char *leadin;
+ char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
/* hostname + portname */
- char ifname[LIFNAMSIZ + 1];
- const char *ifnamep;
+ char ifname[LIFNAMSIZ + 1];
+ const char *ifnamep;
+ proc_fdinfo_t *ph;
if (!(Aflag || ude6->udp6EntryInfo.ue_state >= MIB2_UDP_connected))
return (first); /* Nothing to print */
if (first) {
(void) printf("\nUDP: IPv6\n");
- (void) printf(udp_hdr_v6);
+
+ if (Uflag)
+ (void) printf(Vflag ? udp_hdr_v6_pid_verbose :
+ udp_hdr_v6_pid);
+ else
+ (void) printf(udp_hdr_v6);
+
first = B_FALSE;
}
ifnamep = (ude6->udp6IfIndex != 0) ?
if_indextoname(ude6->udp6IfIndex, ifname) : NULL;
- (void) printf("%-33s ",
+ if (Xflag)
+ sie_report(sie);
+
+ if (asprintf(&leadin,
+ UDP_V6_LOCAL_F " " UDP_V6_REMOTE_F " ",
pr_ap6(&ude6->udp6LocalAddress,
- ude6->udp6LocalPort, "udp", lname, sizeof (lname)));
- (void) printf("%-33s %-10s %s\n",
+ ude6->udp6LocalPort, "udp", lname, sizeof (lname)),
ude6->udp6EntryInfo.ue_state == MIB2_UDP_connected ?
pr_ap6(&ude6->udp6EntryInfo.ue_RemoteAddress,
ude6->udp6EntryInfo.ue_RemotePort, "udp", lname, sizeof (lname)) :
- "",
- miudp_state(ude6->udp6EntryInfo.ue_state, attr),
- ifnamep == NULL ? "" : ifnamep);
+ "") == -1) {
+ fatal(1, "Out of memory");
+ }
+ if (!Uflag) {
+ (void) printf("%s" UDP_V6_STATE_F " %s\n", leadin,
+ miudp_state(ude6->udp6EntryInfo.ue_state, attr),
+ ifnamep == NULL ? "" : ifnamep);
+ } else {
+ for (ph = process_hash_get(sie, SOCK_DGRAM, AF_INET6);
+ ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf("%s" UDP_V6_USER_F " " UDP_V6_PID_F " ",
+ leadin, ph->ph_username, ph->ph_pidstr);
+ if (Vflag) {
+ (void) printf(
+ UDP_V6_STATE_F " " UDP_V6_IF_F " %s\n",
+ miudp_state(ude6->udp6EntryInfo.ue_state,
+ attr),
+ ifnamep == NULL ? "" : ifnamep,
+ ph->ph_psargs);
+ } else {
+ (void) printf(
+ UDP_V6_COMMAND_F " " UDP_V6_STATE_F " %s\n",
+ ph->ph_fname,
+ miudp_state(ude6->udp6EntryInfo.ue_state,
+ attr),
+ ifnamep == NULL ? "" : ifnamep);
+ }
+ }
+ }
print_transport_label(attr);
+ free(leadin);
+
return (first);
}
/* ------------------------------ SCTP_REPORT------------------------------- */
+/*
+ * Central definitions for the columns used in the reports.
+ * For each column, there's a definition for the heading, the underline and
+ * the formatted value.
+ * Since most reports select different columns depending on command line
+ * options, defining everything here avoids duplication in the report
+ * format strings and makes it easy to make changes as necessary.
+ */
+#define SCTP_LOCAL " Local Address "
+#define SCTP_LOCAL_ "-------------------------------"
+#define SCTP_LOCAL_F "%-31s"
+#define SCTP_REMOTE " Remote Address "
+#define SCTP_REMOTE_ "-------------------------------"
+#define SCTP_REMOTE_F "%-31s"
+#define SCTP_SWIND "Swind "
+#define SCTP_SWIND_ "------"
+#define SCTP_SWIND_F "%6u"
+#define SCTP_SENDQ "Send-Q"
+#define SCTP_SENDQ_ "------"
+#define SCTP_SENDQ_F "%6d"
+#define SCTP_RWIND "Rwind "
+#define SCTP_RWIND_ "------"
+#define SCTP_RWIND_F "%6d"
+#define SCTP_RECVQ "Recv-Q"
+#define SCTP_RECVQ_ "------"
+#define SCTP_RECVQ_F "%6u"
+#define SCTP_STRS "StrsI/O"
+#define SCTP_STRS_ "-------"
+#define SCTP_STRS_FI "%3d"
+#define SCTP_STRS_FO "%-3d"
+#define SCTP_STATE " State "
+#define SCTP_STATE_ "-----------"
+#define SCTP_STATE_F "%-11.11s"
+#define SCTP_USER " User "
+#define SCTP_USER_ "--------"
+#define SCTP_USER_F "%-8.8s"
+#define SCTP_PID " Pid "
+#define SCTP_PID_ "------"
+#define SCTP_PID_F "%6s"
+#define SCTP_COMMAND " Command "
+#define SCTP_COMMAND_ "--------------"
+#define SCTP_COMMAND_F "%-14.14s"
+
static const char sctp_hdr[] =
"\nSCTP:";
static const char sctp_hdr_normal[] =
-" Local Address Remote Address "
-"Swind Send-Q Rwind Recv-Q StrsI/O State\n"
-"------------------------------- ------------------------------- "
-"------ ------ ------ ------ ------- -----------";
+ SCTP_LOCAL " " SCTP_REMOTE " "
+ SCTP_SWIND " " SCTP_SENDQ " " SCTP_RWIND " " SCTP_RECVQ " "
+ SCTP_STRS " " SCTP_STATE "\n"
+ SCTP_LOCAL_" " SCTP_REMOTE_" "
+ SCTP_SWIND_" " SCTP_SENDQ_" " SCTP_RWIND_" " SCTP_RECVQ_" "
+ SCTP_STRS_" " SCTP_STATE_"\n";
+
+static const char sctp_hdr_pid[] =
+ SCTP_LOCAL " " SCTP_REMOTE " "
+ SCTP_SWIND " " SCTP_SENDQ " " SCTP_RWIND " " SCTP_RECVQ " "
+ SCTP_STRS " "
+ SCTP_USER " " SCTP_PID " " SCTP_COMMAND " " SCTP_STATE "\n"
+ SCTP_LOCAL_" " SCTP_REMOTE_" "
+ SCTP_SWIND_" " SCTP_SENDQ_" " SCTP_RWIND_" " SCTP_RECVQ_" "
+ SCTP_STRS_" "
+ SCTP_USER_" " SCTP_PID_" " SCTP_COMMAND_" " SCTP_STATE_"\n";
+
+static const char sctp_hdr_pid_verbose[] =
+ SCTP_LOCAL " " SCTP_REMOTE " "
+ SCTP_SWIND " " SCTP_SENDQ " " SCTP_RWIND " " SCTP_RECVQ " "
+ SCTP_STRS_" "
+ SCTP_USER " " SCTP_PID " " SCTP_STATE " " SCTP_COMMAND "\n"
+ SCTP_LOCAL_" " SCTP_REMOTE_" "
+ SCTP_SWIND_" " SCTP_SENDQ_" " SCTP_RWIND_" " SCTP_RECVQ_" "
+ SCTP_STRS_" "
+ SCTP_USER_" " SCTP_PID_" " SCTP_STATE_" " SCTP_COMMAND_"\n";
static const char *
nssctp_state(int state, const mib2_transportMLPEntry_t *attr)
@@ -5292,14 +6400,12 @@ sctp_getnext_rem(const mib_item_t **itemp,
}
if (current != NULL) {
- /* LINTED: (note 1) */
sre = (const mib2_sctpConnRemoteEntry_t *)
((const char *)current + sctpRemoteEntrySize);
} else {
sre = item->valp;
}
for (; (char *)sre < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
sre = (const mib2_sctpConnRemoteEntry_t *)
((const char *)sre + sctpRemoteEntrySize)) {
if (sre->sctpAssocId != associd) {
@@ -5327,14 +6433,12 @@ sctp_getnext_local(const mib_item_t **itemp,
}
if (current != NULL) {
- /* LINTED: (note 1) */
sle = (const mib2_sctpConnLocalEntry_t *)
((const char *)current + sctpLocalEntrySize);
} else {
sle = item->valp;
}
for (; (char *)sle < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
sle = (const mib2_sctpConnLocalEntry_t *)
((const char *)sle + sctpLocalEntrySize)) {
if (sle->sctpAssocId != associd) {
@@ -5388,9 +6492,10 @@ sctp_pr_addr(int type, char *name, int namelen, const in6_addr_t *addr,
}
}
-static void
-sctp_conn_report_item(const mib_item_t *head, const mib2_sctpConnEntry_t *sp,
- const mib2_transportMLPEntry_t *attr)
+static boolean_t
+sctp_conn_report_item(const mib_item_t *head, boolean_t print_sctp_hdr,
+ const mib2_sctpConnEntry_t *sp, const mib2_transportMLPEntry_t *attr,
+ const mib2_socketInfoEntry_t *sie)
{
char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
char fname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
@@ -5400,26 +6505,72 @@ sctp_conn_report_item(const mib_item_t *head, const mib2_sctpConnEntry_t *sp,
const mib_item_t *remote = head;
uint32_t id = sp->sctpAssocId;
boolean_t printfirst = B_TRUE;
+ proc_fdinfo_t *ph;
+
+ if (print_sctp_hdr == B_TRUE) {
+ (void) puts(sctp_hdr);
+ if (Uflag)
+ (void) puts(Vflag ? sctp_hdr_pid_verbose: sctp_hdr_pid);
+ else
+ (void) puts(sctp_hdr_normal);
+
+ print_sctp_hdr = B_FALSE;
+ }
sctp_pr_addr(sp->sctpAssocRemPrimAddrType, fname, sizeof (fname),
&sp->sctpAssocRemPrimAddr, sp->sctpAssocRemPort);
sctp_pr_addr(sp->sctpAssocRemPrimAddrType, lname, sizeof (lname),
&sp->sctpAssocLocPrimAddr, sp->sctpAssocLocalPort);
- (void) printf("%-31s %-31s %6u %6d %6u %6d %3d/%-3d %s\n",
- lname, fname,
- sp->sctpConnEntryInfo.ce_swnd,
- sp->sctpConnEntryInfo.ce_sendq,
- sp->sctpConnEntryInfo.ce_rwnd,
- sp->sctpConnEntryInfo.ce_recvq,
- sp->sctpAssocInStreams, sp->sctpAssocOutStreams,
- nssctp_state(sp->sctpAssocState, attr));
+ if (Xflag)
+ sie_report(sie);
+
+ if (Uflag) {
+ for (ph = process_hash_get(sie, SOCK_STREAM, AF_INET);
+ ph != NULL; ph = ph->ph_next_proc) {
+ (void) printf(
+ SCTP_LOCAL_F " " SCTP_REMOTE_F " "
+ SCTP_SWIND_F " " SCTP_SENDQ_F " "
+ SCTP_RWIND_F " " SCTP_RECVQ_F " "
+ SCTP_STRS_FI "/" SCTP_STRS_FO " "
+ SCTP_USER_F " " SCTP_PID_F " ",
+ lname, fname,
+ sp->sctpConnEntryInfo.ce_swnd,
+ sp->sctpConnEntryInfo.ce_sendq,
+ sp->sctpConnEntryInfo.ce_rwnd,
+ sp->sctpConnEntryInfo.ce_recvq,
+ sp->sctpAssocInStreams,
+ sp->sctpAssocOutStreams,
+ ph->ph_username, ph->ph_pidstr);
+ if (Vflag) {
+ (void) printf(SCTP_STATE_F " %s\n",
+ nssctp_state(sp->sctpAssocState, attr),
+ ph->ph_psargs);
+ } else {
+ (void) printf(SCTP_COMMAND_F " %s\n",
+ ph->ph_fname,
+ nssctp_state(sp->sctpAssocState, attr));
+ }
+ }
+ } else {
+ (void) printf(
+ SCTP_LOCAL_F " " SCTP_REMOTE_F " "
+ SCTP_SWIND_F " " SCTP_SENDQ_F " "
+ SCTP_RWIND_F " " SCTP_RECVQ_F " "
+ SCTP_STRS_FI "/" SCTP_STRS_FO " %s\n",
+ lname, fname,
+ sp->sctpConnEntryInfo.ce_swnd,
+ sp->sctpConnEntryInfo.ce_sendq,
+ sp->sctpConnEntryInfo.ce_rwnd,
+ sp->sctpConnEntryInfo.ce_recvq,
+ sp->sctpAssocInStreams, sp->sctpAssocOutStreams,
+ nssctp_state(sp->sctpAssocState, attr));
+ }
print_transport_label(attr);
- if (!Vflag) {
- return;
- }
+ if (!Vflag)
+ return (print_sctp_hdr);
/* Print remote addresses/local addresses on following lines */
while ((sre = sctp_getnext_rem(&remote, sre, id)) != NULL) {
@@ -5461,16 +6612,17 @@ sctp_conn_report_item(const mib_item_t *head, const mib2_sctpConnEntry_t *sp,
if (printfirst == B_FALSE) {
(void) puts(">");
}
+
+ return (print_sctp_hdr);
}
static void
sctp_report(const mib_item_t *item)
{
- const mib_item_t *head;
const mib2_sctpConnEntry_t *sp;
- boolean_t first = B_TRUE;
- mib2_transportMLPEntry_t **attrs, **aptr;
- mib2_transportMLPEntry_t *attr;
+ boolean_t print_sctp_hdr_once = B_TRUE;
+ mib2_transportMLPEntry_t **attrs, **a, *aptr;
+ mib2_socketInfoEntry_t **info, **i, *iptr;
/*
* Preparation pass: the kernel returns separate entries for SCTP
@@ -5481,9 +6633,12 @@ sctp_report(const mib_item_t *item)
attrs = RSECflag ?
gather_attrs(item, MIB2_SCTP, MIB2_SCTP_CONN, sctpEntrySize) :
NULL;
+ info = Uflag ?
+ gather_info(item, MIB2_SCTP, MIB2_SCTP_CONN, sctpEntrySize) :
+ NULL;
- aptr = attrs;
- head = item;
+ a = attrs;
+ i = info;
for (; item != NULL; item = item->next_item) {
if (!(item->group == MIB2_SCTP &&
@@ -5492,22 +6647,18 @@ sctp_report(const mib_item_t *item)
for (sp = item->valp;
(char *)sp < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
sp = (mib2_sctpConnEntry_t *)((char *)sp + sctpEntrySize)) {
- attr = aptr == NULL ? NULL : *aptr++;
- if (Aflag ||
- sp->sctpAssocState >= MIB2_SCTP_established) {
- if (first == B_TRUE) {
- (void) puts(sctp_hdr);
- (void) puts(sctp_hdr_normal);
- first = B_FALSE;
- }
- sctp_conn_report_item(head, sp, attr);
- }
+ if (!(Aflag ||
+ sp->sctpAssocState >= MIB2_SCTP_established))
+ continue;
+ aptr = a == NULL ? NULL : *a++;
+ iptr = i == NULL ? NULL : *i++;
+ print_sctp_hdr_once = sctp_conn_report_item(
+ item, print_sctp_hdr_once, sp, aptr, iptr);
}
}
- if (attrs != NULL)
- free(attrs);
+ free(attrs);
+ free(info);
}
static char *
@@ -5567,17 +6718,15 @@ mrt_report(mib_item_t *item)
if (!(family_selected(AF_INET)))
return;
- /* 'for' loop 1: */
for (; item; item = item->next_item) {
if (Xflag) {
- (void) printf("\n--- Entry %d ---\n", ++jtemp);
- (void) printf("Group = %d, mib_id = %d, "
- "length = %d, valp = 0x%p\n",
+ (void) printf("[%4d] Group = %d, mib_id = %d, "
+ "length = %d, valp = 0x%p\n", jtemp++,
item->group, item->mib_id, item->length,
item->valp);
}
if (item->group != EXPER_DVMRP)
- continue; /* 'for' loop 1 */
+ continue;
switch (item->mib_id) {
@@ -5595,14 +6744,12 @@ mrt_report(mib_item_t *item)
" Vif Threshold Rate_Limit Local-Address"
" Remote-Address Pkt_in Pkt_out");
- /* 'for' loop 2: */
for (vip = (struct vifctl *)item->valp;
(char *)vip < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
vip = (struct vifctl *)((char *)vip +
vifctlSize)) {
if (vip->vifc_lcl_addr.s_addr == 0)
- continue; /* 'for' loop 2 */
+ continue;
/* numvifs = vip->vifc_vifi; */
numvifs++;
@@ -5619,7 +6766,7 @@ mrt_report(mib_item_t *item)
abuf, sizeof (abuf)) : "",
vip->vifc_pkt_in,
vip->vifc_pkt_out);
- } /* 'for' loop 2 ends */
+ }
(void) printf("Numvifs: %d\n", numvifs);
break;
@@ -5640,7 +6787,6 @@ mrt_report(mib_item_t *item)
for (mfccp = (struct mfcctl *)item->valp;
(char *)mfccp < (char *)item->valp + item->length;
- /* LINTED: (note 1) */
mfccp = (struct mfcctl *)((char *)mfccp +
mfcctlSize)) {
@@ -5669,7 +6815,7 @@ mrt_report(mib_item_t *item)
nmfc);
break;
}
- } /* 'for' loop 1 ends */
+ }
(void) putchar('\n');
(void) fflush(stdout);
}
@@ -5696,11 +6842,10 @@ kmem_cache_stats(char *title, char *name, int prefix, int64_t *total_bytes)
len = prefix ? strlen(name) : 256;
- /* 'for' loop 1: */
for (ksp = kc->kc_chain; ksp != NULL; ksp = ksp->ks_next) {
if (strcmp(ksp->ks_class, "kmem_cache") != 0)
- continue; /* 'for' loop 1 */
+ continue;
/*
* Hack alert: because of the way streams messages are
@@ -5717,11 +6862,11 @@ kmem_cache_stats(char *title, char *name, int prefix, int64_t *total_bytes)
(void) safe_kstat_read(kc, ksp, NULL);
total_buf_inuse -=
kstat_named_value(ksp, "buf_constructed");
- continue; /* 'for' loop 1 */
+ continue;
}
if (strncmp(ksp->ks_name, name, len) != 0)
- continue; /* 'for' loop 1 */
+ continue;
(void) safe_kstat_read(kc, ksp, NULL);
@@ -5745,7 +6890,7 @@ kmem_cache_stats(char *title, char *name, int prefix, int64_t *total_bytes)
total_buf_max += buf_max;
total_buf_inuse += buf_inuse;
*total_bytes += (int64_t)buf_inuse * buf_size;
- } /* 'for' loop 1 ends */
+ }
if (buf_size == 0) {
(void) printf("%-22s [couldn't find statistics for %s]\n",
@@ -6303,7 +7448,6 @@ portname(uint_t port, char *proto, char *dst, uint_t dstlen)
return (dst);
}
-/*PRINTFLIKE2*/
void
fail(int do_perror, char *message, ...)
{
@@ -6320,6 +7464,25 @@ fail(int do_perror, char *message, ...)
}
/*
+ * fatal: print error message to stderr and
+ * call exit(errcode)
+ */
+static void
+fatal(int errcode, char *format, ...)
+{
+ if (format != NULL) {
+ va_list argp;
+
+ va_start(argp, format);
+ (void) vfprintf(stderr, format, argp);
+ va_end(argp);
+ }
+
+ exit(errcode);
+}
+
+
+/*
* Return value of named statistic for given kstat_named kstat;
* return 0LL if named statistic is not in list (use "ll" as a
* type qualifier when printing 64-bit int's with printf() )
@@ -6489,7 +7652,6 @@ process_filter(char *arg)
* into a mask.
*/
if (hp->h_addr_list[0] != NULL &&
- /* LINTED: (note 1) */
IN6_IS_ADDR_V4MAPPED((in6_addr_t *)
hp->h_addr_list[0])) {
maxv = IP_ABITS;
@@ -6575,7 +7737,7 @@ ifindex2str(uint_t ifindex, char *ifname)
static void
usage(char *cmdname)
{
- (void) fprintf(stderr, "usage: %s [-anv] [-f address_family] "
+ (void) fprintf(stderr, "usage: %s [-anuv] [-f address_family] "
"[-T d|u]\n", cmdname);
(void) fprintf(stderr, " %s [-n] [-f address_family] "
"[-P protocol] [-T d|u] [-g | -p | -s [interval [count]]]\n",
@@ -6593,22 +7755,225 @@ usage(char *cmdname)
exit(EXIT_FAILURE);
}
+/* -------------------UNIX Domain Sockets Report---------------------------- */
+
+#define UDS_SO_PAIR "(socketpair)"
+
+static char *typetoname(t_scalar_t);
+static boolean_t uds_report_item(struct sockinfo *, boolean_t);
+
/*
- * fatal: print error message to stderr and
- * call exit(errcode)
+ * Central definitions for the columns used in the reports.
+ * For each column, there's a definition for the heading, the underline and
+ * the formatted value.
+ * Since most reports select different columns depending on command line
+ * options, defining everything here avoids duplication in the report
+ * format strings and makes it easy to make changes as necessary.
+ */
+#define UDS_ADDRESS "Address "
+#define UDS_ADDRESS_ "----------------"
+#define UDS_ADDRESS_F "%-16.16s"
+#define UDS_TYPE "Type "
+#define UDS_TYPE_ "----------"
+#define UDS_TYPE_F "%-10.10s"
+#define UDS_VNODE "Vnode "
+#define UDS_VNODE_ "----------------"
+#define UDS_VNODE_F "%-16.16s"
+#define UDS_CONN "Conn "
+#define UDS_CONN_ "----------------"
+#define UDS_CONN_F "%-16.16s"
+#define UDS_LOCAL "Local Address "
+#define UDS_LOCAL_ "---------------------------------------"
+#define UDS_LOCAL_F "%-39.39s"
+#define UDS_REMOTE "Remote Address "
+#define UDS_REMOTE_ "---------------------------------------"
+#define UDS_REMOTE_F "%-39.39s"
+#define UDS_USER "User "
+#define UDS_USER_ "--------"
+#define UDS_USER_F "%-8.8s"
+#define UDS_PID "Pid "
+#define UDS_PID_ "------"
+#define UDS_PID_F "%6s"
+#define UDS_COMMAND "Command "
+#define UDS_COMMAND_ "--------------"
+#define UDS_COMMAND_F "%-14.14s"
+
+static const char uds_hdr[] = "\nActive UNIX domain sockets\n";
+
+static const char uds_hdr_normal[] =
+ UDS_ADDRESS " " UDS_TYPE " " UDS_VNODE " " UDS_CONN " "
+ UDS_LOCAL " " UDS_REMOTE "\n"
+ UDS_ADDRESS_" " UDS_TYPE_" " UDS_VNODE_" " UDS_CONN_" "
+ UDS_LOCAL_" " UDS_REMOTE_"\n";
+
+static const char uds_hdr_pid[] =
+ UDS_ADDRESS " " UDS_TYPE " " UDS_USER " " UDS_PID " " UDS_COMMAND " "
+ UDS_LOCAL " " UDS_REMOTE "\n"
+ UDS_ADDRESS_ " " UDS_TYPE_" " UDS_USER_" " UDS_PID_" " UDS_COMMAND_" "
+ UDS_LOCAL_" " UDS_REMOTE_"\n";
+
+static const char uds_hdr_pid_verbose[] =
+ UDS_ADDRESS " " UDS_TYPE " " UDS_USER " " UDS_PID " "
+ UDS_LOCAL " " UDS_REMOTE " " UDS_COMMAND "\n"
+ UDS_ADDRESS_ " " UDS_TYPE_" " UDS_USER_" " UDS_PID_" "
+ UDS_LOCAL_" " UDS_REMOTE_" " UDS_COMMAND_"\n";
+
+/*
+ * Print a summary of connections related to unix protocols.
*/
-/*PRINTFLIKE2*/
static void
-fatal(int errcode, char *format, ...)
+uds_report(kstat_ctl_t *kc)
{
- va_list argp;
+ uint32_t i;
+ kstat_t *ksp;
+ struct sockinfo *psi;
+ boolean_t print_uds_hdr_once = B_TRUE;
- if (format == NULL)
- return;
+ if (kc == NULL) {
+ fail(0, "uds_report: No kstat");
+ exit(3);
+ }
- va_start(argp, format);
- (void) vfprintf(stderr, format, argp);
- va_end(argp);
+ if ((ksp = kstat_lookup(kc, "sockfs", 0, "sock_unix_list")) == NULL)
+ fail(0, "kstat_data_lookup failed\n");
- exit(errcode);
+ if (kstat_read(kc, ksp, NULL) == -1)
+ fail(0, "kstat_read failed for sock_unix_list\n");
+
+ if (ksp->ks_ndata == 0)
+ return; /* no AF_UNIX sockets found */
+
+ /*
+ * Having ks_data set with ks_data == NULL shouldn't happen;
+ * If it does, the sockfs kstat is seriously broken.
+ */
+ if ((psi = ksp->ks_data) == NULL)
+ fail(0, "uds_report: no kstat data\n");
+
+ for (i = 0; i < ksp->ks_ndata; i++) {
+
+ print_uds_hdr_once = uds_report_item(psi, print_uds_hdr_once);
+
+ /* If si_size didn't get filled in, then we're done */
+ if (psi->si_size == 0 ||
+ !IS_P2ALIGNED(psi->si_size, sizeof (psi)))
+ break;
+
+ /* Point to the next sockinfo in the array */
+ psi = (struct sockinfo *)(((char *)psi) + psi->si_size);
+ }
+}
+
+static boolean_t
+uds_report_item(struct sockinfo *psi, boolean_t first)
+{
+ char *laddr, *raddr;
+ proc_fdinfo_t *ph;
+
+ if (first) {
+ (void) printf("%s", uds_hdr);
+ if (Uflag)
+ (void) printf("%s",
+ Vflag ? uds_hdr_pid_verbose : uds_hdr_pid);
+ else
+ (void) printf("%s", uds_hdr_normal);
+
+ first = B_FALSE;
+ }
+
+ raddr = laddr = "";
+
+ if ((psi->si_state & SS_ISBOUND) &&
+ strlen(psi->si_laddr_sun_path) != 0 &&
+ psi->si_laddr_soa_len != 0) {
+ if (psi->si_faddr_noxlate) {
+ laddr = UDS_SO_PAIR;
+ } else {
+ if (psi->si_laddr_soa_len >
+ sizeof (psi->si_laddr_family))
+ laddr = psi->si_laddr_sun_path;
+ }
+ }
+
+ if ((psi->si_state & SS_ISCONNECTED) &&
+ strlen(psi->si_faddr_sun_path) != 0 &&
+ psi->si_faddr_soa_len != 0) {
+ if (psi->si_faddr_noxlate) {
+ raddr = UDS_SO_PAIR;
+ } else {
+ if (psi->si_faddr_soa_len >
+ sizeof (psi->si_faddr_family))
+ raddr = psi->si_faddr_sun_path;
+ }
+ }
+
+ /* Traditional output */
+ if (!Uflag) {
+ (void) printf(
+ UDS_ADDRESS_F " " UDS_TYPE_F " " UDS_VNODE_F " "
+ UDS_CONN_F " " UDS_LOCAL_F " " UDS_REMOTE_F "\n",
+ psi->si_son_straddr,
+ typetoname(psi->si_serv_type),
+ (psi->si_state & SS_ISBOUND) &&
+ psi->si_ux_laddr_sou_magic == SOU_MAGIC_EXPLICIT ?
+ psi->si_lvn_straddr : "0000000",
+ (psi->si_state & SS_ISCONNECTED) &&
+ psi->si_ux_faddr_sou_magic == SOU_MAGIC_EXPLICIT ?
+ psi->si_fvn_straddr : "0000000",
+ laddr, raddr);
+ return (first);
+ }
+
+ mib2_socketInfoEntry_t sie = {
+ .sie_inode = psi->si_inode,
+ .sie_flags = 0
+ };
+
+ if (Xflag)
+ sie_report(&sie);
+
+ for (ph = process_hash_get(&sie,
+ psi->si_serv_type == T_CLTS ? SOCK_DGRAM : SOCK_STREAM, AF_UNIX);
+ ph != NULL; ph = ph->ph_next_proc) {
+ if (Vflag) {
+ (void) printf(
+ UDS_ADDRESS_F " " UDS_TYPE_F " "
+ UDS_USER_F " " UDS_PID_F " "
+ UDS_LOCAL_F " " UDS_REMOTE_F " %s\n",
+ psi->si_son_straddr,
+ typetoname(psi->si_serv_type),
+ ph->ph_username, ph->ph_pidstr,
+ laddr, raddr, ph->ph_psargs);
+ } else {
+ (void) printf(
+ UDS_ADDRESS_F " " UDS_TYPE_F " "
+ UDS_USER_F " " UDS_PID_F " " UDS_COMMAND_F " "
+ UDS_LOCAL_F " " UDS_REMOTE_F "\n",
+ psi->si_son_straddr,
+ typetoname(psi->si_serv_type),
+ ph->ph_username, ph->ph_pidstr, ph->ph_fname,
+ laddr, raddr);
+ }
+
+ }
+
+ return (first);
+}
+
+static char *
+typetoname(t_scalar_t type)
+{
+ switch (type) {
+ case T_CLTS:
+ return ("dgram");
+
+ case T_COTS:
+ return ("stream");
+
+ case T_COTS_ORD:
+ return ("stream-ord");
+
+ default:
+ return ("");
+ }
}
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c
deleted file mode 100644
index 1a6364c00f..0000000000
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-/*
- * code for netstat's -k option
- *
- * NOTES:
- * 1. A comment "LINTED: (note 1)" appears before certain lines where
- * lint would have complained, "pointer cast may result in improper
- * alignment". These are lines where lint had suspected potential
- * improper alignment of a data structure; in each such situation
- * we have relied on the kernel guaranteeing proper alignment.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <strings.h>
-#include <string.h>
-#include <kstat.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stream.h>
-#include <sys/tiuser.h>
-#include <sys/socketvar.h>
-#include <sys/sysmacros.h>
-
-static char *typetoname(t_scalar_t);
-static void print_kn(kstat_t *);
-static char *nextstr(char *);
-extern void fail(int, char *, ...);
-
-#define NALEN 8 /* nulladdress string length */
-
-/*
- * Print a summary of connections related to a unix protocol.
- */
-void
-unixpr(kstat_ctl_t *kc)
-{
- kstat_t *ksp;
-
- if (kc == NULL) { /* sanity check. */
- fail(0, "unixpr: No kstat");
- exit(3);
- }
-
- /* find the sockfs kstat: */
- if ((ksp = kstat_lookup(kc, "sockfs", 0, "sock_unix_list")) ==
- (kstat_t *)NULL) {
- fail(0, "kstat_data_lookup failed\n");
- }
-
- if (kstat_read(kc, ksp, NULL) == -1) {
- fail(0, "kstat_read failed for sock_unix_list\n");
- }
-
- print_kn(ksp);
-}
-
-static void
-print_kn(kstat_t *ksp)
-{
- int i;
- struct sockinfo *psi; /* ptr to current sockinfo */
- char *pas; /* ptr to string-format addrs */
- char *nullstr; /* ptr to null string */
- char *conn_vp;
- char *local_vp;
-
- if (ksp->ks_ndata == 0) {
- return; /* no AF_UNIX sockets found */
- }
-
- /*
- * Having ks_data set with ks_data == NULL shouldn't happen;
- * If it does, the sockfs kstat is seriously broken.
- */
- if ((psi = ksp->ks_data) == NULL) {
- fail(0, "print_kn: no kstat data\n");
- }
-
- /* set pas to the address strings which are after the sockinfo */
- pas = &((char *)psi)[sizeof (struct sockinfo)];
-
- /* Create a string of NALEN "0"'s for NULL addresses. */
- if ((nullstr = calloc(1, NALEN)) == NULL) {
- fail(0, "print_kn: out of memory\n");
- }
- (void) memset((void *)nullstr, '0', NALEN);
-
- (void) printf("\nActive UNIX domain sockets\n");
- (void) printf("%-8.8s %-10.10s %8.8s %8.8s "
- "Local Addr Remote Addr\n",
- "Address", "Type", "Vnode", "Conn");
-
- /* for each sockinfo structure, display what we need: */
- for (i = 0; i < ksp->ks_ndata; i++) {
- /* display sonode's address. 1st string after sockinfo: */
- pas = &(((char *)psi)[sizeof (struct sockinfo)]);
- (void) printf("%s ", pas);
-
- (void) printf("%-10.10s ", typetoname(psi->si_serv_type));
-
- /* laddr.sou_vp: 2nd string after sockinfo: */
- pas = nextstr(pas);
-
- local_vp = conn_vp = nullstr;
-
- if ((psi->si_state & SS_ISBOUND) &&
- (psi->si_ux_laddr_sou_magic == SOU_MAGIC_EXPLICIT)) {
- local_vp = pas;
- }
-
- /* faddr.sou_vp: 3rd string after sockinfo: */
- pas = nextstr(pas);
- if ((psi->si_state & SS_ISCONNECTED) &&
- (psi->si_ux_faddr_sou_magic == SOU_MAGIC_EXPLICIT)) {
- conn_vp = pas;
- }
-
- (void) printf("%s %s ", local_vp, conn_vp);
-
- /* laddr.soa_sa: */
- if ((psi->si_state & SS_ISBOUND) &&
- strlen(psi->si_laddr_sun_path) != 0 &&
- psi->si_laddr_soa_len != 0) {
- if (psi->si_faddr_noxlate) {
- (void) printf(" (socketpair) ");
- } else {
- if (psi->si_laddr_soa_len >
- sizeof (psi->si_laddr_family))
- (void) printf("%s ",
- psi->si_laddr_sun_path);
- else
- (void) printf(" ");
- }
- } else
- (void) printf(" ");
-
- /* faddr.soa_sa: */
- if ((psi->si_state & SS_ISCONNECTED) &&
- strlen(psi->si_faddr_sun_path) != 0 &&
- psi->si_faddr_soa_len != 0) {
-
- if (psi->si_faddr_noxlate) {
- (void) printf(" (socketpair) ");
- } else {
- if (psi->si_faddr_soa_len >
- sizeof (psi->si_faddr_family))
- (void) printf("%s ",
- psi->si_faddr_sun_path);
- else
- (void) printf(" ");
- }
- } else
- (void) printf(" ");
-
- (void) printf("\n");
-
- /* if si_size didn't get filled in, then we're done */
- if (psi->si_size == 0 ||
- !IS_P2ALIGNED(psi->si_size, sizeof (psi))) {
- break;
- }
-
- /* LINTED: (note 1) */
- psi = (struct sockinfo *)&(((char *)psi)[psi->si_size]);
- }
-}
-
-static char *
-typetoname(t_scalar_t type)
-{
- switch (type) {
- case T_CLTS:
- return ("dgram");
-
- case T_COTS:
- return ("stream");
-
- case T_COTS_ORD:
- return ("stream-ord");
-
- default:
- return ("");
- }
-}
-
-/*
- * nextstr(): find the beginning of a next string.
- * The sockfs kstat left-justifies each address string, leaving
- * null's between the strings. Since we don't necessarily know
- * the sizes of pointers in the kernel, we need to skip over these
- * nulls in order to get to the start of the next string.
- */
-static char *
-nextstr(char *pas)
-{
- char *next;
-
- for (next = &pas[strlen(pas) + 1]; *next == '\0'; ) {
- next++;
- }
-
- return (next);
-}
diff --git a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs
index 58dcfe2a46..e93076d9ce 100644
--- a/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs
+++ b/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Kstat.xs
@@ -22,6 +22,7 @@
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014 Racktop Systems.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
/*
@@ -62,8 +63,8 @@
*
* sockfs:*:sock_unix_list
* This is stored as an array with one entry per active socket. Each element
- * is of type struct k_sockinfo. The ks_ndata and ks_data_size fields are both
- * zero.
+ * is of type struct sockinfo. ks_ndata is the number of elements of that
+ * array and ks_data_size is the total size of the array.
*
* Note that the ks_ndata and ks_data_size of many non-array raw kstats are
* also incorrect. The relevant assertions are therefore commented out in the
diff --git a/usr/src/cmd/stat/common/statcommon.h b/usr/src/cmd/stat/common/statcommon.h
index fd3e9d2d9b..d39aee8687 100644
--- a/usr/src/cmd/stat/common/statcommon.h
+++ b/usr/src/cmd/stat/common/statcommon.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
/*
@@ -45,6 +46,7 @@ extern "C" {
#include <sys/processor.h>
#include <sys/pset.h>
#include <sys/avl.h>
+#include <sys/ccompile.h>
/* No CPU present at this CPU position */
#define ID_NO_CPU -1
@@ -66,13 +68,13 @@ extern "C" {
enum snapshot_types {
/* All CPUs separately */
- SNAP_CPUS = 1 << 0,
+ SNAP_CPUS = 1 << 0,
/* Aggregated processor sets */
SNAP_PSETS = 1 << 1,
/* sys-wide stats including aggregated CPU stats */
SNAP_SYSTEM = 1 << 2,
/* interrupt sources and counts */
- SNAP_INTERRUPTS = 1 << 3,
+ SNAP_INTERRUPTS = 1 << 3,
/* disk etc. stats */
SNAP_IODEVS = 1 << 4,
/* disk controller aggregates */
@@ -228,7 +230,7 @@ struct snapshot {
};
/* print a message and exit with failure */
-void fail(int do_perror, char *message, ...);
+void fail(int do_perror, char *message, ...) __NORETURN;
/* strdup str, or exit with failure */
char *safe_strdup(char *str);
diff --git a/usr/src/data/ucode/Makefile b/usr/src/data/ucode/Makefile
index 2fc0ecdc69..6b311b0d30 100644
--- a/usr/src/data/ucode/Makefile
+++ b/usr/src/data/ucode/Makefile
@@ -10,7 +10,7 @@
#
#
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2019 Joyent, Inc.
#
include $(SRC)/data/Makefile.data
@@ -21,16 +21,18 @@ ROOTINTELDIR = $(ROOTUCODEPATH)/GenuineIntel
AMD_FILES :sh= (cd amd; print *)
INTEL_FILES :sh= (cd intel; print *)
+include $(SRC)/data/ucode/Makefile.links
ROOTAMDFILES = $(AMD_FILES:%=$(ROOTAMDDIR)/%)
ROOTINTELFILES = $(INTEL_FILES:%=$(ROOTINTELDIR)/%)
+ROOTINTELLINKS = $(INTEL_LINKS:%=$(ROOTINTELDIR)/%)
$(ROOTAMDFILES) := FILEMODE = 444
$(ROOTINTELFILES) := FILEMODE = 444
all:
-install: $(ROOTAMDFILES) $(ROOTINTELFILES)
+install: $(ROOTAMDFILES) $(ROOTINTELFILES) $(ROOTINTELLINKS)
clean:
diff --git a/usr/src/data/ucode/Makefile.links b/usr/src/data/ucode/Makefile.links
new file mode 100644
index 0000000000..df9318921e
--- /dev/null
+++ b/usr/src/data/ucode/Makefile.links
@@ -0,0 +1,383 @@
+INTEL_LINKS = 00000F32-04 00000F32-08 00000F33-04 00000F33-08 00000F34-04 00000F34-08 00000F34-10 00000F41-04 00000F41-08 00000F41-10 00000F41-20 00000F41-80 00000F43-04 00000F43-08 00000F43-10 00000F43-80 00000F44-04 00000F44-08 00000F44-10 00000F44-80 00000F47-04 00000F47-08 00000F47-10 00000F47-80 00000F48-08 00000F48-10 00000F48-40 00000F49-04 00000F49-08 00000F49-10 00000F49-20 00000F49-80 00000F4A-08 00000F4A-10 00000F4A-40 00000F64-10 00000F64-20 00000F68-20 0001067A-10 0001067A-40 0001067A-80 000106A4-02 000106A5-02 000106E5-02 000106E5-10 00020652-10 00020655-10 00020655-80 000206A7-10 000206C2-02 000206D6-04 000206D6-08 000206D6-20 000206D6-40 000206D7-04 000206D7-08 000206D7-20 000206D7-40 000206F2-04 00030678-08 00030679-02 00030679-04 00030679-08 000306A9-10 000306C3-10 000306C3-20 000306D4-80 000306E4-04 000306E4-08 000306E4-20 000306E4-40 000306E4-80 000306E6-04 000306E6-08 000306E6-20 000306E6-40 000306E6-80 000306E7-04 000306E7-08 000306E7-20 000306E7-40 000306E7-80 000306F2-02 000306F2-04 000306F2-08 000306F2-20 000306F2-40 00040651-10 00040651-20 00040651-40 00040661-10 00040661-20 00040671-20 000406E3-80 000406F1-02 000406F1-04 000406F1-08 000406F1-20 000406F1-40 000406F1-80 00050654-02 00050654-04 00050654-10 00050654-20 00050654-80 00050657-02 00050657-04 00050657-08 00050657-10 00050657-20 00050657-80 000506C9-02 000506CA-02 000506E3-04 000506E3-10 000506E3-20 000806E9-80 000806EA-80 000806EB-40 000806EB-80 000806EC-10 000806EC-80 000906E9-08 000906E9-20 000906EA-20 000906EC-20 000906ED-20
+
+$(ROOTINTELDIR)/00000F32-04: $(ROOTINTELDIR)/00000F32-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F32-08: $(ROOTINTELDIR)/00000F32-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F33-04: $(ROOTINTELDIR)/00000F33-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F33-08: $(ROOTINTELDIR)/00000F33-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F34-04: $(ROOTINTELDIR)/00000F34-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F34-08: $(ROOTINTELDIR)/00000F34-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F34-10: $(ROOTINTELDIR)/00000F34-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F41-04: $(ROOTINTELDIR)/00000F41-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F41-08: $(ROOTINTELDIR)/00000F41-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F41-10: $(ROOTINTELDIR)/00000F41-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F41-20: $(ROOTINTELDIR)/00000F41-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F41-80: $(ROOTINTELDIR)/00000F41-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F43-04: $(ROOTINTELDIR)/00000F43-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F43-08: $(ROOTINTELDIR)/00000F43-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F43-10: $(ROOTINTELDIR)/00000F43-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F43-80: $(ROOTINTELDIR)/00000F43-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F44-04: $(ROOTINTELDIR)/00000F44-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F44-08: $(ROOTINTELDIR)/00000F44-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F44-10: $(ROOTINTELDIR)/00000F44-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F44-80: $(ROOTINTELDIR)/00000F44-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F47-04: $(ROOTINTELDIR)/00000F47-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F47-08: $(ROOTINTELDIR)/00000F47-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F47-10: $(ROOTINTELDIR)/00000F47-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F47-80: $(ROOTINTELDIR)/00000F47-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F48-08: $(ROOTINTELDIR)/00000F48-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F48-10: $(ROOTINTELDIR)/00000F48-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F48-40: $(ROOTINTELDIR)/00000F48-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F49-04: $(ROOTINTELDIR)/00000F49-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F49-08: $(ROOTINTELDIR)/00000F49-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F49-10: $(ROOTINTELDIR)/00000F49-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F49-20: $(ROOTINTELDIR)/00000F49-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F49-80: $(ROOTINTELDIR)/00000F49-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F4A-08: $(ROOTINTELDIR)/00000F4A-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F4A-10: $(ROOTINTELDIR)/00000F4A-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F4A-40: $(ROOTINTELDIR)/00000F4A-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F64-10: $(ROOTINTELDIR)/00000F64-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F64-20: $(ROOTINTELDIR)/00000F64-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00000F68-20: $(ROOTINTELDIR)/00000F68-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/0001067A-10: $(ROOTINTELDIR)/0001067A-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/0001067A-40: $(ROOTINTELDIR)/0001067A-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/0001067A-80: $(ROOTINTELDIR)/0001067A-20
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000106A4-02: $(ROOTINTELDIR)/000106A4-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000106A5-02: $(ROOTINTELDIR)/000106A5-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000106E5-02: $(ROOTINTELDIR)/000106E5-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000106E5-10: $(ROOTINTELDIR)/000106E5-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00020652-10: $(ROOTINTELDIR)/00020652-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00020655-10: $(ROOTINTELDIR)/00020655-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00020655-80: $(ROOTINTELDIR)/00020655-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206A7-10: $(ROOTINTELDIR)/000206A7-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206C2-02: $(ROOTINTELDIR)/000206C2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D6-04: $(ROOTINTELDIR)/000206D6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D6-08: $(ROOTINTELDIR)/000206D6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D6-20: $(ROOTINTELDIR)/000206D6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D6-40: $(ROOTINTELDIR)/000206D6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D7-04: $(ROOTINTELDIR)/000206D7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D7-08: $(ROOTINTELDIR)/000206D7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D7-20: $(ROOTINTELDIR)/000206D7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206D7-40: $(ROOTINTELDIR)/000206D7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000206F2-04: $(ROOTINTELDIR)/000206F2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00030678-08: $(ROOTINTELDIR)/00030678-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00030679-02: $(ROOTINTELDIR)/00030679-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00030679-04: $(ROOTINTELDIR)/00030679-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00030679-08: $(ROOTINTELDIR)/00030679-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306A9-10: $(ROOTINTELDIR)/000306A9-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306C3-10: $(ROOTINTELDIR)/000306C3-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306C3-20: $(ROOTINTELDIR)/000306C3-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306D4-80: $(ROOTINTELDIR)/000306D4-40
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E4-04: $(ROOTINTELDIR)/000306E4-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E4-08: $(ROOTINTELDIR)/000306E4-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E4-20: $(ROOTINTELDIR)/000306E4-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E4-40: $(ROOTINTELDIR)/000306E4-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E4-80: $(ROOTINTELDIR)/000306E4-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E6-04: $(ROOTINTELDIR)/000306E6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E6-08: $(ROOTINTELDIR)/000306E6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E6-20: $(ROOTINTELDIR)/000306E6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E6-40: $(ROOTINTELDIR)/000306E6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E6-80: $(ROOTINTELDIR)/000306E6-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E7-04: $(ROOTINTELDIR)/000306E7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E7-08: $(ROOTINTELDIR)/000306E7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E7-20: $(ROOTINTELDIR)/000306E7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E7-40: $(ROOTINTELDIR)/000306E7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306E7-80: $(ROOTINTELDIR)/000306E7-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306F2-02: $(ROOTINTELDIR)/000306F2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306F2-04: $(ROOTINTELDIR)/000306F2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306F2-08: $(ROOTINTELDIR)/000306F2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306F2-20: $(ROOTINTELDIR)/000306F2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000306F2-40: $(ROOTINTELDIR)/000306F2-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00040651-10: $(ROOTINTELDIR)/00040651-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00040651-20: $(ROOTINTELDIR)/00040651-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00040651-40: $(ROOTINTELDIR)/00040651-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00040661-10: $(ROOTINTELDIR)/00040661-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00040661-20: $(ROOTINTELDIR)/00040661-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00040671-20: $(ROOTINTELDIR)/00040671-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406E3-80: $(ROOTINTELDIR)/000406E3-40
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406F1-02: $(ROOTINTELDIR)/000406F1-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406F1-04: $(ROOTINTELDIR)/000406F1-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406F1-08: $(ROOTINTELDIR)/000406F1-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406F1-20: $(ROOTINTELDIR)/000406F1-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406F1-40: $(ROOTINTELDIR)/000406F1-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000406F1-80: $(ROOTINTELDIR)/000406F1-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050654-02: $(ROOTINTELDIR)/00050654-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050654-04: $(ROOTINTELDIR)/00050654-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050654-10: $(ROOTINTELDIR)/00050654-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050654-20: $(ROOTINTELDIR)/00050654-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050654-80: $(ROOTINTELDIR)/00050654-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050657-02: $(ROOTINTELDIR)/00050657-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050657-04: $(ROOTINTELDIR)/00050657-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050657-08: $(ROOTINTELDIR)/00050657-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050657-10: $(ROOTINTELDIR)/00050657-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050657-20: $(ROOTINTELDIR)/00050657-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/00050657-80: $(ROOTINTELDIR)/00050657-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000506C9-02: $(ROOTINTELDIR)/000506C9-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000506CA-02: $(ROOTINTELDIR)/000506CA-01
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000506E3-04: $(ROOTINTELDIR)/000506E3-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000506E3-10: $(ROOTINTELDIR)/000506E3-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000506E3-20: $(ROOTINTELDIR)/000506E3-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000806E9-80: $(ROOTINTELDIR)/000806E9-40
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000806EA-80: $(ROOTINTELDIR)/000806EA-40
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000806EB-40: $(ROOTINTELDIR)/000806EB-10
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000806EB-80: $(ROOTINTELDIR)/000806EB-10
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000806EC-10: $(ROOTINTELDIR)/000806EC-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000806EC-80: $(ROOTINTELDIR)/000806EC-04
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000906E9-08: $(ROOTINTELDIR)/000906E9-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000906E9-20: $(ROOTINTELDIR)/000906E9-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000906EA-20: $(ROOTINTELDIR)/000906EA-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000906EC-20: $(ROOTINTELDIR)/000906EC-02
+ $(RM) $@; $(LN) $^ $@
+
+$(ROOTINTELDIR)/000906ED-20: $(ROOTINTELDIR)/000906ED-02
+ $(RM) $@; $(LN) $^ $@
+
diff --git a/usr/src/data/ucode/README.ucode b/usr/src/data/ucode/README.ucode
index 24f4d5779c..2968fc5ec5 100644
--- a/usr/src/data/ucode/README.ucode
+++ b/usr/src/data/ucode/README.ucode
@@ -27,7 +27,15 @@ Intead of using this method, we will update the microcode and manage
them in here as individual files. When updating files, please indicate
the release that the microcode was obtained from here.
+The upstream microcode for Intel can currently be found at:
+
+https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files
+
+The script "update.intel" in this directory can be used to help automate
+the update by providing a tarball of the above microcode, and takes care
+of updating the manifest as necessary. Be careful about new files.
+
AMD: Updated in March 2012 as part of illumos#2546. Exact revision
unknown.
-Intel: Linux 20190514 release
+Intel: Linux 20190918 release
diff --git a/usr/src/data/ucode/intel/00000F32-04 b/usr/src/data/ucode/intel/00000F32-04
deleted file mode 100644
index 00271ee25e..0000000000
--- a/usr/src/data/ucode/intel/00000F32-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F32-08 b/usr/src/data/ucode/intel/00000F32-08
deleted file mode 100644
index 00271ee25e..0000000000
--- a/usr/src/data/ucode/intel/00000F32-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F33-04 b/usr/src/data/ucode/intel/00000F33-04
deleted file mode 100644
index 10300a2bb9..0000000000
--- a/usr/src/data/ucode/intel/00000F33-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F33-08 b/usr/src/data/ucode/intel/00000F33-08
deleted file mode 100644
index 10300a2bb9..0000000000
--- a/usr/src/data/ucode/intel/00000F33-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F34-04 b/usr/src/data/ucode/intel/00000F34-04
deleted file mode 100644
index 27f2b9b27f..0000000000
--- a/usr/src/data/ucode/intel/00000F34-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F34-08 b/usr/src/data/ucode/intel/00000F34-08
deleted file mode 100644
index 27f2b9b27f..0000000000
--- a/usr/src/data/ucode/intel/00000F34-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F34-10 b/usr/src/data/ucode/intel/00000F34-10
deleted file mode 100644
index 27f2b9b27f..0000000000
--- a/usr/src/data/ucode/intel/00000F34-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F41-04 b/usr/src/data/ucode/intel/00000F41-04
deleted file mode 100644
index 2eeb60c67c..0000000000
--- a/usr/src/data/ucode/intel/00000F41-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F41-08 b/usr/src/data/ucode/intel/00000F41-08
deleted file mode 100644
index 2eeb60c67c..0000000000
--- a/usr/src/data/ucode/intel/00000F41-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F41-10 b/usr/src/data/ucode/intel/00000F41-10
deleted file mode 100644
index 2eeb60c67c..0000000000
--- a/usr/src/data/ucode/intel/00000F41-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F41-20 b/usr/src/data/ucode/intel/00000F41-20
deleted file mode 100644
index 2eeb60c67c..0000000000
--- a/usr/src/data/ucode/intel/00000F41-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F41-80 b/usr/src/data/ucode/intel/00000F41-80
deleted file mode 100644
index 2eeb60c67c..0000000000
--- a/usr/src/data/ucode/intel/00000F41-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F43-04 b/usr/src/data/ucode/intel/00000F43-04
deleted file mode 100644
index 0ed7e18fd7..0000000000
--- a/usr/src/data/ucode/intel/00000F43-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F43-08 b/usr/src/data/ucode/intel/00000F43-08
deleted file mode 100644
index 0ed7e18fd7..0000000000
--- a/usr/src/data/ucode/intel/00000F43-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F43-10 b/usr/src/data/ucode/intel/00000F43-10
deleted file mode 100644
index 0ed7e18fd7..0000000000
--- a/usr/src/data/ucode/intel/00000F43-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F43-80 b/usr/src/data/ucode/intel/00000F43-80
deleted file mode 100644
index 0ed7e18fd7..0000000000
--- a/usr/src/data/ucode/intel/00000F43-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F44-04 b/usr/src/data/ucode/intel/00000F44-04
deleted file mode 100644
index 669f65966c..0000000000
--- a/usr/src/data/ucode/intel/00000F44-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F44-08 b/usr/src/data/ucode/intel/00000F44-08
deleted file mode 100644
index 669f65966c..0000000000
--- a/usr/src/data/ucode/intel/00000F44-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F44-10 b/usr/src/data/ucode/intel/00000F44-10
deleted file mode 100644
index 669f65966c..0000000000
--- a/usr/src/data/ucode/intel/00000F44-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F44-80 b/usr/src/data/ucode/intel/00000F44-80
deleted file mode 100644
index 669f65966c..0000000000
--- a/usr/src/data/ucode/intel/00000F44-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F47-04 b/usr/src/data/ucode/intel/00000F47-04
deleted file mode 100644
index 0d2190c32c..0000000000
--- a/usr/src/data/ucode/intel/00000F47-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F47-08 b/usr/src/data/ucode/intel/00000F47-08
deleted file mode 100644
index 0d2190c32c..0000000000
--- a/usr/src/data/ucode/intel/00000F47-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F47-10 b/usr/src/data/ucode/intel/00000F47-10
deleted file mode 100644
index 0d2190c32c..0000000000
--- a/usr/src/data/ucode/intel/00000F47-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F47-80 b/usr/src/data/ucode/intel/00000F47-80
deleted file mode 100644
index 0d2190c32c..0000000000
--- a/usr/src/data/ucode/intel/00000F47-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F48-08 b/usr/src/data/ucode/intel/00000F48-08
deleted file mode 100644
index 8e0a1fb8f2..0000000000
--- a/usr/src/data/ucode/intel/00000F48-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F48-10 b/usr/src/data/ucode/intel/00000F48-10
deleted file mode 100644
index 8e0a1fb8f2..0000000000
--- a/usr/src/data/ucode/intel/00000F48-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F48-40 b/usr/src/data/ucode/intel/00000F48-40
deleted file mode 100644
index 8e0a1fb8f2..0000000000
--- a/usr/src/data/ucode/intel/00000F48-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F49-04 b/usr/src/data/ucode/intel/00000F49-04
deleted file mode 100644
index 3307178dfb..0000000000
--- a/usr/src/data/ucode/intel/00000F49-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F49-08 b/usr/src/data/ucode/intel/00000F49-08
deleted file mode 100644
index 3307178dfb..0000000000
--- a/usr/src/data/ucode/intel/00000F49-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F49-10 b/usr/src/data/ucode/intel/00000F49-10
deleted file mode 100644
index 3307178dfb..0000000000
--- a/usr/src/data/ucode/intel/00000F49-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F49-20 b/usr/src/data/ucode/intel/00000F49-20
deleted file mode 100644
index 3307178dfb..0000000000
--- a/usr/src/data/ucode/intel/00000F49-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F49-80 b/usr/src/data/ucode/intel/00000F49-80
deleted file mode 100644
index 3307178dfb..0000000000
--- a/usr/src/data/ucode/intel/00000F49-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F4A-08 b/usr/src/data/ucode/intel/00000F4A-08
deleted file mode 100644
index f788f5e404..0000000000
--- a/usr/src/data/ucode/intel/00000F4A-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F4A-10 b/usr/src/data/ucode/intel/00000F4A-10
deleted file mode 100644
index f788f5e404..0000000000
--- a/usr/src/data/ucode/intel/00000F4A-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F4A-40 b/usr/src/data/ucode/intel/00000F4A-40
deleted file mode 100644
index f788f5e404..0000000000
--- a/usr/src/data/ucode/intel/00000F4A-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F64-10 b/usr/src/data/ucode/intel/00000F64-10
deleted file mode 100644
index 30c70da5ba..0000000000
--- a/usr/src/data/ucode/intel/00000F64-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F64-20 b/usr/src/data/ucode/intel/00000F64-20
deleted file mode 100644
index 30c70da5ba..0000000000
--- a/usr/src/data/ucode/intel/00000F64-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00000F68-20 b/usr/src/data/ucode/intel/00000F68-20
deleted file mode 100644
index bdc81f4050..0000000000
--- a/usr/src/data/ucode/intel/00000F68-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/0001067A-10 b/usr/src/data/ucode/intel/0001067A-10
deleted file mode 100644
index 6341a6125a..0000000000
--- a/usr/src/data/ucode/intel/0001067A-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/0001067A-40 b/usr/src/data/ucode/intel/0001067A-40
deleted file mode 100644
index 5a1ae4530e..0000000000
--- a/usr/src/data/ucode/intel/0001067A-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/0001067A-80 b/usr/src/data/ucode/intel/0001067A-80
deleted file mode 100644
index aa845f7e7b..0000000000
--- a/usr/src/data/ucode/intel/0001067A-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000106A4-02 b/usr/src/data/ucode/intel/000106A4-02
deleted file mode 100644
index 4604f50e05..0000000000
--- a/usr/src/data/ucode/intel/000106A4-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000106A5-02 b/usr/src/data/ucode/intel/000106A5-02
deleted file mode 100644
index 154e08c826..0000000000
--- a/usr/src/data/ucode/intel/000106A5-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000106E5-02 b/usr/src/data/ucode/intel/000106E5-02
deleted file mode 100644
index b692f51dd2..0000000000
--- a/usr/src/data/ucode/intel/000106E5-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000106E5-10 b/usr/src/data/ucode/intel/000106E5-10
deleted file mode 100644
index b692f51dd2..0000000000
--- a/usr/src/data/ucode/intel/000106E5-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00020652-10 b/usr/src/data/ucode/intel/00020652-10
deleted file mode 100644
index f63ee5581e..0000000000
--- a/usr/src/data/ucode/intel/00020652-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00020655-10 b/usr/src/data/ucode/intel/00020655-10
deleted file mode 100644
index 06bbbc501d..0000000000
--- a/usr/src/data/ucode/intel/00020655-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00020655-80 b/usr/src/data/ucode/intel/00020655-80
deleted file mode 100644
index 06bbbc501d..0000000000
--- a/usr/src/data/ucode/intel/00020655-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206A7-10 b/usr/src/data/ucode/intel/000206A7-10
deleted file mode 100644
index 844fc1fdb8..0000000000
--- a/usr/src/data/ucode/intel/000206A7-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206C2-02 b/usr/src/data/ucode/intel/000206C2-02
deleted file mode 100644
index 2a78b4a4d2..0000000000
--- a/usr/src/data/ucode/intel/000206C2-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D6-01 b/usr/src/data/ucode/intel/000206D6-01
index d89a291172..2c9b69c74d 100644
--- a/usr/src/data/ucode/intel/000206D6-01
+++ b/usr/src/data/ucode/intel/000206D6-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D6-04 b/usr/src/data/ucode/intel/000206D6-04
deleted file mode 100644
index d89a291172..0000000000
--- a/usr/src/data/ucode/intel/000206D6-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D6-08 b/usr/src/data/ucode/intel/000206D6-08
deleted file mode 100644
index d89a291172..0000000000
--- a/usr/src/data/ucode/intel/000206D6-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D6-20 b/usr/src/data/ucode/intel/000206D6-20
deleted file mode 100644
index d89a291172..0000000000
--- a/usr/src/data/ucode/intel/000206D6-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D6-40 b/usr/src/data/ucode/intel/000206D6-40
deleted file mode 100644
index d89a291172..0000000000
--- a/usr/src/data/ucode/intel/000206D6-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D7-01 b/usr/src/data/ucode/intel/000206D7-01
index 0da2b9e3f5..52a3fb66f3 100644
--- a/usr/src/data/ucode/intel/000206D7-01
+++ b/usr/src/data/ucode/intel/000206D7-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D7-04 b/usr/src/data/ucode/intel/000206D7-04
deleted file mode 100644
index 0da2b9e3f5..0000000000
--- a/usr/src/data/ucode/intel/000206D7-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D7-08 b/usr/src/data/ucode/intel/000206D7-08
deleted file mode 100644
index 0da2b9e3f5..0000000000
--- a/usr/src/data/ucode/intel/000206D7-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D7-20 b/usr/src/data/ucode/intel/000206D7-20
deleted file mode 100644
index 0da2b9e3f5..0000000000
--- a/usr/src/data/ucode/intel/000206D7-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206D7-40 b/usr/src/data/ucode/intel/000206D7-40
deleted file mode 100644
index 0da2b9e3f5..0000000000
--- a/usr/src/data/ucode/intel/000206D7-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000206F2-04 b/usr/src/data/ucode/intel/000206F2-04
deleted file mode 100644
index 8cebe97f86..0000000000
--- a/usr/src/data/ucode/intel/000206F2-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00030678-02 b/usr/src/data/ucode/intel/00030678-02
new file mode 100644
index 0000000000..23dedb0086
--- /dev/null
+++ b/usr/src/data/ucode/intel/00030678-02
Binary files differ
diff --git a/usr/src/data/ucode/intel/00030678-04 b/usr/src/data/ucode/intel/00030678-04
new file mode 100644
index 0000000000..cad81aeeb7
--- /dev/null
+++ b/usr/src/data/ucode/intel/00030678-04
Binary files differ
diff --git a/usr/src/data/ucode/intel/00030679-01 b/usr/src/data/ucode/intel/00030679-01
new file mode 100644
index 0000000000..410fa71bf9
--- /dev/null
+++ b/usr/src/data/ucode/intel/00030679-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306A9-10 b/usr/src/data/ucode/intel/000306A9-10
deleted file mode 100644
index 896e410ca9..0000000000
--- a/usr/src/data/ucode/intel/000306A9-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306C3-10 b/usr/src/data/ucode/intel/000306C3-10
deleted file mode 100644
index a6c51f0c29..0000000000
--- a/usr/src/data/ucode/intel/000306C3-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306C3-20 b/usr/src/data/ucode/intel/000306C3-20
deleted file mode 100644
index a6c51f0c29..0000000000
--- a/usr/src/data/ucode/intel/000306C3-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306D4-40 b/usr/src/data/ucode/intel/000306D4-40
index 36c954116a..ec79c714d3 100644
--- a/usr/src/data/ucode/intel/000306D4-40
+++ b/usr/src/data/ucode/intel/000306D4-40
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306D4-80 b/usr/src/data/ucode/intel/000306D4-80
deleted file mode 100644
index 36c954116a..0000000000
--- a/usr/src/data/ucode/intel/000306D4-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E4-04 b/usr/src/data/ucode/intel/000306E4-04
deleted file mode 100644
index b60f219ea3..0000000000
--- a/usr/src/data/ucode/intel/000306E4-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E4-08 b/usr/src/data/ucode/intel/000306E4-08
deleted file mode 100644
index b60f219ea3..0000000000
--- a/usr/src/data/ucode/intel/000306E4-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E4-20 b/usr/src/data/ucode/intel/000306E4-20
deleted file mode 100644
index b60f219ea3..0000000000
--- a/usr/src/data/ucode/intel/000306E4-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E4-40 b/usr/src/data/ucode/intel/000306E4-40
deleted file mode 100644
index b60f219ea3..0000000000
--- a/usr/src/data/ucode/intel/000306E4-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E4-80 b/usr/src/data/ucode/intel/000306E4-80
deleted file mode 100644
index b60f219ea3..0000000000
--- a/usr/src/data/ucode/intel/000306E4-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E6-04 b/usr/src/data/ucode/intel/000306E6-04
deleted file mode 100644
index 41b2d07cd3..0000000000
--- a/usr/src/data/ucode/intel/000306E6-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E6-08 b/usr/src/data/ucode/intel/000306E6-08
deleted file mode 100644
index 41b2d07cd3..0000000000
--- a/usr/src/data/ucode/intel/000306E6-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E6-20 b/usr/src/data/ucode/intel/000306E6-20
deleted file mode 100644
index 41b2d07cd3..0000000000
--- a/usr/src/data/ucode/intel/000306E6-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E6-40 b/usr/src/data/ucode/intel/000306E6-40
deleted file mode 100644
index 41b2d07cd3..0000000000
--- a/usr/src/data/ucode/intel/000306E6-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E6-80 b/usr/src/data/ucode/intel/000306E6-80
deleted file mode 100644
index 41b2d07cd3..0000000000
--- a/usr/src/data/ucode/intel/000306E6-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E7-04 b/usr/src/data/ucode/intel/000306E7-04
deleted file mode 100644
index 21a97de3e5..0000000000
--- a/usr/src/data/ucode/intel/000306E7-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E7-08 b/usr/src/data/ucode/intel/000306E7-08
deleted file mode 100644
index 21a97de3e5..0000000000
--- a/usr/src/data/ucode/intel/000306E7-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E7-20 b/usr/src/data/ucode/intel/000306E7-20
deleted file mode 100644
index 21a97de3e5..0000000000
--- a/usr/src/data/ucode/intel/000306E7-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E7-40 b/usr/src/data/ucode/intel/000306E7-40
deleted file mode 100644
index 21a97de3e5..0000000000
--- a/usr/src/data/ucode/intel/000306E7-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306E7-80 b/usr/src/data/ucode/intel/000306E7-80
deleted file mode 100644
index 21a97de3e5..0000000000
--- a/usr/src/data/ucode/intel/000306E7-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306F2-02 b/usr/src/data/ucode/intel/000306F2-02
deleted file mode 100644
index 8445583922..0000000000
--- a/usr/src/data/ucode/intel/000306F2-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306F2-04 b/usr/src/data/ucode/intel/000306F2-04
deleted file mode 100644
index 8445583922..0000000000
--- a/usr/src/data/ucode/intel/000306F2-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306F2-08 b/usr/src/data/ucode/intel/000306F2-08
deleted file mode 100644
index 8445583922..0000000000
--- a/usr/src/data/ucode/intel/000306F2-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306F2-20 b/usr/src/data/ucode/intel/000306F2-20
deleted file mode 100644
index 8445583922..0000000000
--- a/usr/src/data/ucode/intel/000306F2-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306F2-40 b/usr/src/data/ucode/intel/000306F2-40
deleted file mode 100644
index 8445583922..0000000000
--- a/usr/src/data/ucode/intel/000306F2-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000306F4-80 b/usr/src/data/ucode/intel/000306F4-80
index c373a6824d..2cdbb7c270 100644
--- a/usr/src/data/ucode/intel/000306F4-80
+++ b/usr/src/data/ucode/intel/000306F4-80
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040651-10 b/usr/src/data/ucode/intel/00040651-10
deleted file mode 100644
index f93f80134b..0000000000
--- a/usr/src/data/ucode/intel/00040651-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040651-20 b/usr/src/data/ucode/intel/00040651-20
deleted file mode 100644
index f93f80134b..0000000000
--- a/usr/src/data/ucode/intel/00040651-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040651-40 b/usr/src/data/ucode/intel/00040651-40
deleted file mode 100644
index f93f80134b..0000000000
--- a/usr/src/data/ucode/intel/00040651-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040661-10 b/usr/src/data/ucode/intel/00040661-10
deleted file mode 100644
index d2d8fb5f8a..0000000000
--- a/usr/src/data/ucode/intel/00040661-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040661-20 b/usr/src/data/ucode/intel/00040661-20
deleted file mode 100644
index d2d8fb5f8a..0000000000
--- a/usr/src/data/ucode/intel/00040661-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040671-02 b/usr/src/data/ucode/intel/00040671-02
index 2d9be24fd1..939c1e93c4 100644
--- a/usr/src/data/ucode/intel/00040671-02
+++ b/usr/src/data/ucode/intel/00040671-02
Binary files differ
diff --git a/usr/src/data/ucode/intel/00040671-20 b/usr/src/data/ucode/intel/00040671-20
deleted file mode 100644
index 2d9be24fd1..0000000000
--- a/usr/src/data/ucode/intel/00040671-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406C3-01 b/usr/src/data/ucode/intel/000406C3-01
new file mode 100644
index 0000000000..f23284f784
--- /dev/null
+++ b/usr/src/data/ucode/intel/000406C3-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406C4-01 b/usr/src/data/ucode/intel/000406C4-01
new file mode 100644
index 0000000000..b0b003bbdc
--- /dev/null
+++ b/usr/src/data/ucode/intel/000406C4-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406E3-80 b/usr/src/data/ucode/intel/000406E3-80
deleted file mode 100644
index 8f7afa6efd..0000000000
--- a/usr/src/data/ucode/intel/000406E3-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-01 b/usr/src/data/ucode/intel/000406F1-01
index c524aec9c8..b38c4a5cc5 100644
--- a/usr/src/data/ucode/intel/000406F1-01
+++ b/usr/src/data/ucode/intel/000406F1-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-02 b/usr/src/data/ucode/intel/000406F1-02
deleted file mode 100644
index c524aec9c8..0000000000
--- a/usr/src/data/ucode/intel/000406F1-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-04 b/usr/src/data/ucode/intel/000406F1-04
deleted file mode 100644
index c524aec9c8..0000000000
--- a/usr/src/data/ucode/intel/000406F1-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-08 b/usr/src/data/ucode/intel/000406F1-08
deleted file mode 100644
index c524aec9c8..0000000000
--- a/usr/src/data/ucode/intel/000406F1-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-20 b/usr/src/data/ucode/intel/000406F1-20
deleted file mode 100644
index c524aec9c8..0000000000
--- a/usr/src/data/ucode/intel/000406F1-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-40 b/usr/src/data/ucode/intel/000406F1-40
deleted file mode 100644
index c524aec9c8..0000000000
--- a/usr/src/data/ucode/intel/000406F1-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000406F1-80 b/usr/src/data/ucode/intel/000406F1-80
deleted file mode 100644
index c524aec9c8..0000000000
--- a/usr/src/data/ucode/intel/000406F1-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050653-01 b/usr/src/data/ucode/intel/00050653-01
deleted file mode 100644
index e3a7b02c14..0000000000
--- a/usr/src/data/ucode/intel/00050653-01
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050653-02 b/usr/src/data/ucode/intel/00050653-02
deleted file mode 100644
index e3a7b02c14..0000000000
--- a/usr/src/data/ucode/intel/00050653-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050653-04 b/usr/src/data/ucode/intel/00050653-04
deleted file mode 100644
index e3a7b02c14..0000000000
--- a/usr/src/data/ucode/intel/00050653-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050653-10 b/usr/src/data/ucode/intel/00050653-10
deleted file mode 100644
index e3a7b02c14..0000000000
--- a/usr/src/data/ucode/intel/00050653-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050653-80 b/usr/src/data/ucode/intel/00050653-80
deleted file mode 100644
index e3a7b02c14..0000000000
--- a/usr/src/data/ucode/intel/00050653-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050654-01 b/usr/src/data/ucode/intel/00050654-01
index c0f3959412..754d08173e 100644
--- a/usr/src/data/ucode/intel/00050654-01
+++ b/usr/src/data/ucode/intel/00050654-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050654-02 b/usr/src/data/ucode/intel/00050654-02
deleted file mode 100644
index c0f3959412..0000000000
--- a/usr/src/data/ucode/intel/00050654-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050654-04 b/usr/src/data/ucode/intel/00050654-04
deleted file mode 100644
index c0f3959412..0000000000
--- a/usr/src/data/ucode/intel/00050654-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050654-10 b/usr/src/data/ucode/intel/00050654-10
deleted file mode 100644
index c0f3959412..0000000000
--- a/usr/src/data/ucode/intel/00050654-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050654-20 b/usr/src/data/ucode/intel/00050654-20
deleted file mode 100644
index c0f3959412..0000000000
--- a/usr/src/data/ucode/intel/00050654-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050654-80 b/usr/src/data/ucode/intel/00050654-80
deleted file mode 100644
index c0f3959412..0000000000
--- a/usr/src/data/ucode/intel/00050654-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050655-01 b/usr/src/data/ucode/intel/00050655-01
deleted file mode 100644
index 923b87da82..0000000000
--- a/usr/src/data/ucode/intel/00050655-01
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050655-02 b/usr/src/data/ucode/intel/00050655-02
deleted file mode 100644
index 923b87da82..0000000000
--- a/usr/src/data/ucode/intel/00050655-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050655-04 b/usr/src/data/ucode/intel/00050655-04
deleted file mode 100644
index 923b87da82..0000000000
--- a/usr/src/data/ucode/intel/00050655-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050655-10 b/usr/src/data/ucode/intel/00050655-10
deleted file mode 100644
index 923b87da82..0000000000
--- a/usr/src/data/ucode/intel/00050655-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050655-20 b/usr/src/data/ucode/intel/00050655-20
deleted file mode 100644
index 923b87da82..0000000000
--- a/usr/src/data/ucode/intel/00050655-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050655-80 b/usr/src/data/ucode/intel/00050655-80
deleted file mode 100644
index 923b87da82..0000000000
--- a/usr/src/data/ucode/intel/00050655-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-01 b/usr/src/data/ucode/intel/00050656-01
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-01
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-02 b/usr/src/data/ucode/intel/00050656-02
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-04 b/usr/src/data/ucode/intel/00050656-04
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-08 b/usr/src/data/ucode/intel/00050656-08
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-10 b/usr/src/data/ucode/intel/00050656-10
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-20 b/usr/src/data/ucode/intel/00050656-20
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050656-80 b/usr/src/data/ucode/intel/00050656-80
deleted file mode 100644
index 9aa09ed654..0000000000
--- a/usr/src/data/ucode/intel/00050656-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-01 b/usr/src/data/ucode/intel/00050657-01
index 8884c4ec91..b5e3f112a1 100644
--- a/usr/src/data/ucode/intel/00050657-01
+++ b/usr/src/data/ucode/intel/00050657-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-02 b/usr/src/data/ucode/intel/00050657-02
deleted file mode 100644
index 8884c4ec91..0000000000
--- a/usr/src/data/ucode/intel/00050657-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-04 b/usr/src/data/ucode/intel/00050657-04
deleted file mode 100644
index 8884c4ec91..0000000000
--- a/usr/src/data/ucode/intel/00050657-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-08 b/usr/src/data/ucode/intel/00050657-08
deleted file mode 100644
index 8884c4ec91..0000000000
--- a/usr/src/data/ucode/intel/00050657-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-10 b/usr/src/data/ucode/intel/00050657-10
deleted file mode 100644
index 8884c4ec91..0000000000
--- a/usr/src/data/ucode/intel/00050657-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-20 b/usr/src/data/ucode/intel/00050657-20
deleted file mode 100644
index 8884c4ec91..0000000000
--- a/usr/src/data/ucode/intel/00050657-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050657-80 b/usr/src/data/ucode/intel/00050657-80
deleted file mode 100644
index 8884c4ec91..0000000000
--- a/usr/src/data/ucode/intel/00050657-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050662-10 b/usr/src/data/ucode/intel/00050662-10
index 75fc81dbd1..2b4c64d027 100644
--- a/usr/src/data/ucode/intel/00050662-10
+++ b/usr/src/data/ucode/intel/00050662-10
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050663-10 b/usr/src/data/ucode/intel/00050663-10
index 387f5a4e19..37f7333bc6 100644
--- a/usr/src/data/ucode/intel/00050663-10
+++ b/usr/src/data/ucode/intel/00050663-10
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050664-10 b/usr/src/data/ucode/intel/00050664-10
index 21a6db266d..0e8fc2b5fe 100644
--- a/usr/src/data/ucode/intel/00050664-10
+++ b/usr/src/data/ucode/intel/00050664-10
Binary files differ
diff --git a/usr/src/data/ucode/intel/00050665-10 b/usr/src/data/ucode/intel/00050665-10
index 2800d7c687..b2c17aa506 100644
--- a/usr/src/data/ucode/intel/00050665-10
+++ b/usr/src/data/ucode/intel/00050665-10
Binary files differ
diff --git a/usr/src/data/ucode/intel/000506C9-02 b/usr/src/data/ucode/intel/000506C9-02
deleted file mode 100644
index b999fdb674..0000000000
--- a/usr/src/data/ucode/intel/000506C9-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000506CA-01 b/usr/src/data/ucode/intel/000506CA-01
index 6aaf638f96..51c83447b4 100644
--- a/usr/src/data/ucode/intel/000506CA-01
+++ b/usr/src/data/ucode/intel/000506CA-01
Binary files differ
diff --git a/usr/src/data/ucode/intel/000506CA-02 b/usr/src/data/ucode/intel/000506CA-02
deleted file mode 100644
index 6aaf638f96..0000000000
--- a/usr/src/data/ucode/intel/000506CA-02
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000506E3-04 b/usr/src/data/ucode/intel/000506E3-04
deleted file mode 100644
index 3dfc610744..0000000000
--- a/usr/src/data/ucode/intel/000506E3-04
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000506E3-10 b/usr/src/data/ucode/intel/000506E3-10
deleted file mode 100644
index 3dfc610744..0000000000
--- a/usr/src/data/ucode/intel/000506E3-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000506E3-20 b/usr/src/data/ucode/intel/000506E3-20
deleted file mode 100644
index 3dfc610744..0000000000
--- a/usr/src/data/ucode/intel/000506E3-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000806E9-80 b/usr/src/data/ucode/intel/000806E9-80
deleted file mode 100644
index 49aea22aee..0000000000
--- a/usr/src/data/ucode/intel/000806E9-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000806EA-80 b/usr/src/data/ucode/intel/000806EA-80
deleted file mode 100644
index 20ff87c8c8..0000000000
--- a/usr/src/data/ucode/intel/000806EA-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000806EB-40 b/usr/src/data/ucode/intel/000806EB-40
deleted file mode 100644
index 9eae11d13c..0000000000
--- a/usr/src/data/ucode/intel/000806EB-40
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000806EB-80 b/usr/src/data/ucode/intel/000806EB-80
deleted file mode 100644
index 9eae11d13c..0000000000
--- a/usr/src/data/ucode/intel/000806EB-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000806EC-10 b/usr/src/data/ucode/intel/000806EC-10
deleted file mode 100644
index b0458f3abc..0000000000
--- a/usr/src/data/ucode/intel/000806EC-10
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000806EC-80 b/usr/src/data/ucode/intel/000806EC-80
deleted file mode 100644
index b0458f3abc..0000000000
--- a/usr/src/data/ucode/intel/000806EC-80
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000906E9-08 b/usr/src/data/ucode/intel/000906E9-08
deleted file mode 100644
index 51202b3fca..0000000000
--- a/usr/src/data/ucode/intel/000906E9-08
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000906E9-20 b/usr/src/data/ucode/intel/000906E9-20
deleted file mode 100644
index 51202b3fca..0000000000
--- a/usr/src/data/ucode/intel/000906E9-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000906EA-20 b/usr/src/data/ucode/intel/000906EA-20
deleted file mode 100644
index 68aafca7ed..0000000000
--- a/usr/src/data/ucode/intel/000906EA-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000906EC-20 b/usr/src/data/ucode/intel/000906EC-20
deleted file mode 100644
index 5feee15c02..0000000000
--- a/usr/src/data/ucode/intel/000906EC-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/intel/000906ED-20 b/usr/src/data/ucode/intel/000906ED-20
deleted file mode 100644
index b438fbddcb..0000000000
--- a/usr/src/data/ucode/intel/000906ED-20
+++ /dev/null
Binary files differ
diff --git a/usr/src/data/ucode/update.intel b/usr/src/data/ucode/update.intel
new file mode 100755
index 0000000000..943348ecbd
--- /dev/null
+++ b/usr/src/data/ucode/update.intel
@@ -0,0 +1,95 @@
+#!/bin/ksh
+
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+
+# Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2019 Joyent, Inc.
+
+# A simple update script that extracts an Intel microcode download file
+# into the intel/ directory, and updates the hardlinks in the
+# system/kernel/platform manifest.
+
+set -e
+set -o pipefail
+
+[[ -z "$1" ]] || [[ ! -f "$1" ]] && {
+ echo "Syntax: $0 <path to microcode tar>" >&2
+ exit 1
+}
+
+ucodetar="$1"
+
+mf=../../pkg/manifests/system-kernel-platform.mf
+[[ -f $mf ]] || {
+ echo "Run from usr/src/data/ucode" 2>&1
+ exit 1
+}
+
+fw=platform/i86pc/ucode/GenuineIntel
+
+tmp=$(mktemp -d)
+mkdir $tmp/out
+
+gtar -C $tmp -xvf "$ucodetar"
+
+find $tmp/Intel-Linux-Processor-Microcode-Data*/intel-ucode*/ -type f \
+ | while read f; do
+ echo "Converting $(basename $f)"
+ cp $f $tmp/intel-fw
+ ucodeadm -i -R $tmp/out $tmp/intel-fw
+ rm -f $tmp/intel-fw
+done
+
+pkgfmt -u $mf
+mv $mf $mf.tmp
+egrep -v "(file|hardlink) path=$fw" $mf.tmp > $mf
+rm -f $mf.tmp
+
+rm -f intel/*
+rm -f Makefile.links
+
+typeset -A seen
+typeset -A inodes
+typeset -A links
+
+for f in $tmp/out/*; do
+ bf=$(basename $f)
+ [[ -n "${seen[$bf]}" ]] && continue
+ inode=$(stat -c %i $f)
+ if [[ -n "${inodes[$inode]}" ]]; then
+ links[$bf]=${inodes[$inode]}
+ else
+ inodes[$inode]=$bf
+ seen[$bf]=1
+ cp $f intel/$bf
+ fi
+ seen[$bf]=1
+done
+
+for f in intel/*; do
+ bf=$(basename $f)
+ echo "\$(i386_ONLY)file path=$fw/$bf group=sys mode=0444 reboot-needed=true" >> $mf
+done
+
+echo "INTEL_LINKS = ${!links[@]}" > Makefile.links
+echo >> Makefile.links
+
+for i in "${!links[@]}"; do
+ echo "\$(i386_ONLY)hardlink path=$fw/$i target=${links[$i]}" >> $mf
+ cat << EOM >> Makefile.links
+\$(ROOTINTELDIR)/$i: \$(ROOTINTELDIR)/${links[$i]}
+ \$(RM) \$@; \$(LN) \$^ \$@
+
+EOM
+done
+
+pkgfmt $mf
+
+rm -rf $tmp
diff --git a/usr/src/lib/README.Makefiles b/usr/src/lib/README.Makefiles
index b576c3a9fc..4ca4c2f68a 100644
--- a/usr/src/lib/README.Makefiles
+++ b/usr/src/lib/README.Makefiles
@@ -21,9 +21,6 @@
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
Writing Library Makefiles in ON
===============================
@@ -446,14 +443,14 @@ The third section typically consists of the following macros:
when compiling 64-bit code. Since all 64-bit code is compiled
$(CCVERBOSE), you usually do not need to modify CFLAGS64.
- COPTFLAG (if necessary)
+ COPTFLAG (if necessary)
Set to control the optimization level used by the C compiler when
compiling 32-bit code. You should only set this if absolutely
necessary, and it should only contain optimization-related
settings (or -g).
- COPTFLAG64 (if necessary)
+ COPTFLAG64 (if necessary)
Set to control the optimization level used by the C compiler when
compiling 64-bit code. You should only set this if absolutely
@@ -619,7 +616,7 @@ outlined in this document:
lib/libdhcpagent
- Example of a simple 32-bit only library that obtains its sources
+ Example of a simple 32/64-bit library that obtains its sources
from multiple directories.
lib/ncad_addr
diff --git a/usr/src/lib/libbsm/common/au_preselect.c b/usr/src/lib/libbsm/common/au_preselect.c
index 67512a6212..ea80c4bfb4 100644
--- a/usr/src/lib/libbsm/common/au_preselect.c
+++ b/usr/src/lib/libbsm/common/au_preselect.c
@@ -22,6 +22,8 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2019 by Western Digital Corporation
*/
/*
@@ -29,6 +31,7 @@
*/
#include <sys/types.h>
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <bsm/audit.h>
@@ -150,11 +153,10 @@ load_map()
event_count = 0;
setauevent();
while ((evp = getauevent()) != (au_event_ent_t *)NULL) {
- if (event_count > alloc_count)
- if (realloc_map() == -1) {
- endauevent();
- return (-1);
- }
+ if (event_count == alloc_count && realloc_map() == -1) {
+ endauevent();
+ return (-1);
+ }
event_map[event_count].event = evp->ae_number;
event_map[event_count].class = evp->ae_class;
++event_count;
@@ -170,12 +172,21 @@ load_map()
static int
realloc_map()
{
- register size_t rsize;
- rsize = sizeof (event_map_t) * (alloc_count + ALLOC_INCR);
+ uint_t new_alloc_count;
+ event_map_t *new_event_map;
- if ((event_map = (event_map_t *)
- realloc(event_map, rsize)) == (event_map_t *)NULL)
+ new_alloc_count = alloc_count + ALLOC_INCR;
+ if (new_alloc_count <= alloc_count) {
+ errno = ENOMEM;
return (-1);
+ }
+
+ if ((new_event_map = recallocarray(event_map, alloc_count,
+ new_alloc_count, sizeof (event_map_t))) == NULL)
+ return (-1);
+
+ alloc_count = new_alloc_count;
+ event_map = new_event_map;
return (0);
}
diff --git a/usr/src/lib/libdhcpagent/Makefile b/usr/src/lib/libdhcpagent/Makefile
index 0232cfd534..e45522b144 100644
--- a/usr/src/lib/libdhcpagent/Makefile
+++ b/usr/src/lib/libdhcpagent/Makefile
@@ -22,7 +22,7 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include ../Makefile.lib
@@ -30,16 +30,16 @@ include ../Makefile.lib
HDRS = dhcp_hostconf.h dhcpagent_ipc.h dhcpagent_util.h dhcp_stable.h
HDRDIR = common
SUBDIRS = $(MACH)
+$(BUILD64)SUBDIRS += $(MACH64)
all := TARGET = all
clean := TARGET = clean
clobber := TARGET = clobber
install := TARGET = install
-lint := TARGET = lint
.KEEP_STATE:
-all clean clobber install lint: $(SUBDIRS)
+all clean clobber install: $(SUBDIRS)
install_h: $(ROOTHDRS)
diff --git a/usr/src/lib/libdhcpagent/Makefile.com b/usr/src/lib/libdhcpagent/Makefile.com
index c62f6c26c2..7efc8bcc94 100644
--- a/usr/src/lib/libdhcpagent/Makefile.com
+++ b/usr/src/lib/libdhcpagent/Makefile.com
@@ -23,6 +23,7 @@
# Use is subject to license terms.
#
# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
LIBRARY = libdhcpagent.a
VERS = .1
@@ -33,14 +34,13 @@ include ../../Makefile.lib
# install this library in the root filesystem
include ../../Makefile.rootfs
-LIBS = $(DYNLIB) $(LINTLIB)
+LIBS = $(DYNLIB)
LDLIBS += -lc -lsocket -ldhcputil -luuid -ldlpi -lcontract
SRCDIR = ../common
-$(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
-CFLAGS += $(CCVERBOSE)
+CFLAGS += $(CCVERBOSE)
CERRWARN += -_gcc=-Wno-type-limits
# needs work
@@ -50,6 +50,4 @@ SMOFF += allocating_enough_data
all: $(LIBS)
-lint: lintcheck
-
include ../../Makefile.targ
diff --git a/usr/src/lib/libdhcpagent/amd64/Makefile b/usr/src/lib/libdhcpagent/amd64/Makefile
new file mode 100644
index 0000000000..2b996f5855
--- /dev/null
+++ b/usr/src/lib/libdhcpagent/amd64/Makefile
@@ -0,0 +1,32 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License"). You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright (c) 1999-2001 by Sun Microsystems, Inc.
+# All rights reserved.
+#
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install: all $(ROOTLIBS64) $(ROOTLINKS64)
diff --git a/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h b/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h
index be2da33666..beed5b1ffc 100644
--- a/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h
+++ b/usr/src/lib/libdhcpagent/common/dhcpagent_ipc.h
@@ -24,6 +24,7 @@
*/
/*
* Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#ifndef _DHCPAGENT_IPC_H
@@ -92,7 +93,7 @@ typedef enum {
typedef enum {
DHCP_DROP, DHCP_EXTEND, DHCP_PING, DHCP_RELEASE,
- DHCP_START, DHCP_STATUS, DHCP_INFORM, DHCP_GET_TAG,
+ DHCP_START, DHCP_STATUS, DHCP_INFORM, DHCP_GET_TAG,
DHCP_NIPC, /* number of supported requests */
DHCP_PRIMARY = 0x100,
DHCP_V6 = 0x200
@@ -219,10 +220,16 @@ typedef struct dhcp_status {
char if_name[LIFNAMSIZ];
DHCPSTATE if_state; /* state of interface; see above */
- time_t if_began; /* time lease began (absolute) */
- time_t if_t1; /* renewing time (absolute) */
- time_t if_t2; /* rebinding time (absolute) */
- time_t if_lease; /* lease expiration time (absolute) */
+ /*
+ * We use int64_t here so that the structure is the same in both
+ * 32 and 64-bit, since it is passed via IPC.
+ * Once everything that uses this is 64-bit, these could be changed
+ * to time_t.
+ */
+ int64_t if_began; /* time lease began (absolute) */
+ int64_t if_t1; /* renewing time (absolute) */
+ int64_t if_t2; /* rebinding time (absolute) */
+ int64_t if_lease; /* lease expiration time (absolute) */
uint16_t if_dflags; /* DHCP flags on this if; see above */
diff --git a/usr/src/lib/libdhcpagent/i386/Makefile b/usr/src/lib/libdhcpagent/i386/Makefile
index fa5f2962d2..64d377eef1 100644
--- a/usr/src/lib/libdhcpagent/i386/Makefile
+++ b/usr/src/lib/libdhcpagent/i386/Makefile
@@ -23,9 +23,9 @@
# Copyright (c) 1999-2001 by Sun Microsystems, Inc.
# All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include ../Makefile.com
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+install: all $(ROOTLIBS) $(ROOTLINKS)
diff --git a/usr/src/lib/libdhcpagent/sparc/Makefile b/usr/src/lib/libdhcpagent/sparc/Makefile
index fa5f2962d2..64d377eef1 100644
--- a/usr/src/lib/libdhcpagent/sparc/Makefile
+++ b/usr/src/lib/libdhcpagent/sparc/Makefile
@@ -23,9 +23,9 @@
# Copyright (c) 1999-2001 by Sun Microsystems, Inc.
# All rights reserved.
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
include ../Makefile.com
-install: all $(ROOTLIBS) $(ROOTLINKS) $(ROOTLINT)
+install: all $(ROOTLIBS) $(ROOTLINKS)
diff --git a/usr/src/man/man1m/netstat.1m b/usr/src/man/man1m/netstat.1m
index 5b119fbb43..e5f40aa6e8 100644
--- a/usr/src/man/man1m/netstat.1m
+++ b/usr/src/man/man1m/netstat.1m
@@ -1,15 +1,15 @@
'\" te
+.\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
.\" Copyright 2018, Joyent, Inc.
.\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright 1989 AT&T
.\" Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
-.TH NETSTAT 1M "Sep 02, 2015"
+.TH NETSTAT 1M "Jul 12, 2016"
.SH NAME
netstat \- show network status
.SH SYNOPSIS
-.LP
.nf
-\fBnetstat\fR [\fB-anvR\fR] [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
+\fBnetstat\fR [\fB-anuvR\fR] [\fB-f\fR \fIaddress_family\fR] [\fB-P\fR \fIprotocol\fR]
.fi
.LP
@@ -55,7 +55,6 @@ netstat \- show network status
.fi
.SH DESCRIPTION
-.LP
The \fBnetstat\fR command displays the contents of certain network-related data
structures in various formats, depending on the options you select.
.LP
@@ -115,7 +114,7 @@ by the \fB-f\fR option.
.SH OPTIONS
.ne 2
.na
-\fB\fB-a\fR\fR
+\fB-a\fR
.ad
.sp .6
.RS 4n
@@ -128,7 +127,7 @@ default routes are shown and only the status of physical interfaces is shown.
.sp
.ne 2
.na
-\fB\fB-c\fR\fR
+\fB-c\fR
.ad
.sp .6
.RS 4n
@@ -141,7 +140,7 @@ IPv4 netmask will print "/NM" if this flag is enabled.
.sp
.ne 2
.na
-\fB\fB-f\fR \fIaddress_family\fR\fR
+\fB-f\fR \fIaddress_family\fR
.ad
.sp .6
.RS 4n
@@ -150,7 +149,7 @@ Limit all displays to those of the specified \fIaddress_family\fR. The value of
.sp
.ne 2
.na
-\fB\fBinet\fR\fR
+\fBinet\fR
.ad
.RS 9n
For the \fBAF_INET\fR address family showing IPv4 information.
@@ -159,7 +158,7 @@ For the \fBAF_INET\fR address family showing IPv4 information.
.sp
.ne 2
.na
-\fB\fBinet6\fR\fR
+\fBinet6\fR
.ad
.RS 9n
For the \fBAF_INET6\fR address family showing IPv6 information.
@@ -168,7 +167,7 @@ For the \fBAF_INET6\fR address family showing IPv6 information.
.sp
.ne 2
.na
-\fB\fBunix\fR\fR
+\fBunix\fR
.ad
.RS 9n
For the \fBAF_UNIX\fR address family.
@@ -179,7 +178,7 @@ For the \fBAF_UNIX\fR address family.
.sp
.ne 2
.na
-\fB\fB-f\fR \fIfilter\fR\fR
+\fB-f\fR \fIfilter\fR
.ad
.sp .6
.RS 4n
@@ -189,7 +188,7 @@ keywords and the value syntax are:
.sp
.ne 2
.na
-\fB\fBaf:\fR{\fBinet\fR|\fBinet6\fR|\fBunix\fR|\fInumber\fR}\fR
+\fBaf:\fR{\fBinet\fR|\fBinet6\fR|\fBunix\fR|\fInumber\fR}
.ad
.sp .6
.RS 4n
@@ -200,7 +199,7 @@ and both syntaxes are supported.
.sp
.ne 2
.na
-\fB\fBoutif\fR:{\fIname\fR|\fIifIndex\fR|\fBany\fR|\fBnone\fR}\fR
+\fBoutif\fR:{\fIname\fR|\fIifIndex\fR|\fBany\fR|\fBnone\fR}
.ad
.sp .6
.RS 4n
@@ -215,7 +214,7 @@ interface with the \fB-a\fR option of \fBifconfig\fR(1M).
.sp
.ne 2
.na
-\fB\fBdst\fR:{\fIip-address\fR[/\fImask\fR]|\fBany\fR|\fBnone\fR}\fR
+\fBdst\fR:{\fIip-address\fR[/\fImask\fR]|\fBany\fR|\fBnone\fR}
.ad
.sp .6
.RS 4n
@@ -228,7 +227,7 @@ address 0 is selected.
.sp
.ne 2
.na
-\fB\fBflags:\fR[\fB+ -\fR]?[\fBABDGHLMSU\fR]\fB+\fR\fR
+\fBflags:\fR[\fB+ -\fR]?[\fBABDGHLMSU\fR]\fB+\fR
.ad
.sp .6
.RS 4n
@@ -256,7 +255,7 @@ length 8 or greater, and an output interface of either \fBhme0\fR or
.sp
.ne 2
.na
-\fB\fB-g\fR\fR
+\fB-g\fR
.ad
.sp .6
.RS 4n
@@ -268,7 +267,7 @@ DISPLAYS, below.
.sp
.ne 2
.na
-\fB\fB-i\fR\fR
+\fB-i\fR
.ad
.sp .6
.RS 4n
@@ -281,7 +280,7 @@ See \fBifconfig\fR(1M).
.sp
.ne 2
.na
-\fB\fB-m\fR\fR
+\fB-m\fR
.ad
.sp .6
.RS 4n
@@ -291,7 +290,7 @@ Show the STREAMS memory statistics.
.sp
.ne 2
.na
-\fB\fB-n\fR\fR
+\fB-n\fR
.ad
.sp .6
.RS 4n
@@ -302,7 +301,7 @@ symbols. This option may be used with any of the display formats.
.sp
.ne 2
.na
-\fB\fB-p\fR\fR
+\fB-p\fR
.ad
.sp .6
.RS 4n
@@ -312,7 +311,7 @@ Show the net to media tables. See DISPLAYS, below.
.sp
.ne 2
.na
-\fB\fB-r\fR\fR
+\fB-r\fR
.ad
.sp .6
.RS 4n
@@ -326,7 +325,7 @@ although the kernel will derive such an entry if needed.
.sp
.ne 2
.na
-\fB\fB-s\fR\fR
+\fB-s\fR
.ad
.sp .6
.RS 4n
@@ -339,7 +338,7 @@ statistics global to the system. See DISPLAYS, below.
.sp
.ne 2
.na
-\fB\fB-T\fR \fBu\fR | \fBd\fR\fR
+\fB-T\fR \fBu\fR | \fBd\fR
.ad
.sp .6
.RS 4n
@@ -353,18 +352,38 @@ time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
.sp
.ne 2
.na
-\fB\fB-v\fR\fR
+\fB-u\fR
+.ad
+.sp .6
+.RS 4n
+For each network endpoint show the list of processes which currently have an
+open file descriptor pointing to that endpoint. For each process in that list,
+show the username, process ID and associated program; the information
+may be truncated. Where multiple processes are associated with an endpoint,
+a line will be output for each process.
+.sp
+While the system gathers this information, the processes associated with a
+given endpoint may change. If such a change occurs, it may not be reflected in
+the output.
+.RE
+
+.sp
+.ne 2
+.na
+\fB-v\fR
.ad
.sp .6
.RS 4n
Verbose. Show additional information for the sockets, STREAMS memory
-statistics, routing table, and multicast group memberships.
+statistics, routing table, and multicast group memberships. In conjunction with
+the \fB-u\fR flag, show the arguments with which the process was started;
+these may be truncated.
.RE
.sp
.ne 2
.na
-\fB\fB-I\fR \fIinterface\fR\fR
+\fB-I\fR \fIinterface\fR
.ad
.sp .6
.RS 4n
@@ -377,7 +396,7 @@ for physical interfaces are displayed. When this option is combined with the
.sp
.ne 2
.na
-\fB\fB-M\fR\fR
+\fB-M\fR
.ad
.sp .6
.RS 4n
@@ -388,7 +407,7 @@ multicast routing statistics instead.
.sp
.ne 2
.na
-\fB\fB-P\fR \fIprotocol\fR\fR
+\fB-P\fR \fIprotocol\fR
.ad
.sp .6
.RS 4n
@@ -402,7 +421,7 @@ accepts protocol options only as all lowercase.
.sp
.ne 2
.na
-\fB\fB-D\fR\fR
+\fB-D\fR
.ad
.sp .6
.RS 4n
@@ -412,7 +431,7 @@ Show the status of \fBDHCP\fR configured interfaces.
.sp
.ne 2
.na
-\fB\fB-R\fR\fR
+\fB-R\fR
.ad
.sp .6
.RS 4n
@@ -442,7 +461,7 @@ The following flags can be appended to the socket's "State" output:
.sp
.ne 2
.na
-\fB\fBP\fR\fR
+\fBP\fR
.ad
.RS 5n
The socket is a MLP on zone-private IP addresses.
@@ -451,7 +470,7 @@ The socket is a MLP on zone-private IP addresses.
.sp
.ne 2
.na
-\fB\fBS\fR\fR
+\fBS\fR
.ad
.RS 5n
The socket is a MLP on IP addresses shared between zones.
@@ -484,7 +503,6 @@ the interval specified by \fIinterval\fR.
.SH DISPLAYS
.SS "Active Sockets (First Form)"
-.LP
The display for each active socket shows the local and remote address, the send
and receive queue sizes (in bytes), the send and receive windows (in bytes),
and the internal state of the protocol.
@@ -521,12 +539,11 @@ For SCTP sockets, because an endpoint can be represented by multiple addresses,
the verbose option (\fB-v\fR) displays the list of all the local and remote
addresses.
.SS "\fITCP Sockets\fR"
-.LP
The possible state values for \fBTCP\fR sockets are as follows:
.sp
.ne 2
.na
-\fB\fBBOUND\fR\fR
+\fBBOUND\fR
.ad
.RS 16n
Bound, ready to connect or listen.
@@ -535,7 +552,7 @@ Bound, ready to connect or listen.
.sp
.ne 2
.na
-\fB\fBCLOSED\fR\fR
+\fBCLOSED\fR
.ad
.RS 16n
Closed. The socket is not being used.
@@ -544,7 +561,7 @@ Closed. The socket is not being used.
.sp
.ne 2
.na
-\fB\fBCLOSING\fR\fR
+\fBCLOSING\fR
.ad
.RS 16n
Closed, then remote shutdown; awaiting acknowledgment.
@@ -553,7 +570,7 @@ Closed, then remote shutdown; awaiting acknowledgment.
.sp
.ne 2
.na
-\fB\fBCLOSE_WAIT\fR\fR
+\fBCLOSE_WAIT\fR
.ad
.RS 16n
Remote shutdown; waiting for the socket to close.
@@ -562,7 +579,7 @@ Remote shutdown; waiting for the socket to close.
.sp
.ne 2
.na
-\fB\fBESTABLISHED\fR\fR
+\fBESTABLISHED\fR
.ad
.RS 16n
Connection has been established.
@@ -571,7 +588,7 @@ Connection has been established.
.sp
.ne 2
.na
-\fB\fBFIN_WAIT_1\fR\fR
+\fBFIN_WAIT_1\fR
.ad
.RS 16n
Socket closed; shutting down connection.
@@ -580,7 +597,7 @@ Socket closed; shutting down connection.
.sp
.ne 2
.na
-\fB\fBFIN_WAIT_2\fR\fR
+\fBFIN_WAIT_2\fR
.ad
.RS 16n
Socket closed; waiting for shutdown from remote.
@@ -589,7 +606,7 @@ Socket closed; waiting for shutdown from remote.
.sp
.ne 2
.na
-\fB\fBIDLE\fR\fR
+\fBIDLE\fR
.ad
.RS 16n
Idle, opened but not bound.
@@ -598,7 +615,7 @@ Idle, opened but not bound.
.sp
.ne 2
.na
-\fB\fBLAST_ACK\fR\fR
+\fBLAST_ACK\fR
.ad
.RS 16n
Remote shutdown, then closed; awaiting acknowledgment.
@@ -607,7 +624,7 @@ Remote shutdown, then closed; awaiting acknowledgment.
.sp
.ne 2
.na
-\fB\fBLISTEN\fR\fR
+\fBLISTEN\fR
.ad
.RS 16n
Listening for incoming connections.
@@ -616,7 +633,7 @@ Listening for incoming connections.
.sp
.ne 2
.na
-\fB\fBSYN_RECEIVED\fR\fR
+\fBSYN_RECEIVED\fR
.ad
.RS 16n
Initial synchronization of the connection under way.
@@ -625,7 +642,7 @@ Initial synchronization of the connection under way.
.sp
.ne 2
.na
-\fB\fBSYN_SENT\fR\fR
+\fBSYN_SENT\fR
.ad
.RS 16n
Actively trying to establish connection.
@@ -634,19 +651,18 @@ Actively trying to establish connection.
.sp
.ne 2
.na
-\fB\fBTIME_WAIT\fR\fR
+\fBTIME_WAIT\fR
.ad
.RS 16n
Wait after close for remote shutdown retransmission.
.RE
.SS "\fISCTP Sockets\fR"
-.LP
The possible state values for SCTP sockets are as follows:
.sp
.ne 2
.na
-\fB\fBCLOSED\fR\fR
+\fBCLOSED\fR
.ad
.RS 21n
Closed. The socket is not being used.
@@ -655,7 +671,7 @@ Closed. The socket is not being used.
.sp
.ne 2
.na
-\fB\fBLISTEN\fR\fR
+\fBLISTEN\fR
.ad
.RS 21n
Listening for incoming associations.
@@ -664,7 +680,7 @@ Listening for incoming associations.
.sp
.ne 2
.na
-\fB\fBESTABLISHED\fR\fR
+\fBESTABLISHED\fR
.ad
.RS 21n
Association has been established.
@@ -673,7 +689,7 @@ Association has been established.
.sp
.ne 2
.na
-\fB\fBCOOKIE_WAIT\fR\fR
+\fBCOOKIE_WAIT\fR
.ad
.RS 21n
\fBINIT\fR has been sent to the peer, awaiting acknowledgment.
@@ -682,7 +698,7 @@ Association has been established.
.sp
.ne 2
.na
-\fB\fBCOOKIE_ECHOED\fR\fR
+\fBCOOKIE_ECHOED\fR
.ad
.RS 21n
State cookie from the INIT-ACK has been sent to the peer, awaiting
@@ -692,7 +708,7 @@ acknowledgement.
.sp
.ne 2
.na
-\fB\fBSHUTDOWN_PENDING\fR\fR
+\fBSHUTDOWN_PENDING\fR
.ad
.RS 21n
\fBSHUTDOWN\fR has been received from the upper layer, awaiting acknowledgement
@@ -702,7 +718,7 @@ of all outstanding \fBDATA\fR from the peer.
.sp
.ne 2
.na
-\fB\fBSHUTDOWN_SENT\fR\fR
+\fBSHUTDOWN_SENT\fR
.ad
.RS 21n
All outstanding data has been acknowledged in the \fBSHUTDOWN_SENT\fR state.
@@ -712,7 +728,7 @@ All outstanding data has been acknowledged in the \fBSHUTDOWN_SENT\fR state.
.sp
.ne 2
.na
-\fB\fBSHUTDOWN_RECEIVED\fR\fR
+\fBSHUTDOWN_RECEIVED\fR
.ad
.RS 21n
\fBSHUTDOWN\fR has been received from the peer, awaiting acknowledgement of all
@@ -722,7 +738,7 @@ outstanding \fBDATA\fR.
.sp
.ne 2
.na
-\fB\fBSHUTDOWN_ACK_SENT\fR\fR
+\fBSHUTDOWN_ACK_SENT\fR
.ad
.RS 21n
All outstanding data has been acknowledged in the \fBSHUTDOWN_RECEIVED\fR
@@ -730,13 +746,12 @@ state. \fBSHUTDOWN_ACK\fR has been sent to the peer.
.RE
.SS "Network Data Structures (Second Through Fifth Forms)"
-.LP
The form of the display depends upon which of the \fB-g\fR, \fB-m\fR, \fB-p\fR,
or \fB-s\fR options you select.
.sp
.ne 2
.na
-\fB\fB-g\fR\fR
+\fB-g\fR
.ad
.RS 6n
Displays the list of multicast group membership.
@@ -745,7 +760,7 @@ Displays the list of multicast group membership.
.sp
.ne 2
.na
-\fB\fB-m\fR\fR
+\fB-m\fR
.ad
.RS 6n
Displays the memory usage, for example, STREAMS mblks.
@@ -754,7 +769,7 @@ Displays the memory usage, for example, STREAMS mblks.
.sp
.ne 2
.na
-\fB\fB-p\fR\fR
+\fB-p\fR
.ad
.RS 6n
Displays the net to media mapping table. For IPv4, the address resolution table
@@ -764,7 +779,7 @@ is displayed. See \fBarp\fR(1M). For IPv6, the neighbor cache is displayed.
.sp
.ne 2
.na
-\fB\fB-s\fR\fR
+\fB-s\fR
.ad
.RS 6n
Displays the statistics for the various protocol layers.
@@ -777,7 +792,7 @@ The statistics use the MIB specified variables. The defined values for
.sp
.ne 2
.na
-\fB\fBforwarding (1)\fR\fR
+\fBforwarding (1)\fR
.ad
.RS 21n
Acting as a gateway.
@@ -786,7 +801,7 @@ Acting as a gateway.
.sp
.ne 2
.na
-\fB\fBnot-forwarding (2)\fR\fR
+\fBnot-forwarding (2)\fR
.ad
.RS 21n
Not acting as a gateway.
@@ -805,7 +820,6 @@ options. You can also specify \fB-m\fR (the fifth form) with any set of the
\fB-g\fR, \fB-p\fR, and \fB-s\fR options. If you specify more than one of these
options, \fBnetstat\fR displays the information for each one of them.
.SS "Interface Status (Sixth Form)"
-.LP
The interface status display lists information for all current interfaces, one
interface per line. If an interface is specified using the \fB-I\fR option, it
displays information for only the specified interface.
@@ -849,7 +863,6 @@ packets errs packets errs colls packets errs packets errs colls
If the input interface is not specified, the first interface of address family
\fBinet\fR or \fBinet6\fR will be displayed.
.SS "Routing Table (Seventh Form)"
-.LP
The routing table display lists the available routes and the status of each.
Each route consists of a destination host or network, and a gateway to use in
forwarding packets. The \fIflags\fR column shows the status of the route. These
@@ -857,7 +870,7 @@ flags are as follows:
.sp
.ne 2
.na
-\fB\fBU\fR\fR
+\fBU\fR
.ad
.RS 5n
Indicates route is \fBup\fR.
@@ -866,7 +879,7 @@ Indicates route is \fBup\fR.
.sp
.ne 2
.na
-\fB\fBG\fR\fR
+\fBG\fR
.ad
.RS 5n
Route is to a gateway.
@@ -875,7 +888,7 @@ Route is to a gateway.
.sp
.ne 2
.na
-\fB\fBH\fR\fR
+\fBH\fR
.ad
.RS 5n
Route is to a host and not a network.
@@ -884,7 +897,7 @@ Route is to a host and not a network.
.sp
.ne 2
.na
-\fB\fBM\fR\fR
+\fBM\fR
.ad
.RS 5n
Redundant route established with the \fB-multirt\fR option.
@@ -893,7 +906,7 @@ Redundant route established with the \fB-multirt\fR option.
.sp
.ne 2
.na
-\fB\fBS\fR\fR
+\fBS\fR
.ad
.RS 5n
Route was established using the \fB-setsrc\fR option.
@@ -902,7 +915,7 @@ Route was established using the \fB-setsrc\fR option.
.sp
.ne 2
.na
-\fB\fBD\fR\fR
+\fBD\fR
.ad
.RS 5n
Route was created dynamically by a redirect.
@@ -915,7 +928,7 @@ following flags:
.sp
.ne 2
.na
-\fB\fBA\fR\fR
+\fBA\fR
.ad
.RS 5n
Combined routing and address resolution entries.
@@ -924,7 +937,7 @@ Combined routing and address resolution entries.
.sp
.ne 2
.na
-\fB\fBB\fR\fR
+\fBB\fR
.ad
.RS 5n
Broadcast addresses.
@@ -933,7 +946,7 @@ Broadcast addresses.
.sp
.ne 2
.na
-\fB\fBL\fR\fR
+\fBL\fR
.ad
.RS 5n
Local addresses for the host.
@@ -952,11 +965,9 @@ create a new combined route and address resolution entry.
The \fIinterface\fR entry indicates the network interface utilized for the
route.
.SS "Multicast Routing Tables (Eighth Form)"
-.LP
The multicast routing table consists of the virtual interface table and the
actual routing table.
.SS "DHCP Interface Information (Ninth Form)"
-.LP
The \fBDHCP\fR interface information consists of the interface name, its
current state, lease information, packet counts, and a list of flags.
.LP
@@ -987,7 +998,7 @@ The flags currently defined include:
.sp
.ne 2
.na
-\fB\fBBOOTP\fR\fR
+\fBBOOTP\fR
.ad
.RS 11n
The interface has a lease obtained through \fBBOOTP\fR (IPv4 only).
@@ -996,7 +1007,7 @@ The interface has a lease obtained through \fBBOOTP\fR (IPv4 only).
.sp
.ne 2
.na
-\fB\fBBUSY\fR\fR
+\fBBUSY\fR
.ad
.RS 11n
The interface is busy with a \fBDHCP\fR transaction.
@@ -1005,7 +1016,7 @@ The interface is busy with a \fBDHCP\fR transaction.
.sp
.ne 2
.na
-\fB\fBPRIMARY\fR\fR
+\fBPRIMARY\fR
.ad
.RS 11n
The interface is the primary interface. See \fBdhcpinfo\fR(1) and
@@ -1015,7 +1026,7 @@ The interface is the primary interface. See \fBdhcpinfo\fR(1) and
.sp
.ne 2
.na
-\fB\fBFAILED\fR\fR
+\fBFAILED\fR
.ad
.RS 11n
The interface is in failure state and must be manually restarted.
@@ -1033,14 +1044,13 @@ future lease.
.SH FILES
.ne 2
.na
-\fB\fB/etc/default/inet_type\fR\fR
+\fB/etc/default/inet_type\fR
.ad
.RS 26n
\fBDEFAULT_IP\fR setting
.RE
.SH SEE ALSO
-.LP
\fBarp\fR(1M), \fBdhcpinfo\fR(1), \fBdhcpagent\fR(1M), \fBifconfig\fR(1M),
\fBiostat\fR(1M), \fBkstat\fR(1M), \fBmibiisa\fR(1M), \fBndp\fR(1M), \fBsavecore\fR(1M),
\fBvmstat\fR(1M), \fBhosts\fR(4), \fBinet_type\fR(4), \fBnetworks\fR(4),
@@ -1055,7 +1065,6 @@ Group, March 1997.
Droms, R. \fIRFC 3315, Dynamic Host Configuration Protocol for IPv6
(DHCPv6)\fR. Cisco Systems. July 2003.
.SH NOTES
-.LP
When displaying interface information, \fBnetstat\fR honors the
\fBDEFAULT_IP\fR setting in \fB/etc/default/inet_type\fR. If it is set to
\fBIP_VERSION4\fR, then \fBnetstat\fR will omit information relating to IPv6
diff --git a/usr/src/pkg/manifests/system-kernel-platform.mf b/usr/src/pkg/manifests/system-kernel-platform.mf
index 23d97f1a3e..f91c304c1a 100644
--- a/usr/src/pkg/manifests/system-kernel-platform.mf
+++ b/usr/src/pkg/manifests/system-kernel-platform.mf
@@ -24,6 +24,7 @@
# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
# Copyright 2014 Gary Mills
# Copyright 2019 Peter Tribble.
+# Copyright 2019 Joyent, Inc.
#
#
@@ -272,6 +273,8 @@ $(i386_ONLY)dir path=platform/i86pc/kernel/mach/$(ARCH64) group=sys
$(i386_ONLY)dir path=platform/i86pc/kernel/misc group=sys
$(i386_ONLY)dir path=platform/i86pc/kernel/misc/$(ARCH64) group=sys
$(i386_ONLY)dir path=platform/i86pc/ucode group=sys
+$(i386_ONLY)dir path=platform/i86pc/ucode/AuthenticAMD group=sys
+$(i386_ONLY)dir path=platform/i86pc/ucode/GenuineIntel group=sys
$(i386_ONLY)dir path=platform/i86xpv group=sys
$(i386_ONLY)dir path=platform/i86xpv/kernel group=sys
$(i386_ONLY)dir path=platform/i86xpv/kernel/$(ARCH64) group=sys
@@ -751,12 +754,396 @@ $(i386_ONLY)file path=platform/i86pc/kernel/misc/$(ARCH64)/acpidev group=sys \
mode=0755
$(i386_ONLY)file path=platform/i86pc/kernel/misc/$(ARCH64)/gfx_private \
group=sys mode=0755
-$(i386_ONLY)file path=platform/i86pc/ucode/amd-ucode.bin group=sys mode=0444 \
- original_name=SUNWcakr:platform/i86pc/ucode/amd-ucode.bin preserve=true \
- reboot-needed=true
-$(i386_ONLY)file path=platform/i86pc/ucode/intel-ucode.txt group=sys mode=0444 \
- original_name=SUNWcakr:platform/i86pc/ucode/intel-ucode.txt preserve=true \
- reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1020-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1022-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1041-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1043-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1062-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1080-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/1081-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/10A0-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/3010-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/5010-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/5020-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/6012-00 group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/container group=sys \
+ mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/AuthenticAMD/equivalence-table \
+ group=sys mode=0444 preserve=true reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000650-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000650-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000650-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000651-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000652-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000652-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000652-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000653-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000653-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000653-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000653-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000660-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000665-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000066A-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000066A-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000066A-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000066D-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000066D-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000066D-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000671-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000672-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000673-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000681-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000681-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000681-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000681-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000681-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000683-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000683-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000686-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000686-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000686-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000686-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000686-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000068A-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000068A-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0000068A-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000695-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000695-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000695-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006A0-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006A1-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006B1-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006B1-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006B4-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006B4-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006D6-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006E8-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006EC-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006EC-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F2-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F2-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F6-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F6-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F6-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F7-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006F7-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FA-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FB-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FD-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FD-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000006FD-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F07-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F07-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F0A-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F0A-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F0A-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F12-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F24-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F24-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F24-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F25-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F25-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F25-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F25-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F26-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F27-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F27-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F27-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F29-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F29-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F29-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F32-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F33-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F34-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F41-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F41-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F43-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F44-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F47-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F48-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F48-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F48-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F49-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F4A-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F4A-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F62-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F64-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F64-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F65-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00000F68-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00001632-00 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010661-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010661-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010661-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010676-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010676-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010676-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010676-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010676-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00010677-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0001067A-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0001067A-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/0001067A-20 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106A4-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106A5-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106C2-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106C2-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106C2-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106CA-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106CA-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106CA-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106CA-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106D1-08 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000106E5-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00020652-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00020655-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00020661-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00020661-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000206A7-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000206C2-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000206D6-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000206D7-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000206E6-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000206F2-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00030678-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00030678-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00030679-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306A9-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306C3-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306D4-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306E4-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306E6-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306E7-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306F2-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000306F4-80 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00040651-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00040661-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00040671-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000406C3-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000406C4-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000406E3-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000406F1-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00050654-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00050657-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00050662-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00050663-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00050664-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/00050665-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000506C2-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000506C9-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000506CA-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000506E3-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000506F1-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000706A1-01 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000806E9-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000806E9-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000806EA-40 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000806EB-10 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000806EC-04 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000906E9-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000906EA-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000906EB-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000906EC-02 group=sys \
+ mode=0444 reboot-needed=true
+$(i386_ONLY)file path=platform/i86pc/ucode/GenuineIntel/000906ED-02 group=sys \
+ mode=0444 reboot-needed=true
$(i386_ONLY)file path=platform/i86xpv/kernel/$(ARCH64)/unix group=sys \
mode=0755
$(i386_ONLY)file path=platform/i86xpv/kernel/cpu/$(ARCH64)/cpu.generic \
@@ -1009,6 +1396,260 @@ $(sparc_ONLY)file path=usr/share/man/man7d/zsh.7d
$(i386_ONLY)hardlink \
path=platform/i86pc/kernel/cpu/$(ARCH64)/cpu_ms.GenuineIntel.6.47 \
target=cpu_ms.GenuineIntel.6.46
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F32-04 \
+ target=00000F32-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F32-08 \
+ target=00000F32-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F33-04 \
+ target=00000F33-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F33-08 \
+ target=00000F33-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F34-04 \
+ target=00000F34-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F34-08 \
+ target=00000F34-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F34-10 \
+ target=00000F34-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F41-04 \
+ target=00000F41-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F41-08 \
+ target=00000F41-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F41-10 \
+ target=00000F41-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F41-20 \
+ target=00000F41-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F41-80 \
+ target=00000F41-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F43-04 \
+ target=00000F43-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F43-08 \
+ target=00000F43-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F43-10 \
+ target=00000F43-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F43-80 \
+ target=00000F43-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F44-04 \
+ target=00000F44-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F44-08 \
+ target=00000F44-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F44-10 \
+ target=00000F44-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F44-80 \
+ target=00000F44-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F47-04 \
+ target=00000F47-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F47-08 \
+ target=00000F47-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F47-10 \
+ target=00000F47-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F47-80 \
+ target=00000F47-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F48-08 \
+ target=00000F48-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F48-10 \
+ target=00000F48-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F48-40 \
+ target=00000F48-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F49-04 \
+ target=00000F49-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F49-08 \
+ target=00000F49-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F49-10 \
+ target=00000F49-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F49-20 \
+ target=00000F49-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F49-80 \
+ target=00000F49-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F4A-08 \
+ target=00000F4A-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F4A-10 \
+ target=00000F4A-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F4A-40 \
+ target=00000F4A-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F64-10 \
+ target=00000F64-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F64-20 \
+ target=00000F64-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00000F68-20 \
+ target=00000F68-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/0001067A-10 \
+ target=0001067A-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/0001067A-40 \
+ target=0001067A-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/0001067A-80 \
+ target=0001067A-20
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000106A4-02 \
+ target=000106A4-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000106A5-02 \
+ target=000106A5-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000106E5-02 \
+ target=000106E5-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000106E5-10 \
+ target=000106E5-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00020652-10 \
+ target=00020652-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00020655-10 \
+ target=00020655-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00020655-80 \
+ target=00020655-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206A7-10 \
+ target=000206A7-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206C2-02 \
+ target=000206C2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D6-04 \
+ target=000206D6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D6-08 \
+ target=000206D6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D6-20 \
+ target=000206D6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D6-40 \
+ target=000206D6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D7-04 \
+ target=000206D7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D7-08 \
+ target=000206D7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D7-20 \
+ target=000206D7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206D7-40 \
+ target=000206D7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000206F2-04 \
+ target=000206F2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00030678-08 \
+ target=00030678-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00030679-02 \
+ target=00030679-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00030679-04 \
+ target=00030679-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00030679-08 \
+ target=00030679-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306A9-10 \
+ target=000306A9-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306C3-10 \
+ target=000306C3-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306C3-20 \
+ target=000306C3-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306D4-80 \
+ target=000306D4-40
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E4-04 \
+ target=000306E4-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E4-08 \
+ target=000306E4-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E4-20 \
+ target=000306E4-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E4-40 \
+ target=000306E4-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E4-80 \
+ target=000306E4-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E6-04 \
+ target=000306E6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E6-08 \
+ target=000306E6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E6-20 \
+ target=000306E6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E6-40 \
+ target=000306E6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E6-80 \
+ target=000306E6-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E7-04 \
+ target=000306E7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E7-08 \
+ target=000306E7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E7-20 \
+ target=000306E7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E7-40 \
+ target=000306E7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306E7-80 \
+ target=000306E7-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306F2-02 \
+ target=000306F2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306F2-04 \
+ target=000306F2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306F2-08 \
+ target=000306F2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306F2-20 \
+ target=000306F2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000306F2-40 \
+ target=000306F2-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00040651-10 \
+ target=00040651-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00040651-20 \
+ target=00040651-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00040651-40 \
+ target=00040651-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00040661-10 \
+ target=00040661-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00040661-20 \
+ target=00040661-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00040671-20 \
+ target=00040671-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406E3-80 \
+ target=000406E3-40
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406F1-02 \
+ target=000406F1-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406F1-04 \
+ target=000406F1-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406F1-08 \
+ target=000406F1-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406F1-20 \
+ target=000406F1-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406F1-40 \
+ target=000406F1-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000406F1-80 \
+ target=000406F1-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050654-02 \
+ target=00050654-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050654-04 \
+ target=00050654-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050654-10 \
+ target=00050654-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050654-20 \
+ target=00050654-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050654-80 \
+ target=00050654-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050657-02 \
+ target=00050657-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050657-04 \
+ target=00050657-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050657-08 \
+ target=00050657-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050657-10 \
+ target=00050657-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050657-20 \
+ target=00050657-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/00050657-80 \
+ target=00050657-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000506C9-02 \
+ target=000506C9-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000506CA-02 \
+ target=000506CA-01
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000506E3-04 \
+ target=000506E3-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000506E3-10 \
+ target=000506E3-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000506E3-20 \
+ target=000506E3-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000806E9-80 \
+ target=000806E9-40
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000806EA-80 \
+ target=000806EA-40
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000806EB-40 \
+ target=000806EB-10
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000806EB-80 \
+ target=000806EB-10
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000806EC-10 \
+ target=000806EC-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000806EC-80 \
+ target=000806EC-04
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000906E9-08 \
+ target=000906E9-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000906E9-20 \
+ target=000906E9-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000906EA-20 \
+ target=000906EA-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000906EC-20 \
+ target=000906EC-02
+$(i386_ONLY)hardlink path=platform/i86pc/ucode/GenuineIntel/000906ED-20 \
+ target=000906ED-02
$(sparc_ONLY)hardlink path=platform/sun4u/kernel/misc/$(ARCH64)/md5 \
target=../../../kernel/crypto/$(ARCH64)/md5
$(sparc_ONLY)hardlink path=platform/sun4u/kernel/misc/$(ARCH64)/sha1 \
diff --git a/usr/src/pkg/manifests/system-library.mf b/usr/src/pkg/manifests/system-library.mf
index 7ee57036d1..ba0cf527d8 100644
--- a/usr/src/pkg/manifests/system-library.mf
+++ b/usr/src/pkg/manifests/system-library.mf
@@ -26,6 +26,7 @@
# Copyright 2017 Nexenta Systems, Inc.
# Copyright 2017 RackTop Systems.
# Copyright 2018, Joyent, Inc.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#
<include system-library.man3.inc>
@@ -195,6 +196,7 @@ file path=lib/$(ARCH64)/libcustr.so.1
file path=lib/$(ARCH64)/libdevice.so.1
file path=lib/$(ARCH64)/libdevid.so.1
file path=lib/$(ARCH64)/libdevinfo.so.1
+file path=lib/$(ARCH64)/libdhcpagent.so.1
file path=lib/$(ARCH64)/libdhcputil.so.1
file path=lib/$(ARCH64)/libdl.so.1
file path=lib/$(ARCH64)/libdladm.so.1
@@ -842,6 +844,8 @@ link path=usr/lib/$(ARCH64)/libdevinfo.so \
target=../../../lib/$(ARCH64)/libdevinfo.so.1
link path=usr/lib/$(ARCH64)/libdevinfo.so.1 \
target=../../../lib/$(ARCH64)/libdevinfo.so.1
+link path=usr/lib/$(ARCH64)/libdhcpagent.so.1 \
+ target=../../../lib/$(ARCH64)/libdhcpagent.so.1
link path=usr/lib/$(ARCH64)/libdhcputil.so.1 \
target=../../../lib/$(ARCH64)/libdhcputil.so.1
link path=usr/lib/$(ARCH64)/libdisasm.so target=libdisasm.so.1
diff --git a/usr/src/uts/common/fs/sockfs/sockcommon.h b/usr/src/uts/common/fs/sockfs/sockcommon.h
index 4e333be0aa..fbbbafe560 100644
--- a/usr/src/uts/common/fs/sockfs/sockcommon.h
+++ b/usr/src/uts/common/fs/sockfs/sockcommon.h
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#ifndef _SOCKCOMMON_H_
@@ -162,23 +163,25 @@ extern void so_connected(sock_upper_handle_t, sock_connid_t, struct cred *,
pid_t);
extern int so_disconnected(sock_upper_handle_t, sock_connid_t, int);
extern void so_txq_full(sock_upper_handle_t, boolean_t);
-extern void so_opctl(sock_upper_handle_t, sock_opctl_action_t, uintptr_t);
+extern void so_opctl(sock_upper_handle_t, sock_opctl_action_t, uintptr_t);
+extern vnode_t *so_get_vnode(sock_upper_handle_t);
+
/* Common misc. functions */
/* accept queue */
-extern int so_acceptq_enqueue(struct sonode *, struct sonode *);
-extern int so_acceptq_enqueue_locked(struct sonode *, struct sonode *);
+extern int so_acceptq_enqueue(struct sonode *, struct sonode *);
+extern int so_acceptq_enqueue_locked(struct sonode *, struct sonode *);
extern int so_acceptq_dequeue(struct sonode *, boolean_t,
struct sonode **);
extern void so_acceptq_flush(struct sonode *, boolean_t);
/* connect */
-extern int so_wait_connected(struct sonode *, boolean_t, sock_connid_t);
+extern int so_wait_connected(struct sonode *, boolean_t, sock_connid_t);
/* send */
-extern int so_snd_wait_qnotfull(struct sonode *, boolean_t);
+extern int so_snd_wait_qnotfull(struct sonode *, boolean_t);
extern void so_snd_qfull(struct sonode *so);
-extern void so_snd_qnotfull(struct sonode *so);
+extern void so_snd_qnotfull(struct sonode *so);
extern int socket_chgpgrp(struct sonode *, pid_t);
extern void socket_sendsig(struct sonode *, int);
@@ -189,7 +192,7 @@ extern void so_process_new_message(struct sonode *, mblk_t *, mblk_t *);
extern boolean_t so_check_flow_control(struct sonode *);
extern mblk_t *socopyinuio(uio_t *, ssize_t, size_t, ssize_t, size_t, int *);
-extern mblk_t *socopyoutuio(mblk_t *, struct uio *, ssize_t, int *);
+extern mblk_t *socopyoutuio(mblk_t *, struct uio *, ssize_t, int *);
extern boolean_t somsghasdata(mblk_t *);
extern void so_rcv_flush(struct sonode *);
@@ -228,9 +231,9 @@ extern void so_notify_shutdown(struct sonode *);
extern void so_notify_error(struct sonode *);
/* Common sonode functions */
-extern int sonode_constructor(void *, void *, int);
+extern int sonode_constructor(void *, void *, int);
extern void sonode_destructor(void *, void *);
-extern void sonode_init(struct sonode *, struct sockparams *,
+extern void sonode_init(struct sonode *, struct sockparams *,
int, int, int, sonodeops_t *);
extern void sonode_fini(struct sonode *);
diff --git a/usr/src/uts/common/fs/sockfs/sockcommon_sops.c b/usr/src/uts/common/fs/sockfs/sockcommon_sops.c
index 9b8186a8a0..bc2878ccc8 100644
--- a/usr/src/uts/common/fs/sockfs/sockcommon_sops.c
+++ b/usr/src/uts/common/fs/sockfs/sockcommon_sops.c
@@ -25,6 +25,7 @@
/*
* Copyright (c) 2015, Joyent, Inc. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -1568,6 +1569,18 @@ so_closed(sock_upper_handle_t sock_handle)
VN_RELE(SOTOV(so));
}
+vnode_t *
+so_get_vnode(sock_upper_handle_t sock_handle)
+{
+ sonode_t *so = (sonode_t *)sock_handle;
+ vnode_t *vn;
+
+ vn = SOTOV(so);
+ VN_HOLD(vn);
+
+ return (vn);
+}
+
void
so_zcopy_notify(sock_upper_handle_t sock_handle)
{
@@ -1603,10 +1616,10 @@ int
so_recvmsg(struct sonode *so, struct nmsghdr *msg, struct uio *uiop,
struct cred *cr)
{
- rval_t rval;
- int flags = 0;
+ rval_t rval;
+ int flags = 0;
t_uscalar_t controllen, namelen;
- int error = 0;
+ int error = 0;
int ret;
mblk_t *mctlp = NULL;
union T_primitives *tpr;
@@ -1975,5 +1988,6 @@ sock_upcalls_t so_upcalls = {
so_signal_oob,
so_zcopy_notify,
so_set_error,
- so_closed
+ so_closed,
+ so_get_vnode
};
diff --git a/usr/src/uts/common/fs/sockfs/socksubr.c b/usr/src/uts/common/fs/sockfs/socksubr.c
index 7a7651edb5..be3cca7e97 100644
--- a/usr/src/uts/common/fs/sockfs/socksubr.c
+++ b/usr/src/uts/common/fs/sockfs/socksubr.c
@@ -23,6 +23,7 @@
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015, Joyent, Inc. All rights reserved.
* Copyright 2016 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -115,17 +116,6 @@ extern void nl7c_init(void);
extern int modrootloaded;
-#define ADRSTRLEN (2 * sizeof (void *) + 1)
-/*
- * kernel structure for passing the sockinfo data back up to the user.
- * the strings array allows us to convert AF_UNIX addresses into strings
- * with a common method regardless of which n-bit kernel we're running.
- */
-struct k_sockinfo {
- struct sockinfo ks_si;
- char ks_straddr[3][ADRSTRLEN];
-};
-
/*
* Translate from a device pathname (e.g. "/dev/tcp") to a vnode.
* Returns with the vnode held.
@@ -1769,7 +1759,7 @@ sockfs_update(kstat_t *ksp, int rw)
}
}
ksp->ks_ndata = nactive;
- ksp->ks_data_size = nactive * sizeof (struct k_sockinfo);
+ ksp->ks_data_size = nactive * sizeof (struct sockinfo);
return (0);
}
@@ -1779,10 +1769,10 @@ sockfs_snapshot(kstat_t *ksp, void *buf, int rw)
{
int ns; /* # of sonodes we've copied */
struct sonode *so; /* current sonode on socklist */
- struct k_sockinfo *pksi; /* where we put sockinfo data */
+ struct sockinfo *psi; /* where we put sockinfo data */
t_uscalar_t sn_len; /* soa_len */
zoneid_t myzoneid = (zoneid_t)(uintptr_t)ksp->ks_private;
- sotpi_info_t *sti;
+ sotpi_info_t *sti;
ASSERT((zoneid_t)(uintptr_t)ksp->ks_private == getzoneid());
@@ -1793,12 +1783,14 @@ sockfs_snapshot(kstat_t *ksp, void *buf, int rw)
}
/*
- * for each sonode on the socklist, we massage the important
- * info into buf, in k_sockinfo format.
+ * For each sonode on the socklist, we massage the important
+ * info into buf, in sockinfo format.
*/
- pksi = (struct k_sockinfo *)buf;
+ psi = (struct sockinfo *)buf;
ns = 0;
for (so = socklist.sl_list; so != NULL; so = SOTOTPI(so)->sti_next_so) {
+ vattr_t attr;
+
/* only stuff active sonodes and the same zone: */
if (so->so_count == 0 || so->so_zoneid != myzoneid) {
continue;
@@ -1808,26 +1800,35 @@ sockfs_snapshot(kstat_t *ksp, void *buf, int rw)
* If the sonode was activated between the update and the
* snapshot, we're done - as this is only a snapshot.
*/
- if ((caddr_t)(pksi) >= (caddr_t)buf + ksp->ks_data_size) {
+ if ((caddr_t)(psi) >= (caddr_t)buf + ksp->ks_data_size) {
break;
}
sti = SOTOTPI(so);
/* copy important info into buf: */
- pksi->ks_si.si_size = sizeof (struct k_sockinfo);
- pksi->ks_si.si_family = so->so_family;
- pksi->ks_si.si_type = so->so_type;
- pksi->ks_si.si_flag = so->so_flag;
- pksi->ks_si.si_state = so->so_state;
- pksi->ks_si.si_serv_type = sti->sti_serv_type;
- pksi->ks_si.si_ux_laddr_sou_magic =
- sti->sti_ux_laddr.soua_magic;
- pksi->ks_si.si_ux_faddr_sou_magic =
- sti->sti_ux_faddr.soua_magic;
- pksi->ks_si.si_laddr_soa_len = sti->sti_laddr.soa_len;
- pksi->ks_si.si_faddr_soa_len = sti->sti_faddr.soa_len;
- pksi->ks_si.si_szoneid = so->so_zoneid;
- pksi->ks_si.si_faddr_noxlate = sti->sti_faddr_noxlate;
+ psi->si_size = sizeof (struct sockinfo);
+ psi->si_family = so->so_family;
+ psi->si_type = so->so_type;
+ psi->si_flag = so->so_flag;
+ psi->si_state = so->so_state;
+ psi->si_serv_type = sti->sti_serv_type;
+ psi->si_ux_laddr_sou_magic = sti->sti_ux_laddr.soua_magic;
+ psi->si_ux_faddr_sou_magic = sti->sti_ux_faddr.soua_magic;
+ psi->si_laddr_soa_len = sti->sti_laddr.soa_len;
+ psi->si_faddr_soa_len = sti->sti_faddr.soa_len;
+ psi->si_szoneid = so->so_zoneid;
+ psi->si_faddr_noxlate = sti->sti_faddr_noxlate;
+
+ /*
+ * Grab the inode, if possible.
+ * This must be done before entering so_lock as VOP_GETATTR
+ * will acquire it.
+ */
+ if (so->so_vnode == NULL ||
+ VOP_GETATTR(so->so_vnode, &attr, 0, CRED(), NULL) != 0)
+ attr.va_nodeid = 0;
+
+ psi->si_inode = attr.va_nodeid;
mutex_enter(&so->so_lock);
@@ -1835,47 +1836,50 @@ sockfs_snapshot(kstat_t *ksp, void *buf, int rw)
ASSERT(sti->sti_laddr_sa->sa_data != NULL);
sn_len = sti->sti_laddr_len;
ASSERT(sn_len <= sizeof (short) +
- sizeof (pksi->ks_si.si_laddr_sun_path));
+ sizeof (psi->si_laddr_sun_path));
- pksi->ks_si.si_laddr_family =
+ psi->si_laddr_family =
sti->sti_laddr_sa->sa_family;
if (sn_len != 0) {
/* AF_UNIX socket names are NULL terminated */
- (void) strncpy(pksi->ks_si.si_laddr_sun_path,
+ (void) strncpy(psi->si_laddr_sun_path,
sti->sti_laddr_sa->sa_data,
- sizeof (pksi->ks_si.si_laddr_sun_path));
- sn_len = strlen(pksi->ks_si.si_laddr_sun_path);
+ sizeof (psi->si_laddr_sun_path));
+ sn_len = strlen(psi->si_laddr_sun_path);
}
- pksi->ks_si.si_laddr_sun_path[sn_len] = 0;
+ psi->si_laddr_sun_path[sn_len] = 0;
}
if (sti->sti_faddr_sa != NULL) {
ASSERT(sti->sti_faddr_sa->sa_data != NULL);
sn_len = sti->sti_faddr_len;
ASSERT(sn_len <= sizeof (short) +
- sizeof (pksi->ks_si.si_faddr_sun_path));
+ sizeof (psi->si_faddr_sun_path));
- pksi->ks_si.si_faddr_family =
+ psi->si_faddr_family =
sti->sti_faddr_sa->sa_family;
if (sn_len != 0) {
- (void) strncpy(pksi->ks_si.si_faddr_sun_path,
+ (void) strncpy(psi->si_faddr_sun_path,
sti->sti_faddr_sa->sa_data,
- sizeof (pksi->ks_si.si_faddr_sun_path));
- sn_len = strlen(pksi->ks_si.si_faddr_sun_path);
+ sizeof (psi->si_faddr_sun_path));
+ sn_len = strlen(psi->si_faddr_sun_path);
}
- pksi->ks_si.si_faddr_sun_path[sn_len] = 0;
+ psi->si_faddr_sun_path[sn_len] = 0;
}
mutex_exit(&so->so_lock);
- (void) sprintf(pksi->ks_straddr[0], "%p", (void *)so);
- (void) sprintf(pksi->ks_straddr[1], "%p",
+ (void) snprintf(psi->si_son_straddr,
+ sizeof (psi->si_son_straddr), "%p", (void *)so);
+ (void) snprintf(psi->si_lvn_straddr,
+ sizeof (psi->si_lvn_straddr), "%p",
(void *)sti->sti_ux_laddr.soua_vp);
- (void) sprintf(pksi->ks_straddr[2], "%p",
+ (void) snprintf(psi->si_fvn_straddr,
+ sizeof (psi->si_fvn_straddr), "%p",
(void *)sti->sti_ux_faddr.soua_vp);
ns++;
- pksi++;
+ psi++;
}
ksp->ks_ndata = ns;
diff --git a/usr/src/uts/common/fs/specfs/specvnops.c b/usr/src/uts/common/fs/specfs/specvnops.c
index e6f732c04b..9c42c4f97c 100644
--- a/usr/src/uts/common/fs/specfs/specvnops.c
+++ b/usr/src/uts/common/fs/specfs/specvnops.c
@@ -23,10 +23,11 @@
* Use is subject to license terms.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2017 by Delphix. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -443,7 +444,7 @@ spec_size(struct snode *csp)
}
/*
- * This function deal with vnode substitution in the case of
+ * This function deals with vnode substitution in the case of
* device cloning.
*/
static int
@@ -451,7 +452,7 @@ spec_clone(struct vnode **vpp, dev_t newdev, int vtype, struct stdata *stp)
{
dev_t dev = (*vpp)->v_rdev;
major_t maj = getmajor(dev);
- major_t newmaj = getmajor(newdev);
+ major_t newmaj = getmajor(newdev);
int sysclone = (maj == clone_major);
int qassociate_used = 0;
struct snode *oldsp, *oldcsp;
@@ -544,6 +545,7 @@ spec_clone(struct vnode **vpp, dev_t newdev, int vtype, struct stdata *stp)
mutex_enter(&newcsp->s_lock);
newcvp->v_stream = newvp->v_stream = stp;
stp->sd_vnode = newcvp;
+ stp->sd_pvnode = newvp;
stp->sd_strtab = STREAMSTAB(newmaj);
mutex_exit(&newcsp->s_lock);
UNLOCK_CSP(newcsp);
@@ -2573,7 +2575,7 @@ spec_dump(
/*
* Do i/o on the given page list from/to vp, io_off for io_len.
* Flags are composed of:
- * {B_ASYNC, B_INVAL, B_FREE, B_DONTNEED, B_READ, B_WRITE}
+ * {B_ASYNC, B_INVAL, B_FREE, B_DONTNEED, B_READ, B_WRITE}
* If B_ASYNC is not set i/o is waited for.
*/
/*ARGSUSED5*/
diff --git a/usr/src/uts/common/inet/ip/ipclassifier.c b/usr/src/uts/common/inet/ip/ipclassifier.c
index a59027801f..77d9d8df7e 100644
--- a/usr/src/uts/common/inet/ip/ipclassifier.c
+++ b/usr/src/uts/common/inet/ip/ipclassifier.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2016 Joyent, Inc.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
/*
@@ -61,7 +62,7 @@
*
* Classifier uses several hash tables:
*
- * ipcl_conn_fanout: contains all TCP connections in CONNECTED state
+ * ipcl_conn_fanout: contains all TCP connections in CONNECTED state
* ipcl_bind_fanout: contains all connections in BOUND state
* ipcl_proto_fanout: IPv4 protocol fanout
* ipcl_proto_fanout_v6: IPv6 protocol fanout
@@ -103,7 +104,7 @@
* hdr_len: The size of IP header. It is used to find TCP or UDP header in
* the packet.
*
- * ira->ira_zoneid: The zone in which the returned connection must be; the
+ * ira->ira_zoneid: The zone in which the returned connection must be; the
* zoneid corresponding to the ire_zoneid on the IRE located for
* the packet's destination address.
*
@@ -168,13 +169,13 @@
* conn_t *ipcl_lookup_listener_v6(lport, laddr, protocol, ifindex,
* zoneid, ip_stack);
*
- * Lookup routine to find a listener with the tuple {lport, laddr,
- * protocol} in the ipcl_bind_fanout table. For IPv6, an additional
- * parameter interface index is also compared.
+ * Lookup routine to find a listener with the tuple {lport, laddr,
+ * protocol} in the ipcl_bind_fanout table. For IPv6, an additional
+ * parameter interface index is also compared.
*
* void ipcl_walk(func, arg, ip_stack)
*
- * Apply 'func' to every connection available. The 'func' is called as
+ * Apply 'func' to every connection available. The 'func' is called as
* (*func)(connp, arg). The walk is non-atomic so connections may be
* created and destroyed during the walk. The CONN_CONDEMNED and
* CONN_INCIPIENT flags ensure that connections which are newly created
@@ -188,7 +189,7 @@
* int ipcl_conn_insert_v6(connp);
*
* Insert 'connp' in the ipcl_conn_fanout.
- * Arguements :
+ * Arguments :
* connp conn_t to be inserted
*
* Return value :
@@ -200,22 +201,22 @@
* int ipcl_bind_insert_v4(connp);
* int ipcl_bind_insert_v6(connp);
*
- * Insert 'connp' in ipcl_bind_fanout.
- * Arguements :
- * connp conn_t to be inserted
+ * Insert 'connp' in ipcl_bind_fanout.
+ * Arguments :
+ * connp conn_t to be inserted
*
*
* void ipcl_hash_remove(connp);
*
- * Removes the 'connp' from the connection fanout table.
+ * Removes the 'connp' from the connection fanout table.
*
* Connection Creation/Destruction
* -------------------------------
*
* conn_t *ipcl_conn_create(type, sleep, netstack_t *)
*
- * Creates a new conn based on the type flag, inserts it into
- * globalhash table.
+ * Creates a new conn based on the type flag, inserts it into
+ * globalhash table.
*
* type: This flag determines the type of conn_t which needs to be
* created i.e., which kmem_cache it comes from.
@@ -228,8 +229,8 @@
*
* void ipcl_conn_destroy(connp)
*
- * Destroys the connection state, removes it from the global
- * connection hash table and frees its memory.
+ * Destroys the connection state, removes it from the global
+ * connection hash table and frees its memory.
*/
#include <sys/types.h>
@@ -1951,7 +1952,7 @@ static int
tcp_conn_constructor(void *buf, void *cdrarg, int kmflags)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
tcp_t *tcp = (tcp_t *)&itc[1];
bzero(connp, sizeof (conn_t));
@@ -1985,7 +1986,7 @@ static void
tcp_conn_destructor(void *buf, void *cdrarg)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
tcp_t *tcp = (tcp_t *)&itc[1];
ASSERT(connp->conn_flags & IPCL_TCPCONN);
@@ -2011,7 +2012,7 @@ static int
ip_conn_constructor(void *buf, void *cdrarg, int kmflags)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
bzero(connp, sizeof (conn_t));
mutex_init(&connp->conn_lock, NULL, MUTEX_DEFAULT, NULL);
@@ -2032,7 +2033,7 @@ static void
ip_conn_destructor(void *buf, void *cdrarg)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
ASSERT(connp->conn_flags & IPCL_IPCCONN);
ASSERT(connp->conn_priv == NULL);
@@ -2054,7 +2055,7 @@ static int
udp_conn_constructor(void *buf, void *cdrarg, int kmflags)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
udp_t *udp = (udp_t *)&itc[1];
bzero(connp, sizeof (conn_t));
@@ -2081,7 +2082,7 @@ static void
udp_conn_destructor(void *buf, void *cdrarg)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
udp_t *udp = (udp_t *)&itc[1];
ASSERT(connp->conn_flags & IPCL_UDPCONN);
@@ -2105,7 +2106,7 @@ static int
rawip_conn_constructor(void *buf, void *cdrarg, int kmflags)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
icmp_t *icmp = (icmp_t *)&itc[1];
bzero(connp, sizeof (conn_t));
@@ -2133,7 +2134,7 @@ static void
rawip_conn_destructor(void *buf, void *cdrarg)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
icmp_t *icmp = (icmp_t *)&itc[1];
ASSERT(connp->conn_flags & IPCL_RAWIPCONN);
@@ -2158,7 +2159,7 @@ static int
rts_conn_constructor(void *buf, void *cdrarg, int kmflags)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
rts_t *rts = (rts_t *)&itc[1];
bzero(connp, sizeof (conn_t));
@@ -2183,7 +2184,7 @@ static void
rts_conn_destructor(void *buf, void *cdrarg)
{
itc_t *itc = (itc_t *)buf;
- conn_t *connp = &itc->itc_conn;
+ conn_t *connp = &itc->itc_conn;
rts_t *rts = (rts_t *)&itc[1];
ASSERT(connp->conn_flags & IPCL_RTSCONN);
@@ -2749,3 +2750,52 @@ conn_untrace_ref(conn_t *connp)
return (1);
}
#endif
+
+mib2_socketInfoEntry_t *
+conn_get_socket_info(conn_t *connp, mib2_socketInfoEntry_t *sie)
+{
+ vnode_t *vn = NULL;
+ vattr_t attr;
+ uint64_t flags = 0;
+
+ /*
+ * If the connection is closing, it is not safe to make an upcall or
+ * access the stream associated with the connection.
+ * The callers of this function have a reference on connp itself
+ * so, as long as it is not closing, it's safe to continue.
+ */
+ mutex_enter(&connp->conn_lock);
+
+ if ((connp->conn_state_flags & CONN_CLOSING)) {
+ mutex_exit(&connp->conn_lock);
+ return (NULL);
+ }
+
+ mutex_exit(&connp->conn_lock);
+
+ if (connp->conn_upper_handle != NULL) {
+ vn = (*connp->conn_upcalls->su_get_vnode)
+ (connp->conn_upper_handle);
+ } else if (!IPCL_IS_NONSTR(connp) && connp->conn_rq != NULL) {
+ vn = STREAM(connp->conn_rq)->sd_pvnode;
+ if (vn != NULL)
+ VN_HOLD(vn);
+ flags |= MIB2_SOCKINFO_STREAM;
+ }
+
+ if (vn == NULL || VOP_GETATTR(vn, &attr, 0, CRED(), NULL) != 0) {
+ if (vn != NULL)
+ VN_RELE(vn);
+ return (NULL);
+ }
+
+ VN_RELE(vn);
+
+ bzero(sie, sizeof (*sie));
+
+ sie->sie_flags = flags;
+ sie->sie_inode = attr.va_nodeid;
+ sie->sie_dev = attr.va_rdev;
+
+ return (sie);
+}
diff --git a/usr/src/uts/common/inet/ipclassifier.h b/usr/src/uts/common/inet/ipclassifier.h
index c3139d9288..6c65f64240 100644
--- a/usr/src/uts/common/inet/ipclassifier.h
+++ b/usr/src/uts/common/inet/ipclassifier.h
@@ -24,6 +24,10 @@
* Copyright 2015 Joyent, Inc.
*/
+/*
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#ifndef _INET_IPCLASSIFIER_H
#define _INET_IPCLASSIFIER_H
@@ -66,7 +70,7 @@ typedef boolean_t (*edesc_vpf)(conn_t *, void *, struct icmph_s *,
/* Unused 0x00040000 */
#define IPCL_FULLY_BOUND 0x00080000 /* Bound to correct squeue */
/* Unused 0x00100000 */
-/* Unused 0x00200000 */
+/* Unused 0x00200000 */
/* Unused 0x00400000 */
#define IPCL_CL_LISTENER 0x00800000 /* Cluster listener */
/* Unused 0x01000000 */
@@ -143,15 +147,15 @@ typedef struct ip_helper_minor_info_s {
*/
typedef struct ip_helper_stream_info_s {
ldi_handle_t iphs_handle;
- queue_t *iphs_rq;
- queue_t *iphs_wq;
+ queue_t *iphs_rq;
+ queue_t *iphs_wq;
ip_helper_minfo_t *iphs_minfo;
} ip_helper_stream_info_t;
/*
* Mandatory Access Control mode, in conn_t's conn_mac_mode field.
- * CONN_MAC_DEFAULT: strict enforcement of MAC.
- * CONN_MAC_AWARE: allows communications between unlabeled systems
+ * CONN_MAC_DEFAULT: strict enforcement of MAC.
+ * CONN_MAC_AWARE: allows communications between unlabeled systems
* and privileged daemons
* CONN_MAC_IMPLICIT: allows communications without explicit labels
* on the wire with privileged daemons.
@@ -285,7 +289,7 @@ struct conn_s {
conn_debug : 1, /* SO_DEBUG */
conn_ipv6_v6only : 1, /* IPV6_V6ONLY */
- conn_oobinline : 1, /* SO_OOBINLINE state */
+ conn_oobinline : 1, /* SO_OOBINLINE state */
conn_dgram_errind : 1, /* SO_DGRAM_ERRIND state */
conn_exclbind : 1, /* SO_EXCLBIND state */
@@ -357,12 +361,12 @@ struct conn_s {
kcondvar_t conn_refcv; /* For conn_oper_pending_ill */
- struct conn_s *conn_drain_next; /* Next conn in drain list */
+ struct conn_s *conn_drain_next; /* Next conn in drain list */
struct conn_s *conn_drain_prev; /* Prev conn in drain list */
idl_t *conn_idl; /* Ptr to the drain list head */
mblk_t *conn_ipsec_opt_mp; /* ipsec option mblk */
zoneid_t conn_zoneid; /* zone connection is in */
- int conn_rtaware; /* RT_AWARE sockopt value */
+ int conn_rtaware; /* RT_AWARE sockopt value */
kcondvar_t conn_sq_cv; /* For non-STREAMS socket IO */
sock_upcalls_t *conn_upcalls; /* Upcalls to sockfs */
sock_upper_handle_t conn_upper_handle; /* Upper handle: sonode * */
@@ -476,7 +480,7 @@ struct connf_s {
#define CONN_INC_REF_LOCKED(connp) { \
DTRACE_PROBE1(conn__inc__ref, conn_t *, connp); \
- ASSERT(MUTEX_HELD(&(connp)->conn_lock)); \
+ ASSERT(MUTEX_HELD(&(connp)->conn_lock)); \
ASSERT(conn_trace_ref(connp)); \
(connp)->conn_ref++; \
ASSERT((connp)->conn_ref != 0); \
@@ -516,7 +520,7 @@ struct connf_s {
/*
* For matching between a conn_t and a zoneid.
*/
-#define IPCL_ZONE_MATCH(connp, zoneid) \
+#define IPCL_ZONE_MATCH(connp, zoneid) \
(((connp)->conn_allzones) || \
((zoneid) == ALL_ZONES) || \
(connp)->conn_zoneid == (zoneid))
@@ -572,14 +576,14 @@ struct connf_s {
#define IPCL_CONN_MATCH(connp, proto, src, dst, ports) \
((connp)->conn_proto == (proto) && \
- (connp)->conn_ports == (ports) && \
+ (connp)->conn_ports == (ports) && \
_IPCL_V4_MATCH((connp)->conn_faddr_v6, (src)) && \
_IPCL_V4_MATCH((connp)->conn_laddr_v6, (dst)) && \
!(connp)->conn_ipv6_v6only)
#define IPCL_CONN_MATCH_V6(connp, proto, src, dst, ports) \
((connp)->conn_proto == (proto) && \
- (connp)->conn_ports == (ports) && \
+ (connp)->conn_ports == (ports) && \
IN6_ARE_ADDR_EQUAL(&(connp)->conn_faddr_v6, &(src)) && \
IN6_ARE_ADDR_EQUAL(&(connp)->conn_laddr_v6, &(dst)))
@@ -731,6 +735,8 @@ extern int ip_create_helper_stream(conn_t *, ldi_ident_t);
extern void ip_free_helper_stream(conn_t *);
extern int ip_helper_stream_setup(queue_t *, dev_t *, int, int,
cred_t *, boolean_t);
+extern mib2_socketInfoEntry_t *conn_get_socket_info(conn_t *,
+ mib2_socketInfoEntry_t *);
#ifdef __cplusplus
}
diff --git a/usr/src/uts/common/inet/mib2.h b/usr/src/uts/common/inet/mib2.h
index 9a9d4e15d3..c88c84424d 100644
--- a/usr/src/uts/common/inet/mib2.h
+++ b/usr/src/uts/common/inet/mib2.h
@@ -26,6 +26,10 @@
* Copyright 2019 Joyent, Inc.
*/
+/*
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#ifndef _INET_MIB2_H
#define _INET_MIB2_H
@@ -189,6 +193,7 @@ typedef uint32_t DeviceIndex; /* Interface index */
* There can be one of each of these tables per transport (MIB2_* above).
*/
#define EXPER_XPORT_MLP 105 /* transportMLPEntry */
+#define EXPER_SOCK_INFO 106 /* socketInfoEntry */
/* Old names retained for compatibility */
#define MIB2_IP_20 MIB2_IP_ADDR
@@ -240,7 +245,7 @@ typedef struct mib2_ip {
int ipRouteEntrySize;
/* {ip 22} */
int ipNetToMediaEntrySize;
- /* # of valid route entries discarded {ip 23} */
+ /* # of valid route entries discarded {ip 23} */
Counter ipRoutingDiscards;
/*
* following defined in MIB-II as part of TCP & UDP groups:
@@ -326,11 +331,11 @@ typedef struct mib2_ipv6IfStatsEntry {
Counter ipv6InHdrErrors;
/* # exceeds outgoing link MTU { ipv6IfStatsEntry 3 } */
Counter ipv6InTooBigErrors;
- /* # discarded due to no route to dest { ipv6IfStatsEntry 4 } */
+ /* # discarded due to no route to dest { ipv6IfStatsEntry 4 } */
Counter ipv6InNoRoutes;
/* # invalid or unsupported addresses { ipv6IfStatsEntry 5 } */
Counter ipv6InAddrErrors;
- /* # unknown next header { ipv6IfStatsEntry 6 } */
+ /* # unknown next header { ipv6IfStatsEntry 6 } */
Counter ipv6InUnknownProtos;
/* # too short packets { ipv6IfStatsEntry 7 } */
Counter ipv6InTruncatedPkts;
@@ -449,11 +454,11 @@ typedef struct mib2_ipIfStatsEntry {
Counter ipIfStatsInHdrErrors;
/* # exceeds outgoing link MTU(v6 only) { ipv6IfStatsEntry 3 } */
Counter ipIfStatsInTooBigErrors;
- /* # discarded due to no route to dest { ipIfStatsEntry 8 } */
+ /* # discarded due to no route to dest { ipIfStatsEntry 8 } */
Counter ipIfStatsInNoRoutes;
/* # invalid or unsupported addresses { ipIfStatsEntry 9 } */
Counter ipIfStatsInAddrErrors;
- /* # unknown next header { ipIfStatsEntry 10 } */
+ /* # unknown next header { ipIfStatsEntry 10 } */
Counter ipIfStatsInUnknownProtos;
/* # too short packets { ipIfStatsEntry 11 } */
Counter ipIfStatsInTruncatedPkts;
@@ -488,7 +493,7 @@ typedef struct mib2_ipIfStatsEntry {
* In addition to defined MIBs
*/
- /* # discarded due to no route to dest { ipSystemStatsEntry 22 } */
+ /* # discarded due to no route to dest { ipSystemStatsEntry 22 } */
Counter ipIfStatsOutNoRoutes;
/* # of complete duplicates in reassembly */
Counter ipIfStatsReasmDuplicates;
@@ -544,7 +549,7 @@ typedef struct mib2_ipIfStatsEntry {
Counter64 ipIfStatsHCOutRequests;
/* # forwarded out interface { ipIfStatsEntry 23 } */
Counter64 ipIfStatsHCOutForwDatagrams;
- /* # dg's requiring fragmentation { ipIfStatsEntry 26 } */
+ /* # dg's requiring fragmentation { ipIfStatsEntry 26 } */
Counter ipIfStatsOutFragReqds;
/* # output datagrams { ipIfStatsEntry 31 } */
Counter64 ipIfStatsHCOutTransmits;
@@ -702,13 +707,13 @@ typedef struct mib2_ipRouteEntry {
IpAddress ipRouteDest;
/* unique interface index for this hop {ipRouteEntry 2 } RW */
DeviceName ipRouteIfIndex;
- /* primary route metric {ipRouteEntry 3 } RW */
+ /* primary route metric {ipRouteEntry 3 } RW */
int ipRouteMetric1;
- /* alternate route metric {ipRouteEntry 4 } RW */
+ /* alternate route metric {ipRouteEntry 4 } RW */
int ipRouteMetric2;
- /* alternate route metric {ipRouteEntry 5 } RW */
+ /* alternate route metric {ipRouteEntry 5 } RW */
int ipRouteMetric3;
- /* alternate route metric {ipRouteEntry 6 } RW */
+ /* alternate route metric {ipRouteEntry 6 } RW */
int ipRouteMetric4;
/* ip addr of next hop on this route {ipRouteEntry 7 } RW */
IpAddress ipRouteNextHop;
@@ -718,9 +723,9 @@ typedef struct mib2_ipRouteEntry {
int ipRouteProto;
/* sec's since last update of route {ipRouteEntry 10} RW */
int ipRouteAge;
- /* {ipRouteEntry 11} RW */
+ /* {ipRouteEntry 11} RW */
IpAddress ipRouteMask;
- /* alternate route metric {ipRouteEntry 12} RW */
+ /* alternate route metric {ipRouteEntry 12} RW */
int ipRouteMetric5;
/* additional info from ire's {ipRouteEntry 13 } */
struct ipRouteInfo_s {
@@ -742,7 +747,7 @@ typedef struct mib2_ipRouteEntry {
*/
DeviceName re_in_ill; /* Input interface */
IpAddress re_in_src_addr; /* Input source address */
- } ipRouteInfo;
+ } ipRouteInfo;
} mib2_ipRouteEntry_t;
/*
@@ -764,16 +769,16 @@ typedef struct mib2_ipRouteEntry {
typedef struct mib2_ipv6RouteEntry {
/* dest ip addr for this route { ipv6RouteEntry 1 } */
Ip6Address ipv6RouteDest;
- /* prefix length { ipv6RouteEntry 2 } */
+ /* prefix length { ipv6RouteEntry 2 } */
int ipv6RoutePfxLength;
- /* unique route index { ipv6RouteEntry 3 } */
+ /* unique route index { ipv6RouteEntry 3 } */
unsigned ipv6RouteIndex;
/* unique interface index for this hop { ipv6RouteEntry 4 } */
DeviceName ipv6RouteIfIndex;
/* IPv6 addr of next hop on this route { ipv6RouteEntry 5 } */
Ip6Address ipv6RouteNextHop;
/* other(1), discard(2), local(3), remote(4) */
- /* { ipv6RouteEntry 6 } */
+ /* { ipv6RouteEntry 6 } */
int ipv6RouteType;
/* mechanism by which route was learned { ipv6RouteEntry 7 } */
/*
@@ -802,7 +807,7 @@ typedef struct mib2_ipv6RouteEntry {
Counter re_obpkt;
Counter re_ibpkt;
int re_flags;
- } ipv6RouteInfo;
+ } ipv6RouteInfo;
} mib2_ipv6RouteEntry_t;
/*
@@ -969,6 +974,22 @@ typedef struct mib2_transportMLPEntry {
bslabel_t tme_label;
} mib2_transportMLPEntry_t;
+/*
+ * This is not part of mib2 but is used to communicate additional information
+ * about a socket alongside the mib2 data. This is used by netstat to
+ * associate sockets with processes that are connected to them.
+ */
+
+#define MIB2_SOCKINFO_STREAM 0x1
+#define MIB2_SOCKINFO_IPV6 0x2 /* IPV6 entry in an IPv4 table */
+
+typedef struct mib2_socketInfoEntry {
+ uint64_t sie_connidx;
+ uint64_t sie_inode;
+ uint64_t sie_flags;
+ uint64_t sie_dev;
+} mib2_socketInfoEntry_t;
+
#define MIB2_TMEF_PRIVATE 0x00000001 /* MLP on private addresses */
#define MIB2_TMEF_SHARED 0x00000002 /* MLP on shared addresses */
#define MIB2_TMEF_ANONMLP 0x00000004 /* Anonymous MLP port */
@@ -1547,7 +1568,7 @@ typedef struct mib2_udp6Entry {
Ip6Address udp6LocalAddress;
/* local port of listener { ipv6UdpEntry 2 } */
int udp6LocalPort; /* In host byte order */
- /* interface index or zero { ipv6UdpEntry 3 } */
+ /* interface index or zero { ipv6UdpEntry 3 } */
DeviceIndex udp6IfIndex;
struct udp6EntryInfo_s {
int ue_state;
@@ -1762,7 +1783,7 @@ typedef struct mib2_sctp {
/* # of received SACK chunks with duplicate TSN */
Counter sctpInDupAck;
/* # of SACK chunks acking unsent data */
- Counter sctpInAckUnsent;
+ Counter sctpInAckUnsent;
/* # of Fragmented User Messages { sctpStats 14 } */
Counter64 sctpFragUsrMsgs;
/* # of Reassembled User Messages { sctpStats 15 } */
diff --git a/usr/src/uts/common/inet/sctp/sctp_snmp.c b/usr/src/uts/common/inet/sctp/sctp_snmp.c
index 8240d6601b..344dba1cea 100644
--- a/usr/src/uts/common/inet/sctp/sctp_snmp.c
+++ b/usr/src/uts/common/inet/sctp/sctp_snmp.c
@@ -25,6 +25,7 @@
/*
* Copyright (c) 2018, Joyent, Inc.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -541,6 +542,9 @@ sctp_snmp_get_mib2(queue_t *q, mblk_t *mpctl, sctp_stack_t *sctps)
mblk_t *mp_attr_ctl = NULL;
mblk_t *mp_attr_data;
mblk_t *mp_attr_tail = NULL;
+ mblk_t *mp_info_ctl = NULL;
+ mblk_t *mp_info_data;
+ mblk_t *mp_info_tail = NULL;
struct opthdr *optp;
sctp_t *sctp, *sctp_prev = NULL;
sctp_faddr_t *fp;
@@ -548,6 +552,7 @@ sctp_snmp_get_mib2(queue_t *q, mblk_t *mpctl, sctp_stack_t *sctps)
mib2_sctpConnLocalEntry_t scle;
mib2_sctpConnRemoteEntry_t scre;
mib2_transportMLPEntry_t mlp;
+ mib2_socketInfoEntry_t *sie, psie;
int i;
int l;
int scanned = 0;
@@ -567,11 +572,14 @@ sctp_snmp_get_mib2(queue_t *q, mblk_t *mpctl, sctp_stack_t *sctps)
mp_local_ctl = copymsg(mpctl);
mp_rem_ctl = copymsg(mpctl);
mp_attr_ctl = copymsg(mpctl);
+ mp_info_ctl = copymsg(mpctl);
mpdata = mpctl->b_cont;
if (mp_conn_ctl == NULL || mp_local_ctl == NULL ||
- mp_rem_ctl == NULL || mp_attr_ctl == NULL || mpdata == NULL) {
+ mp_rem_ctl == NULL || mp_attr_ctl == NULL || mp_info_ctl == NULL ||
+ mpdata == NULL) {
+ freemsg(mp_info_ctl);
freemsg(mp_attr_ctl);
freemsg(mp_rem_ctl);
freemsg(mp_local_ctl);
@@ -584,10 +592,11 @@ sctp_snmp_get_mib2(queue_t *q, mblk_t *mpctl, sctp_stack_t *sctps)
mp_local_data = mp_local_ctl->b_cont;
mp_rem_data = mp_rem_ctl->b_cont;
mp_attr_data = mp_attr_ctl->b_cont;
+ mp_info_data = mp_info_ctl->b_cont;
bzero(&sctp_mib, sizeof (sctp_mib));
- /* hostname address parameters are not supported in Solaris */
+ /* hostname address parameters are not supported in illumos */
sce.sctpAssocRemHostName.o_length = 0;
sce.sctpAssocRemHostName.o_bytes[0] = 0;
@@ -807,6 +816,15 @@ done:
sce.sctpConnEntryInfo.ce_mss = sctp->sctp_mss;
(void) snmp_append_data2(mp_conn_data, &mp_conn_tail,
(char *)&sce, sizeof (sce));
+
+ if ((sie = conn_get_socket_info(connp, &psie)) != NULL) {
+ sie->sie_connidx = idx;
+ (void) snmp_append_data2(
+ mp_info_ctl->b_cont,
+ &mp_info_tail,
+ (char *)sie, sizeof (*sie));
+ }
+
mlp.tme_connidx = idx++;
if (needattr)
(void) snmp_append_data2(mp_attr_ctl->b_cont,
@@ -864,6 +882,17 @@ next_sctp:
else
qreply(q, mp_attr_ctl);
+ /* table of socket info... */
+ optp = (struct opthdr *)&mp_info_ctl->b_rptr[
+ sizeof (struct T_optmgmt_ack)];
+ optp->level = MIB2_SCTP;
+ optp->name = EXPER_SOCK_INFO;
+ optp->len = msgdsize(mp_info_data);
+ if (optp->len == 0)
+ freemsg(mp_info_ctl);
+ else
+ qreply(q, mp_info_ctl);
+
return (mp_ret);
}
diff --git a/usr/src/uts/common/inet/sockmods/socksctp.c b/usr/src/uts/common/inet/sockmods/socksctp.c
index 8b07c9b36e..97198339ab 100644
--- a/usr/src/uts/common/inet/sockmods/socksctp.c
+++ b/usr/src/uts/common/inet/sockmods/socksctp.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015 Joyent, Inc. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -107,6 +108,7 @@ static ssize_t sctp_assoc_recv(sock_upper_handle_t, mblk_t *, size_t, int,
static void sctp_assoc_xmitted(sock_upper_handle_t, boolean_t);
static void sctp_assoc_properties(sock_upper_handle_t,
struct sock_proto_props *);
+static vnode_t *sctp_assoc_get_vnode(sock_upper_handle_t);
sonodeops_t sosctp_sonodeops = {
sosctp_init, /* sop_init */
@@ -124,7 +126,7 @@ sonodeops_t sosctp_sonodeops = {
sosctp_setsockopt, /* sop_setsockopt */
sosctp_ioctl, /* sop_ioctl */
so_poll, /* sop_poll */
- sosctp_close, /* sop_close */
+ sosctp_close, /* sop_close */
};
sonodeops_t sosctp_seq_sonodeops = {
@@ -143,7 +145,7 @@ sonodeops_t sosctp_seq_sonodeops = {
sosctp_setsockopt, /* sop_setsockopt */
sosctp_ioctl, /* sop_ioctl */
so_poll, /* sop_poll */
- sosctp_close, /* sop_close */
+ sosctp_close, /* sop_close */
};
/* All the upcalls expect the upper handle to be sonode. */
@@ -156,6 +158,10 @@ sock_upcalls_t sosctp_sock_upcalls = {
so_set_prop,
so_txq_full,
NULL, /* su_signal_oob */
+ NULL, /* su_signal_oob */
+ NULL, /* su_set_error */
+ NULL, /* su_closed */
+ so_get_vnode /* su_get_vnode */
};
/* All the upcalls expect the upper handle to be sctp_sonode/sctp_soassoc. */
@@ -169,6 +175,9 @@ sock_upcalls_t sosctp_assoc_upcalls = {
sctp_assoc_xmitted,
NULL, /* su_recv_space */
NULL, /* su_signal_oob */
+ NULL, /* su_set_error */
+ NULL, /* su_closed */
+ sctp_assoc_get_vnode
};
/* ARGSUSED */
@@ -2184,6 +2193,20 @@ sctp_assoc_xmitted(sock_upper_handle_t handle, boolean_t qfull)
mutex_exit(&ss->ss_so.so_lock);
}
+static vnode_t *
+sctp_assoc_get_vnode(sock_upper_handle_t handle)
+{
+ struct sctp_soassoc *ssa = (struct sctp_soassoc *)handle;
+ struct sonode *so;
+
+ if (ssa->ssa_type == SOSCTP_ASSOC)
+ so = &ssa->ssa_sonode->ss_so;
+ else
+ so = &((struct sctp_sonode *)handle)->ss_so;
+
+ return (so_get_vnode((sock_upper_handle_t)so));
+}
+
static void
sctp_assoc_properties(sock_upper_handle_t handle,
struct sock_proto_props *soppp)
diff --git a/usr/src/uts/common/inet/tcp/tcp_stats.c b/usr/src/uts/common/inet/tcp/tcp_stats.c
index 0da7f5413c..226467e167 100644
--- a/usr/src/uts/common/inet/tcp/tcp_stats.c
+++ b/usr/src/uts/common/inet/tcp/tcp_stats.c
@@ -21,9 +21,9 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, Joyent Inc. All rights reserved.
* Copyright (c) 2015, 2016 by Delphix. All rights reserved.
* Copyright 2019 Joyent, Inc.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -31,6 +31,10 @@
#include <sys/policy.h>
#include <sys/tsol/tnet.h>
#include <sys/kstat.h>
+#include <sys/stropts.h>
+#include <sys/strsubr.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
#include <inet/common.h>
#include <inet/ip.h>
@@ -148,18 +152,23 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
mblk_t *mp_conn_tail;
mblk_t *mp_attr_ctl = NULL;
mblk_t *mp_attr_tail;
+ mblk_t *mp_info_ctl = NULL;
+ mblk_t *mp_info_tail;
mblk_t *mp6_conn_ctl = NULL;
mblk_t *mp6_conn_tail;
mblk_t *mp6_attr_ctl = NULL;
mblk_t *mp6_attr_tail;
+ mblk_t *mp6_info_ctl = NULL;
+ mblk_t *mp6_info_tail;
struct opthdr *optp;
mib2_tcpConnEntry_t tce;
mib2_tcp6ConnEntry_t tce6;
mib2_transportMLPEntry_t mlp;
+ mib2_socketInfoEntry_t *sie, psie;
connf_t *connfp;
int i;
- boolean_t ispriv;
- zoneid_t zoneid;
+ boolean_t ispriv;
+ zoneid_t zoneid;
int v4_conn_idx;
int v6_conn_idx;
conn_t *connp = Q_TO_CONN(q);
@@ -178,12 +187,16 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
(mpdata = mpctl->b_cont) == NULL ||
(mp_conn_ctl = copymsg(mpctl)) == NULL ||
(mp_attr_ctl = copymsg(mpctl)) == NULL ||
+ (mp_info_ctl = copymsg(mpctl)) == NULL ||
(mp6_conn_ctl = copymsg(mpctl)) == NULL ||
- (mp6_attr_ctl = copymsg(mpctl)) == NULL) {
+ (mp6_attr_ctl = copymsg(mpctl)) == NULL ||
+ (mp6_info_ctl = copymsg(mpctl)) == NULL) {
freemsg(mp_conn_ctl);
freemsg(mp_attr_ctl);
+ freemsg(mp_info_ctl);
freemsg(mp6_conn_ctl);
freemsg(mp6_attr_ctl);
+ freemsg(mp6_info_ctl);
freemsg(mpctl);
freemsg(mp2ctl);
return (NULL);
@@ -217,6 +230,7 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
v4_conn_idx = v6_conn_idx = 0;
mp_conn_tail = mp_attr_tail = mp6_conn_tail = mp6_attr_tail = NULL;
+ mp_info_tail = mp6_info_tail = NULL;
for (i = 0; i < CONN_G_HASH_SIZE; i++) {
ipst = tcps->tcps_netstack->netstack_ip;
@@ -279,33 +293,55 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
/* Create a message to report on IPv6 entries */
if (connp->conn_ipversion == IPV6_VERSION) {
- tce6.tcp6ConnLocalAddress = connp->conn_laddr_v6;
- tce6.tcp6ConnRemAddress = connp->conn_faddr_v6;
- tce6.tcp6ConnLocalPort = ntohs(connp->conn_lport);
- tce6.tcp6ConnRemPort = ntohs(connp->conn_fport);
- if (connp->conn_ixa->ixa_flags & IXAF_SCOPEID_SET) {
- tce6.tcp6ConnIfIndex =
- connp->conn_ixa->ixa_scopeid;
- } else {
- tce6.tcp6ConnIfIndex = connp->conn_bound_if;
- }
+ tce6.tcp6ConnLocalAddress =
+ connp->conn_laddr_v6;
+ tce6.tcp6ConnRemAddress =
+ connp->conn_faddr_v6;
+ tce6.tcp6ConnLocalPort =
+ ntohs(connp->conn_lport);
+ tce6.tcp6ConnRemPort =
+ ntohs(connp->conn_fport);
+ if (connp->conn_ixa->ixa_flags &
+ IXAF_SCOPEID_SET) {
+ tce6.tcp6ConnIfIndex =
+ connp->conn_ixa->ixa_scopeid;
+ } else {
+ tce6.tcp6ConnIfIndex =
+ connp->conn_bound_if;
+ }
+
+ tcp_set_conninfo(tcp, &tce6.tcp6ConnEntryInfo,
+ ispriv);
- tcp_set_conninfo(tcp, &tce6.tcp6ConnEntryInfo,
- ispriv);
+ tce6.tcp6ConnCreationProcess =
+ (connp->conn_cpid < 0) ?
+ MIB2_UNKNOWN_PROCESS : connp->conn_cpid;
+ tce6.tcp6ConnCreationTime =
+ connp->conn_open_time;
- tce6.tcp6ConnCreationProcess =
- (connp->conn_cpid < 0) ? MIB2_UNKNOWN_PROCESS :
- connp->conn_cpid;
- tce6.tcp6ConnCreationTime = connp->conn_open_time;
+ (void) snmp_append_data2(mp6_conn_ctl->b_cont,
+ &mp6_conn_tail, (char *)&tce6, tce6_size);
- (void) snmp_append_data2(mp6_conn_ctl->b_cont,
- &mp6_conn_tail, (char *)&tce6, tce6_size);
+ if (needattr) {
+ mlp.tme_connidx = v6_conn_idx;
+ (void) snmp_append_data2(
+ mp6_attr_ctl->b_cont,
+ &mp6_attr_tail,
+ (char *)&mlp, sizeof (mlp));
+ }
- mlp.tme_connidx = v6_conn_idx++;
- if (needattr)
- (void) snmp_append_data2(mp6_attr_ctl->b_cont,
- &mp6_attr_tail, (char *)&mlp, sizeof (mlp));
+ if ((sie = conn_get_socket_info(connp,
+ &psie)) != NULL) {
+ sie->sie_connidx = v6_conn_idx;
+ (void) snmp_append_data2(
+ mp6_info_ctl->b_cont,
+ &mp6_info_tail,
+ (char *)sie, sizeof (*sie));
+ }
+
+ v6_conn_idx++;
}
+
/*
* Create an IPv4 table entry for IPv4 entries and also
* for IPv6 entries which are bound to in6addr_any
@@ -340,12 +376,27 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
(void) snmp_append_data2(mp_conn_ctl->b_cont,
&mp_conn_tail, (char *)&tce, tce_size);
- mlp.tme_connidx = v4_conn_idx++;
- if (needattr)
+ if (needattr) {
+ mlp.tme_connidx = v4_conn_idx;
(void) snmp_append_data2(
mp_attr_ctl->b_cont,
&mp_attr_tail, (char *)&mlp,
sizeof (mlp));
+ }
+
+ if ((sie = conn_get_socket_info(connp, &psie))
+ != NULL) {
+ sie->sie_connidx = v4_conn_idx;
+ if (connp->conn_ipversion ==
+ IPV6_VERSION)
+ sie->sie_flags |=
+ MIB2_SOCKINFO_IPV6;
+ (void) snmp_append_data2(
+ mp_info_ctl->b_cont, &mp_info_tail,
+ (char *)sie, sizeof (*sie));
+ }
+
+ v4_conn_idx++;
}
}
}
@@ -391,6 +442,17 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
else
qreply(q, mp_attr_ctl);
+ /* table of socket info... */
+ optp = (struct opthdr *)&mp_info_ctl->b_rptr[
+ sizeof (struct T_optmgmt_ack)];
+ optp->level = MIB2_TCP;
+ optp->name = EXPER_SOCK_INFO;
+ optp->len = msgdsize(mp_info_ctl->b_cont);
+ if (optp->len == 0)
+ freemsg(mp_info_ctl);
+ else
+ qreply(q, mp_info_ctl);
+
/* table of IPv6 connections... */
optp = (struct opthdr *)&mp6_conn_ctl->b_rptr[
sizeof (struct T_optmgmt_ack)];
@@ -409,6 +471,18 @@ tcp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
freemsg(mp6_attr_ctl);
else
qreply(q, mp6_attr_ctl);
+
+ /* table of IPv6 socket info.. */
+ optp = (struct opthdr *)&mp6_info_ctl->b_rptr[
+ sizeof (struct T_optmgmt_ack)];
+ optp->level = MIB2_TCP6;
+ optp->name = EXPER_SOCK_INFO;
+ optp->len = msgdsize(mp6_info_ctl->b_cont);
+ if (optp->len == 0)
+ freemsg(mp6_info_ctl);
+ else
+ qreply(q, mp6_info_ctl);
+
return (mp2ctl);
}
@@ -539,7 +613,7 @@ tcp_kstat_update(kstat_t *kp, int rw)
tcp_t *tcp;
connf_t *connfp;
conn_t *connp;
- int i;
+ int i;
netstackid_t stackid = (netstackid_t)(uintptr_t)kp->ks_private;
netstack_t *ns;
tcp_stack_t *tcps;
diff --git a/usr/src/uts/common/inet/udp/udp_stats.c b/usr/src/uts/common/inet/udp/udp_stats.c
index 29f27189ec..2f5202f693 100644
--- a/usr/src/uts/common/inet/udp/udp_stats.c
+++ b/usr/src/uts/common/inet/udp/udp_stats.c
@@ -21,12 +21,17 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
#include <sys/tihdr.h>
#include <sys/policy.h>
#include <sys/tsol/tnet.h>
+#include <sys/stropts.h>
+#include <sys/strsubr.h>
+#include <sys/socket.h>
+#include <sys/socketvar.h>
#include <inet/common.h>
#include <inet/kstatcom.h>
@@ -53,16 +58,21 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
mblk_t *mpdata;
mblk_t *mp_conn_ctl;
mblk_t *mp_attr_ctl;
+ mblk_t *mp_info_ctl;
mblk_t *mp6_conn_ctl;
mblk_t *mp6_attr_ctl;
+ mblk_t *mp6_info_ctl;
mblk_t *mp_conn_tail;
mblk_t *mp_attr_tail;
+ mblk_t *mp_info_tail;
mblk_t *mp6_conn_tail;
mblk_t *mp6_attr_tail;
+ mblk_t *mp6_info_tail;
struct opthdr *optp;
mib2_udpEntry_t ude;
mib2_udp6Entry_t ude6;
mib2_transportMLPEntry_t mlp;
+ mib2_socketInfoEntry_t *sie, psie;
int state;
zoneid_t zoneid;
int i;
@@ -78,7 +88,6 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
mib2_udp_t udp_mib;
size_t udp_mib_size, ude_size, ude6_size;
-
/*
* make a copy of the original message
*/
@@ -89,11 +98,16 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
(mpdata = mpctl->b_cont) == NULL ||
(mp_conn_ctl = copymsg(mpctl)) == NULL ||
(mp_attr_ctl = copymsg(mpctl)) == NULL ||
+ (mp_info_ctl = copymsg(mpctl)) == NULL ||
(mp6_conn_ctl = copymsg(mpctl)) == NULL ||
- (mp6_attr_ctl = copymsg(mpctl)) == NULL) {
+ (mp6_attr_ctl = copymsg(mpctl)) == NULL ||
+ (mp6_info_ctl = copymsg(mpctl)) == NULL) {
freemsg(mp_conn_ctl);
freemsg(mp_attr_ctl);
+ freemsg(mp_info_ctl);
freemsg(mp6_conn_ctl);
+ freemsg(mp6_attr_ctl);
+ freemsg(mp6_info_ctl);
freemsg(mpctl);
freemsg(mp2ctl);
return (0);
@@ -135,6 +149,7 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
qreply(q, mpctl);
mp_conn_tail = mp_attr_tail = mp6_conn_tail = mp6_attr_tail = NULL;
+ mp_info_tail = mp6_info_tail = NULL;
v4_conn_idx = v6_conn_idx = 0;
for (i = 0; i < CONN_G_HASH_SIZE; i++) {
@@ -143,6 +158,8 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
while ((connp = ipcl_get_next_conn(connfp, connp,
IPCL_UDPCONN))) {
+ sonode_t *so = (sonode_t *)connp->conn_upper_handle;
+
udp = connp->conn_udp;
if (zoneid != connp->conn_zoneid)
continue;
@@ -249,11 +266,27 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
(void) snmp_append_data2(mp_conn_ctl->b_cont,
&mp_conn_tail, (char *)&ude, ude_size);
- mlp.tme_connidx = v4_conn_idx++;
- if (needattr)
+
+ if (needattr) {
+ mlp.tme_connidx = v4_conn_idx;
(void) snmp_append_data2(
mp_attr_ctl->b_cont, &mp_attr_tail,
(char *)&mlp, sizeof (mlp));
+ }
+
+ if ((sie = conn_get_socket_info(connp, &psie))
+ != NULL) {
+ sie->sie_connidx = v4_conn_idx;
+ if (connp->conn_ipversion ==
+ IPV6_VERSION)
+ sie->sie_flags |=
+ MIB2_SOCKINFO_IPV6;
+ (void) snmp_append_data2(
+ mp_info_ctl->b_cont, &mp_info_tail,
+ (char *)sie, sizeof (*sie));
+ }
+
+ v4_conn_idx++;
}
if (connp->conn_ipversion == IPV6_VERSION) {
ude6.udp6EntryInfo.ue_state = state;
@@ -292,12 +325,25 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
(void) snmp_append_data2(mp6_conn_ctl->b_cont,
&mp6_conn_tail, (char *)&ude6, ude6_size);
- mlp.tme_connidx = v6_conn_idx++;
- if (needattr)
+
+ if (needattr) {
+ mlp.tme_connidx = v6_conn_idx;
(void) snmp_append_data2(
mp6_attr_ctl->b_cont,
&mp6_attr_tail, (char *)&mlp,
sizeof (mlp));
+ }
+
+ if ((sie = conn_get_socket_info(connp,
+ &psie)) != NULL) {
+ sie->sie_connidx = v6_conn_idx;
+ (void) snmp_append_data2(
+ mp6_info_ctl->b_cont,
+ &mp6_info_tail,
+ (char *)sie, sizeof (*sie));
+ }
+
+ v6_conn_idx++;
}
}
}
@@ -321,6 +367,17 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
else
qreply(q, mp_attr_ctl);
+ /* table of socket info... */
+ optp = (struct opthdr *)&mp_info_ctl->b_rptr[
+ sizeof (struct T_optmgmt_ack)];
+ optp->level = MIB2_UDP;
+ optp->name = EXPER_SOCK_INFO;
+ optp->len = msgdsize(mp_info_ctl->b_cont);
+ if (optp->len == 0)
+ freemsg(mp_info_ctl);
+ else
+ qreply(q, mp_info_ctl);
+
/* IPv6 UDP endpoints */
optp = (struct opthdr *)&mp6_conn_ctl->b_rptr[
sizeof (struct T_optmgmt_ack)];
@@ -340,6 +397,17 @@ udp_snmp_get(queue_t *q, mblk_t *mpctl, boolean_t legacy_req)
else
qreply(q, mp6_attr_ctl);
+ /* table of socket info... */
+ optp = (struct opthdr *)&mp6_info_ctl->b_rptr[
+ sizeof (struct T_optmgmt_ack)];
+ optp->level = MIB2_UDP6;
+ optp->name = EXPER_SOCK_INFO;
+ optp->len = msgdsize(mp6_info_ctl->b_cont);
+ if (optp->len == 0)
+ freemsg(mp6_info_ctl);
+ else
+ qreply(q, mp6_info_ctl);
+
return (mp2ctl);
}
diff --git a/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi.c b/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi.c
index a35a39caa8..38795beab5 100644
--- a/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi.c
+++ b/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi.c
@@ -21,6 +21,7 @@
/*
* Copyright 2000 by Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2019 Joshua M. Clulow <josh@sysmgr.org>
*
* iSCSI Software Initiator
*/
@@ -365,278 +366,273 @@ iscsi_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd,
static int
iscsi_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
{
- int rval = DDI_SUCCESS;
int instance = ddi_get_instance(dip);
iscsi_hba_t *ihp = NULL;
scsi_hba_tran_t *tran = NULL;
char init_port_name[MAX_NAME_PROP_SIZE];
- switch (cmd) {
- case DDI_ATTACH:
- /* create iSCSH HBA devctl device node */
- if (ddi_create_minor_node(dip, ISCSI_DEVCTL, S_IFCHR, 0,
- DDI_PSEUDO, 0) == DDI_SUCCESS) {
-
- /* allocate HBA soft state */
- if (ddi_soft_state_zalloc(iscsi_state, instance) !=
- DDI_SUCCESS) {
- ddi_remove_minor_node(dip, NULL);
- rval = DDI_FAILURE;
- break;
- }
+ if (cmd == DDI_RESUME) {
+ return (DDI_SUCCESS);
+ } else if (cmd != DDI_ATTACH) {
+ return (DDI_FAILURE);
+ }
- /* get reference to soft state */
- if ((ihp = (iscsi_hba_t *)ddi_get_soft_state(
- iscsi_state, instance)) == NULL) {
- ddi_remove_minor_node(dip, NULL);
- ddi_soft_state_free(iscsi_state, instance);
- rval = DDI_FAILURE;
- break;
- }
+ if (!modrootloaded && iscsiboot_prop == NULL) {
+ /*
+ * The root file system has not yet been mounted, and we're not
+ * trying to boot from an iSCSI device. Fail to attach now so
+ * that we can retry after root has been mounted.
+ */
+ return (DDI_FAILURE);
+ }
- /* init HBA mutex used to protect discovery events */
- mutex_init(&ihp->hba_discovery_events_mutex, NULL,
- MUTEX_DRIVER, NULL);
+ /* create iSCSI HBA devctl device node */
+ if (ddi_create_minor_node(dip, ISCSI_DEVCTL, S_IFCHR, 0,
+ DDI_PSEUDO, 0) != DDI_SUCCESS) {
+ goto iscsi_attach_failed3;
+ }
- /* Get LDI ident */
- rval = ldi_ident_from_dip(dip, &ihp->hba_li);
- ASSERT(rval == 0); /* Failure indicates invalid arg */
+ /* allocate HBA soft state */
+ if (ddi_soft_state_zalloc(iscsi_state, instance) !=
+ DDI_SUCCESS) {
+ ddi_remove_minor_node(dip, NULL);
+ goto iscsi_attach_failed3;
+ }
- /* init HBA mutex used to protect service status */
- mutex_init(&ihp->hba_service_lock, NULL,
- MUTEX_DRIVER, NULL);
- cv_init(&ihp->hba_service_cv, NULL, CV_DRIVER, NULL);
+ /* get reference to soft state */
+ if ((ihp = (iscsi_hba_t *)ddi_get_soft_state(
+ iscsi_state, instance)) == NULL) {
+ ddi_remove_minor_node(dip, NULL);
+ ddi_soft_state_free(iscsi_state, instance);
+ goto iscsi_attach_failed3;
+ }
- /*
- * init SendTargets semaphore that is used to allow
- * only one operation at a time
- */
- sema_init(&ihp->hba_sendtgts_semaphore, 1, NULL,
- SEMA_DRIVER, NULL);
-
- ihp->hba_sess_list = NULL;
- rw_init(&ihp->hba_sess_list_rwlock, NULL,
- RW_DRIVER, NULL);
-
- /* allocate scsi_hba_tran */
- if ((tran = scsi_hba_tran_alloc(dip, SCSI_HBA_CANSLEEP))
- == NULL) {
- ddi_remove_minor_node(dip, NULL);
- goto iscsi_attach_failed2;
- }
+ /* init HBA mutex used to protect discovery events */
+ mutex_init(&ihp->hba_discovery_events_mutex, NULL,
+ MUTEX_DRIVER, NULL);
- /* soft state setup */
- ihp->hba_sig = ISCSI_SIG_HBA;
- ihp->hba_tran = tran;
- ihp->hba_dip = dip;
- if (iscsiboot_prop == NULL) {
- ihp->hba_service_status =
- ISCSI_SERVICE_DISABLED;
- ihp->hba_service_status_overwrite = B_FALSE;
- } else {
- ihp->hba_service_status =
- ISCSI_SERVICE_ENABLED;
- ihp->hba_service_status_overwrite = B_TRUE;
- }
- ihp->hba_service_client_count = 0;
+ VERIFY0(ldi_ident_from_dip(dip, &ihp->hba_li));
- mutex_enter(&iscsi_oid_mutex);
- ihp->hba_oid = iscsi_oid++;
- mutex_exit(&iscsi_oid_mutex);
+ /* init HBA mutex used to protect service status */
+ mutex_init(&ihp->hba_service_lock, NULL,
+ MUTEX_DRIVER, NULL);
+ cv_init(&ihp->hba_service_cv, NULL, CV_DRIVER, NULL);
- ihp->hba_name[0] = '\0';
- ihp->hba_name_length = 0;
- ihp->hba_alias_length = 0;
- ihp->hba_alias[0] = '\0';
-
- iscsi_net->tweaks.rcvbuf = ddi_prop_get_int(
- DDI_DEV_T_ANY, ihp->hba_dip, 0, "so-rcvbuf",
- ISCSI_SOCKET_RCVBUF_SIZE);
-
- iscsi_net->tweaks.sndbuf = ddi_prop_get_int(
- DDI_DEV_T_ANY, ihp->hba_dip, 0, "so-sndbuf",
- ISCSI_SOCKET_SNDBUF_SIZE);
-
- iscsi_net->tweaks.nodelay = ddi_prop_get_int(
- DDI_DEV_T_ANY, ihp->hba_dip, 0, "tcp-nodelay",
- ISCSI_TCP_NODELAY_DEFAULT);
-
- iscsi_net->tweaks.conn_notify_threshold =
- ddi_prop_get_int(DDI_DEV_T_ANY,
- ihp->hba_dip, 0, "tcp-conn-notify-threshold",
- ISCSI_TCP_CNOTIFY_THRESHOLD_DEFAULT);
-
- iscsi_net->tweaks.conn_abort_threshold =
- ddi_prop_get_int(DDI_DEV_T_ANY, ihp->hba_dip,
- 0, "tcp-conn-abort-threshold",
- ISCSI_TCP_CABORT_THRESHOLD_DEFAULT);
-
- iscsi_net->tweaks.abort_threshold = ddi_prop_get_int(
- DDI_DEV_T_ANY, ihp->hba_dip, 0,
- "tcp-abort-threshold",
- ISCSI_TCP_ABORT_THRESHOLD_DEFAULT);
-
- ihp->hba_config_storm_delay = ddi_prop_get_int(
- DDI_DEV_T_ANY, ihp->hba_dip, 0,
- "config-storm-delay",
- ISCSI_CONFIG_STORM_DELAY_DEFAULT);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "so-rcvbuf", iscsi_net->tweaks.rcvbuf);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "so-sndbuf", iscsi_net->tweaks.sndbuf);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "tcp-nodelay", iscsi_net->tweaks.nodelay);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "tcp-conn-notify-threshold",
- iscsi_net->tweaks.conn_notify_threshold);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "tcp-conn-abort-threshold",
- iscsi_net->tweaks.conn_abort_threshold);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "tcp-abort-threshold",
- iscsi_net->tweaks.abort_threshold);
-
- (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
- "config-storm-delay",
- ihp->hba_config_storm_delay);
-
- /* setup hba defaults */
- iscsi_set_default_login_params(&ihp->hba_params);
- iscsi_set_default_tunable_params(
- &ihp->hba_tunable_params);
-
- /* setup minimal initiator params */
- iscsid_set_default_initiator_node_settings(ihp, B_TRUE);
-
- /* hba set up */
- tran->tran_hba_private = ihp;
- tran->tran_tgt_private = NULL;
- tran->tran_tgt_init = iscsi_tran_lun_init;
- tran->tran_tgt_probe = iscsi_tran_lun_probe;
- tran->tran_tgt_free = iscsi_tran_lun_free;
- tran->tran_start = iscsi_tran_start;
- tran->tran_abort = iscsi_tran_abort;
- tran->tran_reset = iscsi_tran_reset;
- tran->tran_getcap = iscsi_tran_getcap;
- tran->tran_setcap = iscsi_tran_setcap;
- tran->tran_init_pkt = iscsi_tran_init_pkt;
- tran->tran_destroy_pkt = iscsi_tran_destroy_pkt;
- tran->tran_dmafree = iscsi_tran_dmafree;
- tran->tran_sync_pkt = iscsi_tran_sync_pkt;
- tran->tran_reset_notify = iscsi_tran_reset_notify;
- tran->tran_bus_config = iscsi_tran_bus_config;
- tran->tran_bus_unconfig = iscsi_tran_bus_unconfig;
-
- tran->tran_get_name = iscsi_tran_get_name;
- tran->tran_get_bus_addr = iscsi_tran_get_bus_addr;
- tran->tran_interconnect_type = INTERCONNECT_ISCSI;
-
- /* register scsi hba with scsa */
- if (scsi_hba_attach_setup(dip, &iscsi_dma_attr,
- tran, SCSI_HBA_TRAN_CLONE) != DDI_SUCCESS) {
- goto iscsi_attach_failed1;
- }
+ /*
+ * init SendTargets semaphore that is used to allow
+ * only one operation at a time
+ */
+ sema_init(&ihp->hba_sendtgts_semaphore, 1, NULL,
+ SEMA_DRIVER, NULL);
- /* register scsi hba with mdi (MPxIO/vhci) */
- if (mdi_phci_register(MDI_HCI_CLASS_SCSI, dip, 0) !=
- MDI_SUCCESS) {
- ihp->hba_mpxio_enabled = B_FALSE;
- } else {
- ihp->hba_mpxio_enabled = B_TRUE;
- }
+ ihp->hba_sess_list = NULL;
+ rw_init(&ihp->hba_sess_list_rwlock, NULL,
+ RW_DRIVER, NULL);
- (void) iscsi_hba_kstat_init(ihp);
+ /* allocate scsi_hba_tran */
+ if ((tran = scsi_hba_tran_alloc(dip, SCSI_HBA_CANSLEEP))
+ == NULL) {
+ ddi_remove_minor_node(dip, NULL);
+ goto iscsi_attach_failed2;
+ }
- /* Initialize targetparam list */
- iscsi_targetparam_init();
+ /* soft state setup */
+ ihp->hba_sig = ISCSI_SIG_HBA;
+ ihp->hba_tran = tran;
+ ihp->hba_dip = dip;
+ if (iscsiboot_prop == NULL) {
+ ihp->hba_service_status =
+ ISCSI_SERVICE_DISABLED;
+ ihp->hba_service_status_overwrite = B_FALSE;
+ } else {
+ ihp->hba_service_status =
+ ISCSI_SERVICE_ENABLED;
+ ihp->hba_service_status_overwrite = B_TRUE;
+ }
+ ihp->hba_service_client_count = 0;
+
+ mutex_enter(&iscsi_oid_mutex);
+ ihp->hba_oid = iscsi_oid++;
+ mutex_exit(&iscsi_oid_mutex);
+
+ ihp->hba_name[0] = '\0';
+ ihp->hba_name_length = 0;
+ ihp->hba_alias_length = 0;
+ ihp->hba_alias[0] = '\0';
+
+ iscsi_net->tweaks.rcvbuf = ddi_prop_get_int(
+ DDI_DEV_T_ANY, ihp->hba_dip, 0, "so-rcvbuf",
+ ISCSI_SOCKET_RCVBUF_SIZE);
+
+ iscsi_net->tweaks.sndbuf = ddi_prop_get_int(
+ DDI_DEV_T_ANY, ihp->hba_dip, 0, "so-sndbuf",
+ ISCSI_SOCKET_SNDBUF_SIZE);
+
+ iscsi_net->tweaks.nodelay = ddi_prop_get_int(
+ DDI_DEV_T_ANY, ihp->hba_dip, 0, "tcp-nodelay",
+ ISCSI_TCP_NODELAY_DEFAULT);
+
+ iscsi_net->tweaks.conn_notify_threshold =
+ ddi_prop_get_int(DDI_DEV_T_ANY,
+ ihp->hba_dip, 0, "tcp-conn-notify-threshold",
+ ISCSI_TCP_CNOTIFY_THRESHOLD_DEFAULT);
+
+ iscsi_net->tweaks.conn_abort_threshold =
+ ddi_prop_get_int(DDI_DEV_T_ANY, ihp->hba_dip,
+ 0, "tcp-conn-abort-threshold",
+ ISCSI_TCP_CABORT_THRESHOLD_DEFAULT);
+
+ iscsi_net->tweaks.abort_threshold = ddi_prop_get_int(
+ DDI_DEV_T_ANY, ihp->hba_dip, 0,
+ "tcp-abort-threshold",
+ ISCSI_TCP_ABORT_THRESHOLD_DEFAULT);
+
+ ihp->hba_config_storm_delay = ddi_prop_get_int(
+ DDI_DEV_T_ANY, ihp->hba_dip, 0,
+ "config-storm-delay",
+ ISCSI_CONFIG_STORM_DELAY_DEFAULT);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "so-rcvbuf", iscsi_net->tweaks.rcvbuf);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "so-sndbuf", iscsi_net->tweaks.sndbuf);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "tcp-nodelay", iscsi_net->tweaks.nodelay);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "tcp-conn-notify-threshold",
+ iscsi_net->tweaks.conn_notify_threshold);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "tcp-conn-abort-threshold",
+ iscsi_net->tweaks.conn_abort_threshold);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "tcp-abort-threshold",
+ iscsi_net->tweaks.abort_threshold);
+
+ (void) ddi_prop_update_int(DDI_DEV_T_NONE, ihp->hba_dip,
+ "config-storm-delay",
+ ihp->hba_config_storm_delay);
+
+ /* setup hba defaults */
+ iscsi_set_default_login_params(&ihp->hba_params);
+ iscsi_set_default_tunable_params(
+ &ihp->hba_tunable_params);
+
+ /* setup minimal initiator params */
+ iscsid_set_default_initiator_node_settings(ihp, B_TRUE);
+
+ /* hba set up */
+ tran->tran_hba_private = ihp;
+ tran->tran_tgt_private = NULL;
+ tran->tran_tgt_init = iscsi_tran_lun_init;
+ tran->tran_tgt_probe = iscsi_tran_lun_probe;
+ tran->tran_tgt_free = iscsi_tran_lun_free;
+ tran->tran_start = iscsi_tran_start;
+ tran->tran_abort = iscsi_tran_abort;
+ tran->tran_reset = iscsi_tran_reset;
+ tran->tran_getcap = iscsi_tran_getcap;
+ tran->tran_setcap = iscsi_tran_setcap;
+ tran->tran_init_pkt = iscsi_tran_init_pkt;
+ tran->tran_destroy_pkt = iscsi_tran_destroy_pkt;
+ tran->tran_dmafree = iscsi_tran_dmafree;
+ tran->tran_sync_pkt = iscsi_tran_sync_pkt;
+ tran->tran_reset_notify = iscsi_tran_reset_notify;
+ tran->tran_bus_config = iscsi_tran_bus_config;
+ tran->tran_bus_unconfig = iscsi_tran_bus_unconfig;
+
+ tran->tran_get_name = iscsi_tran_get_name;
+ tran->tran_get_bus_addr = iscsi_tran_get_bus_addr;
+ tran->tran_interconnect_type = INTERCONNECT_ISCSI;
+
+ /* register scsi hba with scsa */
+ if (scsi_hba_attach_setup(dip, &iscsi_dma_attr,
+ tran, SCSI_HBA_TRAN_CLONE) != DDI_SUCCESS) {
+ goto iscsi_attach_failed1;
+ }
- /* Initialize ISID */
- ihp->hba_isid[0] = ISCSI_SUN_ISID_0;
- ihp->hba_isid[1] = ISCSI_SUN_ISID_1;
- ihp->hba_isid[2] = ISCSI_SUN_ISID_2;
- ihp->hba_isid[3] = ISCSI_SUN_ISID_3;
- ihp->hba_isid[4] = ISCSI_SUN_ISID_4;
- ihp->hba_isid[5] = ISCSI_SUN_ISID_5;
+ /* register scsi hba with mdi (MPxIO/vhci) */
+ if (mdi_phci_register(MDI_HCI_CLASS_SCSI, dip, 0) !=
+ MDI_SUCCESS) {
+ ihp->hba_mpxio_enabled = B_FALSE;
+ } else {
+ ihp->hba_mpxio_enabled = B_TRUE;
+ }
- /* Setup iSNS transport services and client */
- isns_client_init();
+ (void) iscsi_hba_kstat_init(ihp);
- /*
- * initialize persistent store,
- * or boot target info in case of iscsi boot
- */
- ihp->hba_persistent_loaded = B_FALSE;
- if (iscsid_init(ihp) == B_FALSE) {
- goto iscsi_attach_failed0;
- }
+ /* Initialize targetparam list */
+ iscsi_targetparam_init();
- /* Setup init_port_name for MPAPI */
- (void) snprintf(init_port_name, MAX_NAME_PROP_SIZE,
- "%s,%02x%02x%02x%02x%02x%02x",
- (char *)ihp->hba_name, ihp->hba_isid[0],
- ihp->hba_isid[1], ihp->hba_isid[2],
- ihp->hba_isid[3], ihp->hba_isid[4],
- ihp->hba_isid[5]);
-
- if (ddi_prop_update_string(DDI_DEV_T_NONE, dip,
- SCSI_ADDR_PROP_INITIATOR_PORT, init_port_name) !=
- DDI_PROP_SUCCESS) {
- cmn_err(CE_WARN, "iscsi_attach: Creating "
- SCSI_ADDR_PROP_INITIATOR_PORT
- " property on iSCSI "
- "HBA(%s) with dip(%d) Failed",
- (char *)ihp->hba_name,
- ddi_get_instance(dip));
- }
+ /* Initialize ISID */
+ ihp->hba_isid[0] = ISCSI_SUN_ISID_0;
+ ihp->hba_isid[1] = ISCSI_SUN_ISID_1;
+ ihp->hba_isid[2] = ISCSI_SUN_ISID_2;
+ ihp->hba_isid[3] = ISCSI_SUN_ISID_3;
+ ihp->hba_isid[4] = ISCSI_SUN_ISID_4;
+ ihp->hba_isid[5] = ISCSI_SUN_ISID_5;
- ddi_report_dev(dip);
- } else {
- rval = DDI_FAILURE;
- }
- break;
+ /* Setup iSNS transport services and client */
+ isns_client_init();
-iscsi_attach_failed0:
- isns_client_cleanup();
- if (ihp->stats.ks) {
- (void) iscsi_hba_kstat_term(ihp);
- }
- if (ihp->hba_mpxio_enabled == B_TRUE) {
- (void) mdi_phci_unregister(dip, 0);
- }
- (void) scsi_hba_detach(ihp->hba_dip);
-iscsi_attach_failed1:
- ddi_remove_minor_node(dip, NULL);
- ddi_prop_remove_all(ihp->hba_dip);
- scsi_hba_tran_free(tran);
-iscsi_attach_failed2:
- cv_destroy(&ihp->hba_service_cv);
- mutex_destroy(&ihp->hba_service_lock);
- mutex_destroy(&ihp->hba_discovery_events_mutex);
- sema_destroy(&ihp->hba_sendtgts_semaphore);
- rw_destroy(&ihp->hba_sess_list_rwlock);
- ddi_soft_state_free(iscsi_state, instance);
- rval = DDI_FAILURE;
- break;
+ /*
+ * initialize persistent store,
+ * or boot target info in case of iscsi boot
+ */
+ ihp->hba_persistent_loaded = B_FALSE;
+ if (iscsid_init(ihp) == B_FALSE) {
+ goto iscsi_attach_failed0;
+ }
- case DDI_RESUME:
- break;
+ /* Setup init_port_name for MPAPI */
+ (void) snprintf(init_port_name, MAX_NAME_PROP_SIZE,
+ "%s,%02x%02x%02x%02x%02x%02x",
+ (char *)ihp->hba_name, ihp->hba_isid[0],
+ ihp->hba_isid[1], ihp->hba_isid[2],
+ ihp->hba_isid[3], ihp->hba_isid[4],
+ ihp->hba_isid[5]);
- default:
- rval = DDI_FAILURE;
+ if (ddi_prop_update_string(DDI_DEV_T_NONE, dip,
+ SCSI_ADDR_PROP_INITIATOR_PORT, init_port_name) !=
+ DDI_PROP_SUCCESS) {
+ cmn_err(CE_WARN, "iscsi_attach: Creating "
+ SCSI_ADDR_PROP_INITIATOR_PORT
+ " property on iSCSI "
+ "HBA(%s) with dip(%d) Failed",
+ (char *)ihp->hba_name,
+ ddi_get_instance(dip));
}
- if (rval != DDI_SUCCESS) {
- cmn_err(CE_WARN, "iscsi driver unable to attach "
- "hba instance %d", instance);
- }
+ ddi_report_dev(dip);
+ return (DDI_SUCCESS);
- return (rval);
+iscsi_attach_failed0:
+ isns_client_cleanup();
+ if (ihp->stats.ks) {
+ (void) iscsi_hba_kstat_term(ihp);
+ }
+ if (ihp->hba_mpxio_enabled == B_TRUE) {
+ (void) mdi_phci_unregister(dip, 0);
+ }
+ (void) scsi_hba_detach(ihp->hba_dip);
+iscsi_attach_failed1:
+ ddi_remove_minor_node(dip, NULL);
+ ddi_prop_remove_all(ihp->hba_dip);
+ scsi_hba_tran_free(tran);
+iscsi_attach_failed2:
+ cv_destroy(&ihp->hba_service_cv);
+ mutex_destroy(&ihp->hba_service_lock);
+ mutex_destroy(&ihp->hba_discovery_events_mutex);
+ sema_destroy(&ihp->hba_sendtgts_semaphore);
+ rw_destroy(&ihp->hba_sess_list_rwlock);
+ ddi_soft_state_free(iscsi_state, instance);
+iscsi_attach_failed3:
+ cmn_err(CE_WARN, "iscsi driver unable to attach "
+ "hba instance %d", instance);
+ return (DDI_FAILURE);
}
/*
@@ -1479,7 +1475,7 @@ iscsi_ioctl(dev_t dev, int cmd, intptr_t arg, int mode,
iscsi_auth_props_t *auth = NULL;
iscsi_lun_list_t *ll, *llp = NULL;
iscsi_lun_props_t *lun = NULL;
- iscsi_lun_t *ilp = NULL;
+ iscsi_lun_t *ilp = NULL;
iSCSIDiscoveryMethod_t method;
iSCSIDiscoveryProperties_t discovery_props;
iscsi_uscsi_t iu;
@@ -5009,7 +5005,8 @@ iscsi_set_default_tunable_params(iscsi_tunable_params_t *params)
*/
int
iscsi_get_param(iscsi_login_params_t *params, boolean_t valid_flag,
- iscsi_param_get_t *ipgp) {
+ iscsi_param_get_t *ipgp)
+{
int rtn = 0;
/* ---- Default to settable, possibly changed later ---- */
@@ -5399,7 +5396,8 @@ iscsi_cmp_boot_sess_oid(iscsi_hba_t *ihp, uint32_t oid)
* blocks until the service status is either enabled or disabled
*/
boolean_t
-iscsi_client_request_service(iscsi_hba_t *ihp) {
+iscsi_client_request_service(iscsi_hba_t *ihp)
+{
boolean_t rval = B_TRUE;
mutex_enter(&ihp->hba_service_lock);
@@ -5422,7 +5420,8 @@ iscsi_client_request_service(iscsi_hba_t *ihp) {
* blocking threads if the count reaches zero
*/
void
-iscsi_client_release_service(iscsi_hba_t *ihp) {
+iscsi_client_release_service(iscsi_hba_t *ihp)
+{
mutex_enter(&ihp->hba_service_lock);
ASSERT(ihp->hba_service_client_count > 0);
ihp->hba_service_client_count--;
@@ -5439,7 +5438,8 @@ iscsi_client_release_service(iscsi_hba_t *ihp) {
* FALSE if no need to enter the zone
*/
static boolean_t
-iscsi_enter_service_zone(iscsi_hba_t *ihp, uint32_t status) {
+iscsi_enter_service_zone(iscsi_hba_t *ihp, uint32_t status)
+{
if ((status != ISCSI_SERVICE_ENABLED) &&
(status != ISCSI_SERVICE_DISABLED)) {
return (B_FALSE);
@@ -5465,7 +5465,8 @@ iscsi_enter_service_zone(iscsi_hba_t *ihp, uint32_t status) {
* iscsi_exit_service_zone - exits the service zone and wakes up waiters
*/
static void
-iscsi_exit_service_zone(iscsi_hba_t *ihp, uint32_t status) {
+iscsi_exit_service_zone(iscsi_hba_t *ihp, uint32_t status)
+{
if ((status != ISCSI_SERVICE_ENABLED) &&
(status != ISCSI_SERVICE_DISABLED)) {
return;
@@ -5479,7 +5480,8 @@ iscsi_exit_service_zone(iscsi_hba_t *ihp, uint32_t status) {
}
static void
-iscsi_check_miniroot(iscsi_hba_t *ihp) {
+iscsi_check_miniroot(iscsi_hba_t *ihp)
+{
if (strncmp(rootfs.bo_name, "/ramdisk", 8) == 0) {
/*
* in miniroot we don't have the persistent store
@@ -5490,7 +5492,8 @@ iscsi_check_miniroot(iscsi_hba_t *ihp) {
}
static void
-iscsi_get_tunable_default(iscsi_tunable_object_t *param) {
+iscsi_get_tunable_default(iscsi_tunable_object_t *param)
+{
int param_id = 0;
param_id = 1 << (param->t_param - 1);
@@ -5514,7 +5517,7 @@ iscsi_get_tunable_default(iscsi_tunable_object_t *param) {
* iscsi_get_persisted_tunable_param * - a helper to ISCSI_TUNABLE_PARAM_GET
* ioctl
* return:
- * 0 persisted tunable parameter found
+ * 0 persisted tunable parameter found
* 1 persisted tunable parameter not found
*/
static int
diff --git a/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_net.c b/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_net.c
index 970e18b324..57944247df 100644
--- a/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_net.c
+++ b/usr/src/uts/common/io/scsi/adapters/iscsi/iscsi_net.c
@@ -149,7 +149,6 @@ const int is_incoming_opcode_invalid[256] = {
#define IP_4_BITS 32
#define IP_6_BITS 128
-extern int modrootloaded;
extern ib_boot_prop_t *iscsiboot_prop;
/* prototypes */
@@ -270,7 +269,7 @@ static void *
iscsi_net_socket(int domain, int type, int protocol)
{
ksocket_t socket;
- int err = 0;
+ int err = 0;
err = ksocket_socket(&socket, domain, type, protocol, KSOCKET_SLEEP,
CRED());
@@ -287,7 +286,7 @@ iscsi_net_socket(int domain, int type, int protocol)
/* ARGSUSED */
static int
iscsi_net_bind(void *socket, struct sockaddr *name, int name_len,
- int backlog, int flags)
+ int backlog, int flags)
{
ksocket_t ks = (ksocket_t)socket;
int error;
@@ -304,7 +303,7 @@ iscsi_net_bind(void *socket, struct sockaddr *name, int name_len,
/* ARGSUSED */
static int
iscsi_net_connect(void *socket, struct sockaddr *name, int name_len,
- int fflag, int flags)
+ int fflag, int flags)
{
ksocket_t ks = (ksocket_t)socket;
int rval;
@@ -356,7 +355,7 @@ iscsi_net_getsockname(void *socket, struct sockaddr *addr, socklen_t *addrlen)
/* ARGSUSED */
static int
iscsi_net_getsockopt(void *socket, int level, int option_name,
- void *option_val, int *option_len, int flags)
+ void *option_val, int *option_len, int flags)
{
ksocket_t ks = (ksocket_t)socket;
return (ksocket_getsockopt(ks, level, option_name, option_val,
@@ -368,7 +367,7 @@ iscsi_net_getsockopt(void *socket, int level, int option_name,
*/
static int
iscsi_net_setsockopt(void *socket, int level, int option_name,
- void *option_val, int option_len)
+ void *option_val, int option_len)
{
ksocket_t ks = (ksocket_t)socket;
return (ksocket_setsockopt(ks, level, option_name, option_val,
@@ -457,7 +456,7 @@ iscsi_net_recvmsg(void *socket, struct msghdr *msg, int timeout)
{
int prflag = msg->msg_flags;
ksocket_t ks = (ksocket_t)socket;
- size_t recv = 0;
+ size_t recv = 0;
/* Set recv timeout */
if (get_udatamodel() == DATAMODEL_NONE ||
diff --git a/usr/src/uts/common/io/scsi/adapters/iscsi/iscsid.c b/usr/src/uts/common/io/scsi/adapters/iscsi/iscsid.c
index 73705c0cc4..3aa24f72eb 100644
--- a/usr/src/uts/common/io/scsi/adapters/iscsi/iscsid.c
+++ b/usr/src/uts/common/io/scsi/adapters/iscsi/iscsid.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2019 Joshua M. Clulow <josh@sysmgr.org>
*/
/*
@@ -255,16 +256,27 @@ iscsid_init(iscsi_hba_t *ihp)
persistent_init();
iscsid_threads_create(ihp);
- if (modrootloaded == 1) {
- /* normal case, load the persistent store */
+ if (modrootloaded) {
+ /*
+ * The root file system is available so we can load the
+ * persistent store.
+ */
if (persistent_load() == B_TRUE) {
ihp->hba_persistent_loaded = B_TRUE;
} else {
return (B_FALSE);
}
- }
+ } else {
+ /*
+ * If the root file system is not yet mounted then we _must_ be
+ * booting from an iSCSI device. If not, we want to fail to
+ * attach so that we can try again after the VFS root is
+ * available.
+ */
+ if (iscsiboot_prop == NULL) {
+ return (B_FALSE);
+ }
- if ((modrootloaded == 0) && (iscsiboot_prop != NULL)) {
if (!iscsid_boot_init_config(ihp)) {
rval = B_FALSE;
} else {
@@ -272,7 +284,7 @@ iscsid_init(iscsi_hba_t *ihp)
iscsi_boot_wd_handle =
iscsi_thread_create(ihp->hba_dip,
"BootWD", iscsid_thread_boot_wd, ihp);
- if (iscsi_boot_wd_handle) {
+ if (iscsi_boot_wd_handle != NULL) {
rval = iscsi_thread_start(
iscsi_boot_wd_handle);
} else {
@@ -294,7 +306,8 @@ iscsid_init(iscsi_hba_t *ihp)
* persistent store, as an economic way to present the 'daemon' funtionality
*/
boolean_t
-iscsid_start(iscsi_hba_t *ihp) {
+iscsid_start(iscsi_hba_t *ihp)
+{
boolean_t rval = B_FALSE;
iSCSIDiscoveryMethod_t dm;
iSCSIDiscoveryMethod_t *fdm;
@@ -339,7 +352,8 @@ iscsid_start(iscsi_hba_t *ihp) {
* (and therefore session) there and just return.
*/
boolean_t
-iscsid_stop(iscsi_hba_t *ihp) {
+iscsid_stop(iscsi_hba_t *ihp)
+{
boolean_t rval = B_FALSE;
iscsi_sess_t *isp = NULL;
diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c
index 15a2910850..95c0a5e720 100644
--- a/usr/src/uts/common/os/streamio.c
+++ b/usr/src/uts/common/os/streamio.c
@@ -25,7 +25,7 @@
/*
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2017 Joyent, Inc.
- * Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#include <sys/types.h>
@@ -385,6 +385,7 @@ ckreturn:
stp->sd_sidp = NULL;
stp->sd_pgidp = NULL;
stp->sd_vnode = vp;
+ stp->sd_pvnode = NULL;
stp->sd_rerror = 0;
stp->sd_werror = 0;
stp->sd_wroff = 0;
@@ -804,7 +805,7 @@ strclose(struct vnode *vp, int flag, cred_t *crp)
}
stp->sd_iocblk = NULL;
}
- stp->sd_vnode = NULL;
+ stp->sd_vnode = stp->sd_pvnode = NULL;
vp->v_stream = NULL;
mutex_exit(&vp->v_lock);
mutex_enter(&stp->sd_lock);
diff --git a/usr/src/uts/common/sys/socket_proto.h b/usr/src/uts/common/sys/socket_proto.h
index cbb3beddaa..4e1a4a0f35 100644
--- a/usr/src/uts/common/sys/socket_proto.h
+++ b/usr/src/uts/common/sys/socket_proto.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#ifndef _SYS_SOCKET_PROTO_H_
@@ -31,6 +32,7 @@ extern "C" {
#include <sys/socket.h>
#include <sys/stream.h>
+#include <sys/vnode.h>
/*
* Generation count
@@ -201,6 +203,7 @@ struct sock_upcalls_s {
void (*su_zcopy_notify)(sock_upper_handle_t);
void (*su_set_error)(sock_upper_handle_t, int);
void (*su_closed)(sock_upper_handle_t);
+ vnode_t *(*su_get_vnode)(sock_upper_handle_t);
};
#define SOCK_UC_VERSION sizeof (sock_upcalls_t)
diff --git a/usr/src/uts/common/sys/socketvar.h b/usr/src/uts/common/sys/socketvar.h
index 6794b5687b..55a182fa68 100644
--- a/usr/src/uts/common/sys/socketvar.h
+++ b/usr/src/uts/common/sys/socketvar.h
@@ -38,6 +38,7 @@
*/
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
*/
#ifndef _SYS_SOCKETVAR_H
@@ -137,7 +138,7 @@ struct sodirect_s;
struct sonode {
struct vnode *so_vnode; /* vnode associated with this sonode */
- sonodeops_t *so_ops; /* operations vector for this sonode */
+ sonodeops_t *so_ops; /* operations vector for this sonode */
void *so_priv; /* sonode private data */
krwlock_t so_fallback_rwlock;
@@ -151,12 +152,12 @@ struct sonode {
uint_t so_state; /* internal state flags SS_*, below */
uint_t so_mode; /* characteristics on socket. SM_* */
- ushort_t so_flag; /* flags, see below */
+ ushort_t so_flag; /* flags, see below */
int so_count; /* count of opened references */
sock_connid_t so_proto_connid; /* protocol generation number */
- ushort_t so_error; /* error affecting connection */
+ ushort_t so_error; /* error affecting connection */
struct sockparams *so_sockparams; /* vnode or socket module */
/* Needed to recreate the same socket for accept */
@@ -225,7 +226,7 @@ struct sonode {
/* Communication channel with protocol */
sock_lower_handle_t so_proto_handle;
- sock_downcalls_t *so_downcalls;
+ sock_downcalls_t *so_downcalls;
struct sock_proto_props so_proto_props; /* protocol settings */
boolean_t so_flowctrld; /* Flow controlled */
@@ -233,7 +234,7 @@ struct sonode {
kcondvar_t so_copy_cv; /* Copy cond variable */
/* kernel sockets */
- ksocket_callbacks_t so_ksock_callbacks;
+ ksocket_callbacks_t so_ksock_callbacks;
void *so_ksock_cb_arg; /* callback argument */
kcondvar_t so_closing_cv;
@@ -456,7 +457,7 @@ typedef struct smod_info {
int smod_version;
char *smod_name;
uint_t smod_refcnt; /* # of entries */
- size_t smod_uc_version; /* upcall version */
+ size_t smod_uc_version; /* upcall version */
size_t smod_dc_version; /* down call version */
so_proto_create_func_t smod_proto_create_func;
so_proto_fallback_func_t smod_proto_fallback_func;
@@ -531,8 +532,8 @@ extern void sockparams_ephemeral_drop_last_ref(struct sockparams *);
extern struct sockparams *sockparams_create(int, int, int, char *, char *, int,
int, int, int *);
-extern void sockparams_destroy(struct sockparams *);
-extern int sockparams_add(struct sockparams *);
+extern void sockparams_destroy(struct sockparams *);
+extern int sockparams_add(struct sockparams *);
extern int sockparams_delete(int, int, int);
extern int sockparams_new_filter(struct sof_entry *);
extern void sockparams_filter_cleanup(struct sof_entry *);
@@ -653,7 +654,7 @@ typedef struct snf_req {
int sr_lowat;
int sr_operation;
struct vnode *sr_vp;
- file_t *sr_fp;
+ file_t *sr_fp;
ssize_t sr_maxpsz;
u_offset_t sr_file_off;
u_offset_t sr_file_size;
@@ -679,7 +680,7 @@ struct sendfile_queue {
/* Socket network operations switch */
struct sonodeops {
- int (*sop_init)(struct sonode *, struct sonode *, cred_t *,
+ int (*sop_init)(struct sonode *, struct sonode *, cred_t *,
int);
int (*sop_accept)(struct sonode *, int, cred_t *, struct sonode **);
int (*sop_bind)(struct sonode *, struct sockaddr *, socklen_t,
@@ -700,13 +701,13 @@ struct sonodeops {
int (*sop_shutdown)(struct sonode *, int, cred_t *);
int (*sop_getsockopt)(struct sonode *, int, int, void *,
socklen_t *, int, cred_t *);
- int (*sop_setsockopt)(struct sonode *, int, int, const void *,
+ int (*sop_setsockopt)(struct sonode *, int, int, const void *,
socklen_t, cred_t *);
- int (*sop_ioctl)(struct sonode *, int, intptr_t, int,
+ int (*sop_ioctl)(struct sonode *, int, intptr_t, int,
cred_t *, int32_t *);
- int (*sop_poll)(struct sonode *, short, int, short *,
+ int (*sop_poll)(struct sonode *, short, int, short *,
struct pollhead **);
- int (*sop_close)(struct sonode *, int, cred_t *);
+ int (*sop_close)(struct sonode *, int, cred_t *);
};
#define SOP_INIT(so, flag, cr, flags) \
@@ -987,8 +988,14 @@ extern void so_krecv_unblock(sonode_t *);
/*
* Internal structure for obtaining sonode information from the socklist.
* These types match those corresponding in the sonode structure.
- * This is not a published interface, and may change at any time.
+ * This is not a published interface, and may change at any time. It is
+ * used for passing information back up to the kstat consumers. By converting
+ * kernel addresses to strings, we should be able to pass information from
+ * the kernel to userland regardless of n-bit kernel we are using.
*/
+
+#define ADRSTRLEN (2 * sizeof (uint64_t) + 1)
+
struct sockinfo {
uint_t si_size; /* real length of this struct */
short si_family;
@@ -1006,6 +1013,10 @@ struct sockinfo {
char si_faddr_sun_path[MAXPATHLEN + 1];
boolean_t si_faddr_noxlate;
zoneid_t si_szoneid;
+ char si_son_straddr[ADRSTRLEN];
+ char si_lvn_straddr[ADRSTRLEN];
+ char si_fvn_straddr[ADRSTRLEN];
+ uint64_t si_inode;
};
/*
diff --git a/usr/src/uts/common/sys/strsubr.h b/usr/src/uts/common/sys/strsubr.h
index f3bc1ed407..65bdfb2e17 100644
--- a/usr/src/uts/common/sys/strsubr.h
+++ b/usr/src/uts/common/sys/strsubr.h
@@ -28,6 +28,10 @@
* Copyright 2018 Joyent, Inc.
*/
+/*
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#ifndef _SYS_STRSUBR_H
#define _SYS_STRSUBR_H
@@ -243,6 +247,17 @@ typedef struct stdata {
uint_t sd_copyflag; /* copy-related flags */
zoneid_t sd_anchorzone; /* Allow removal from same zone only */
struct msgb *sd_cmdblk; /* reply from _I_CMD */
+
+ /*
+ * When a STREAMS device is cloned, the sd_vnode element of this
+ * structure is replaced by a pointer to a common vnode shared across
+ * all streams that are using the device. In this case, it is no longer
+ * possible to get from the stream head back to the original vnode via
+ * sd_vnode. Therefore, when such a device is cloned, the parent vnode -
+ * i.e. that which was created during the device clone in spec_clone()
+ * - is kept in sd_pvnode.
+ */
+ struct vnode *sd_pvnode;
} stdata_t;
/*