From 1f4c6dbc37f14382f7ff4575a74da056dbd34d66 Mon Sep 17 00:00:00 2001 From: Peter Tribble Date: Fri, 24 May 2019 10:39:16 -0700 Subject: 10864 Remove starcat support Reviewed by: Toomas Soome Reviewed by: Andy Fiddaman Reviewed by: John Levon Approved by: Joshua M. Clulow --- usr/src/cmd/Makefile | 1 - usr/src/cmd/Makefile.check | 2 +- usr/src/cmd/cvcd/Makefile | 63 - usr/src/cmd/cvcd/cvc.xml | 119 - usr/src/cmd/cvcd/sparc/Makefile | 47 - usr/src/cmd/cvcd/sparc/sun4u/Makefile | 47 - usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile | 62 - usr/src/cmd/cvcd/sparc/sun4u/starcat/cvcd.c | 888 -- usr/src/cmd/cvcd/svc-cvcd | 61 - usr/src/cmd/dcs/sparc/sun4u/dcs.xml | 16 +- usr/src/cmd/dcs/sparc/sun4u/svc-dcs | 30 +- usr/src/cmd/fm/eversholt/files/sparc/Makefile | 5 +- .../files/sparc/SUNW,Sun-Fire-15000/Makefile | 32 - .../SUNW,Sun-Fire-15000/SUNW,Sun-Fire-15000.esc | 81 - .../cmd/fm/modules/sun4/cpumem-diagnosis/cmd_cpu.c | 22 +- .../fm/modules/sun4u/datapath-retire/cda_main.c | 9 +- usr/src/cmd/fm/schemes/mem/mem_unum.c | 11 +- usr/src/cmd/sckmd/sparc/sun4u/Makefile | 3 +- usr/src/cmd/sckmd/svc-sckmd | 11 +- usr/src/cmd/svc/profile/Makefile | 1 - .../svc/profile/platform_SUNW,Sun-Fire-15000.xml | 47 - usr/src/lib/cfgadm_plugins/Makefile.com | 1 - usr/src/lib/fm/topo/maps/Makefile | 2 +- .../lib/fm/topo/maps/SUNW,Sun-Fire-15000/Makefile | 34 - .../Sun-Fire-15000-hc-topology.xml | 52 - usr/src/lib/fm/topo/modules/Makefile | 3 +- .../fm/topo/modules/SUNW,Sun-Fire-15000/Makefile | 32 - .../modules/SUNW,Sun-Fire-15000/ioboard/Makefile | 31 - .../SUNW,Sun-Fire-15000/ioboard/iob_platform.c | 145 - .../libc/capabilities/sun4u-us3/common/mapfile-cap | 1 - usr/src/lib/libprtdiag_psr/sparc/Makefile | 2 +- usr/src/lib/libprtdiag_psr/sparc/starcat/Makefile | 74 - .../libprtdiag_psr/sparc/starcat/common/starcat.c | 1168 --- usr/src/man/man1m/Makefile | 6 +- usr/src/man/man1m/cvcd.1m | 162 - usr/src/man/man1m/dcs.1m | 88 +- usr/src/man/man1m/sckmd.1m | 19 +- usr/src/man/man7d/Makefile | 5 +- usr/src/man/man7d/cvc.7d | 61 - usr/src/man/man7d/cvcredir.7d | 48 - usr/src/man/man7d/schpc.7d | 38 - usr/src/man/man7d/wscons.7d | 25 +- usr/src/pkg/manifests/SUNWcs.mf | 2 - usr/src/pkg/manifests/SUNWcvc.mf | 29 - usr/src/pkg/manifests/SUNWdrcr.mf | 31 - .../pkg/manifests/developer-apptrace-platform.mf | 2 - usr/src/pkg/manifests/service-fault-management.mf | 17 +- .../service-key-management-sun-fire-15000.mf | 40 +- ...-service-processor-protocol-sparc-enterprise.mf | 7 + usr/src/pkg/manifests/system-header.mf | 3 - ...ernel-dynamic-reconfiguration-sun-fire-15000.mf | 31 +- usr/src/pkg/manifests/system-kernel-platform.mf | 60 - usr/src/pkg/manifests/system-library-platform.mf | 10 - usr/src/pkg/manifests/system-network-console.mf | 37 +- usr/src/psm/promif/ieee1275/sun4u/Makefile.files | 3 +- usr/src/psm/promif/ieee1275/sun4u/prom_starcat.c | 219 - usr/src/psm/stand/boot/sparcv9/sun4u/Makefile | 3 +- .../psm/stand/bootblks/ufs/sparc/sun4u/Makefile | 1 - usr/src/tools/chk4ubin/chk4ubin.c | 3 +- usr/src/uts/sun4/sys/platform_module.h | 7 +- usr/src/uts/sun4u/Makefile.files | 11 +- usr/src/uts/sun4u/Makefile.sun4u | 71 +- usr/src/uts/sun4u/io/gptwocfg.c | 28 +- usr/src/uts/sun4u/io/pci/pci.c | 32 +- usr/src/uts/sun4u/io/pci/pci_axq.c | 406 - usr/src/uts/sun4u/io/pci/pci_fm.c | 34 +- usr/src/uts/sun4u/io/pci/pci_pbm.c | 36 +- usr/src/uts/sun4u/io/todstarcat.c | 263 - usr/src/uts/sun4u/opl/oplkmdrv/Makefile | 5 +- usr/src/uts/sun4u/opl/sys/Makefile | 4 +- usr/src/uts/sun4u/opl/sys/sckm_io.h | 103 + usr/src/uts/sun4u/starcat/Makefile | 118 - usr/src/uts/sun4u/starcat/Makefile.files | 70 - usr/src/uts/sun4u/starcat/Makefile.rules | 85 - usr/src/uts/sun4u/starcat/Makefile.starcat | 155 - usr/src/uts/sun4u/starcat/Makefile.targ | 96 - usr/src/uts/sun4u/starcat/axq/Makefile | 93 - usr/src/uts/sun4u/starcat/cheetah/Makefile | 123 - usr/src/uts/sun4u/starcat/cheetahplus/Makefile | 130 - usr/src/uts/sun4u/starcat/cvc/Makefile | 99 - usr/src/uts/sun4u/starcat/cvcredir/Makefile | 100 - usr/src/uts/sun4u/starcat/dman/Makefile | 92 - usr/src/uts/sun4u/starcat/dr/Makefile | 95 - usr/src/uts/sun4u/starcat/drmach/Makefile | 98 - usr/src/uts/sun4u/starcat/fcgp2/Makefile | 94 - usr/src/uts/sun4u/starcat/genassym/Makefile | 97 - usr/src/uts/sun4u/starcat/gptwo_pci/Makefile | 101 - usr/src/uts/sun4u/starcat/io/axq.c | 1746 ---- usr/src/uts/sun4u/starcat/io/cvc.c | 1437 ---- usr/src/uts/sun4u/starcat/io/cvc.conf | 28 - usr/src/uts/sun4u/starcat/io/cvcredir.c | 274 - usr/src/uts/sun4u/starcat/io/cvcredir.conf | 28 - usr/src/uts/sun4u/starcat/io/dman.c | 8327 ------------------ usr/src/uts/sun4u/starcat/io/dman.conf | 28 - usr/src/uts/sun4u/starcat/io/dman_domain.c | 870 -- usr/src/uts/sun4u/starcat/io/dr.conf | 28 - usr/src/uts/sun4u/starcat/io/drmach.c | 8878 -------------------- usr/src/uts/sun4u/starcat/io/fcgp2.c | 997 --- usr/src/uts/sun4u/starcat/io/gptwo_pci.c | 492 -- usr/src/uts/sun4u/starcat/io/iosram.c | 3532 -------- usr/src/uts/sun4u/starcat/io/mboxsc.c | 2460 ------ usr/src/uts/sun4u/starcat/io/sc_gptwocfg.c | 1547 ---- usr/src/uts/sun4u/starcat/io/schpc.c | 4509 ---------- usr/src/uts/sun4u/starcat/io/schpc.conf | 32 - usr/src/uts/sun4u/starcat/io/sckmdrv.c | 910 -- usr/src/uts/sun4u/starcat/io/sckmdrv.conf | 28 - usr/src/uts/sun4u/starcat/io/scosmb.c | 1258 --- usr/src/uts/sun4u/starcat/iosram/Makefile | 93 - usr/src/uts/sun4u/starcat/mboxsc/Makefile | 92 - usr/src/uts/sun4u/starcat/ml/drmach.il.cpp | 210 - usr/src/uts/sun4u/starcat/ml/drmach_asm.s | 975 --- usr/src/uts/sun4u/starcat/ml/starcat_asm.s | 78 - usr/src/uts/sun4u/starcat/os/starcat.c | 1329 --- usr/src/uts/sun4u/starcat/platmod/Makefile | 98 - usr/src/uts/sun4u/starcat/sc_gptwocfg/Makefile | 94 - usr/src/uts/sun4u/starcat/schpc/Makefile | 96 - usr/src/uts/sun4u/starcat/sckmdrv/Makefile | 97 - usr/src/uts/sun4u/starcat/scosmb/Makefile | 94 - usr/src/uts/sun4u/starcat/sys/Makefile | 74 - usr/src/uts/sun4u/starcat/sys/axq.h | 368 - usr/src/uts/sun4u/starcat/sys/dman.h | 552 -- usr/src/uts/sun4u/starcat/sys/domaind.h | 79 - usr/src/uts/sun4u/starcat/sys/dr_mbx.h | 265 - usr/src/uts/sun4u/starcat/sys/drmach.h | 169 - usr/src/uts/sun4u/starcat/sys/gptwo_pci.h | 52 - usr/src/uts/sun4u/starcat/sys/iosramio.h | 141 - usr/src/uts/sun4u/starcat/sys/iosramreg.h | 134 - usr/src/uts/sun4u/starcat/sys/iosramvar.h | 327 - usr/src/uts/sun4u/starcat/sys/mboxsc.h | 119 - usr/src/uts/sun4u/starcat/sys/mboxsc_impl.h | 136 - .../sun4u/starcat/sys/post/scat_asicbrd_types.h | 120 - usr/src/uts/sun4u/starcat/sys/post/scat_const.h | 299 - usr/src/uts/sun4u/starcat/sys/post/scat_dcd.h | 509 -- usr/src/uts/sun4u/starcat/sys/post/scat_pa_space.h | 79 - usr/src/uts/sun4u/starcat/sys/sc_cvc.h | 88 - usr/src/uts/sun4u/starcat/sys/sc_cvcio.h | 139 - usr/src/uts/sun4u/starcat/sys/sc_gptwocfg.h | 50 - usr/src/uts/sun4u/starcat/sys/schpc.h | 184 - usr/src/uts/sun4u/starcat/sys/schpc_msg.h | 185 - usr/src/uts/sun4u/starcat/sys/sckm_io.h | 101 - usr/src/uts/sun4u/starcat/sys/sckm_msg.h | 101 - usr/src/uts/sun4u/starcat/sys/starcat.h | 165 - usr/src/uts/sun4u/starcat/unix/Makefile | 195 - usr/src/uts/sun4u/sys/pci/pci_axq.h | 63 - usr/src/uts/sun4u/sys/pci/pci_obj.h | 5 +- usr/src/uts/sun4u/sys/prom_plat.h | 10 - usr/src/uts/sun4u/todstarcat/Makefile | 88 - 147 files changed, 286 insertions(+), 51875 deletions(-) delete mode 100644 usr/src/cmd/cvcd/Makefile delete mode 100644 usr/src/cmd/cvcd/cvc.xml delete mode 100644 usr/src/cmd/cvcd/sparc/Makefile delete mode 100644 usr/src/cmd/cvcd/sparc/sun4u/Makefile delete mode 100644 usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile delete mode 100644 usr/src/cmd/cvcd/sparc/sun4u/starcat/cvcd.c delete mode 100644 usr/src/cmd/cvcd/svc-cvcd delete mode 100644 usr/src/cmd/fm/eversholt/files/sparc/SUNW,Sun-Fire-15000/Makefile delete mode 100644 usr/src/cmd/fm/eversholt/files/sparc/SUNW,Sun-Fire-15000/SUNW,Sun-Fire-15000.esc delete mode 100644 usr/src/cmd/svc/profile/platform_SUNW,Sun-Fire-15000.xml delete mode 100644 usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-15000/Makefile delete mode 100644 usr/src/lib/fm/topo/maps/SUNW,Sun-Fire-15000/Sun-Fire-15000-hc-topology.xml delete mode 100644 usr/src/lib/fm/topo/modules/SUNW,Sun-Fire-15000/Makefile delete mode 100644 usr/src/lib/fm/topo/modules/SUNW,Sun-Fire-15000/ioboard/Makefile delete mode 100644 usr/src/lib/fm/topo/modules/SUNW,Sun-Fire-15000/ioboard/iob_platform.c delete mode 100644 usr/src/lib/libprtdiag_psr/sparc/starcat/Makefile delete mode 100644 usr/src/lib/libprtdiag_psr/sparc/starcat/common/starcat.c delete mode 100644 usr/src/man/man1m/cvcd.1m delete mode 100644 usr/src/man/man7d/cvc.7d delete mode 100644 usr/src/man/man7d/cvcredir.7d delete mode 100644 usr/src/man/man7d/schpc.7d delete mode 100644 usr/src/pkg/manifests/SUNWcvc.mf delete mode 100644 usr/src/pkg/manifests/SUNWdrcr.mf delete mode 100644 usr/src/psm/promif/ieee1275/sun4u/prom_starcat.c delete mode 100644 usr/src/uts/sun4u/io/pci/pci_axq.c delete mode 100644 usr/src/uts/sun4u/io/todstarcat.c create mode 100644 usr/src/uts/sun4u/opl/sys/sckm_io.h delete mode 100644 usr/src/uts/sun4u/starcat/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/Makefile.files delete mode 100644 usr/src/uts/sun4u/starcat/Makefile.rules delete mode 100644 usr/src/uts/sun4u/starcat/Makefile.starcat delete mode 100644 usr/src/uts/sun4u/starcat/Makefile.targ delete mode 100644 usr/src/uts/sun4u/starcat/axq/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/cheetah/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/cheetahplus/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/cvc/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/cvcredir/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/dman/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/dr/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/drmach/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/fcgp2/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/genassym/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/gptwo_pci/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/io/axq.c delete mode 100644 usr/src/uts/sun4u/starcat/io/cvc.c delete mode 100644 usr/src/uts/sun4u/starcat/io/cvc.conf delete mode 100644 usr/src/uts/sun4u/starcat/io/cvcredir.c delete mode 100644 usr/src/uts/sun4u/starcat/io/cvcredir.conf delete mode 100644 usr/src/uts/sun4u/starcat/io/dman.c delete mode 100644 usr/src/uts/sun4u/starcat/io/dman.conf delete mode 100644 usr/src/uts/sun4u/starcat/io/dman_domain.c delete mode 100644 usr/src/uts/sun4u/starcat/io/dr.conf delete mode 100644 usr/src/uts/sun4u/starcat/io/drmach.c delete mode 100644 usr/src/uts/sun4u/starcat/io/fcgp2.c delete mode 100644 usr/src/uts/sun4u/starcat/io/gptwo_pci.c delete mode 100644 usr/src/uts/sun4u/starcat/io/iosram.c delete mode 100644 usr/src/uts/sun4u/starcat/io/mboxsc.c delete mode 100644 usr/src/uts/sun4u/starcat/io/sc_gptwocfg.c delete mode 100644 usr/src/uts/sun4u/starcat/io/schpc.c delete mode 100644 usr/src/uts/sun4u/starcat/io/schpc.conf delete mode 100644 usr/src/uts/sun4u/starcat/io/sckmdrv.c delete mode 100644 usr/src/uts/sun4u/starcat/io/sckmdrv.conf delete mode 100644 usr/src/uts/sun4u/starcat/io/scosmb.c delete mode 100644 usr/src/uts/sun4u/starcat/iosram/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/mboxsc/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/ml/drmach.il.cpp delete mode 100644 usr/src/uts/sun4u/starcat/ml/drmach_asm.s delete mode 100644 usr/src/uts/sun4u/starcat/ml/starcat_asm.s delete mode 100644 usr/src/uts/sun4u/starcat/os/starcat.c delete mode 100644 usr/src/uts/sun4u/starcat/platmod/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/sc_gptwocfg/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/schpc/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/sckmdrv/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/scosmb/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/sys/Makefile delete mode 100644 usr/src/uts/sun4u/starcat/sys/axq.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/dman.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/domaind.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/dr_mbx.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/drmach.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/gptwo_pci.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/iosramio.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/iosramreg.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/iosramvar.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/mboxsc.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/mboxsc_impl.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/post/scat_asicbrd_types.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/post/scat_const.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/post/scat_dcd.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/post/scat_pa_space.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/sc_cvc.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/sc_cvcio.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/sc_gptwocfg.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/schpc.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/schpc_msg.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/sckm_io.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/sckm_msg.h delete mode 100644 usr/src/uts/sun4u/starcat/sys/starcat.h delete mode 100644 usr/src/uts/sun4u/starcat/unix/Makefile delete mode 100644 usr/src/uts/sun4u/sys/pci/pci_axq.h delete mode 100644 usr/src/uts/sun4u/todstarcat/Makefile (limited to 'usr/src') diff --git a/usr/src/cmd/Makefile b/usr/src/cmd/Makefile index 36ef810055..c91ddfa2b5 100644 --- a/usr/src/cmd/Makefile +++ b/usr/src/cmd/Makefile @@ -492,7 +492,6 @@ i386_SUBDIRS= \ xvm sparc_SUBDIRS= \ - cvcd \ dcs \ device_remap \ drd \ diff --git a/usr/src/cmd/Makefile.check b/usr/src/cmd/Makefile.check index 2ad038596b..91507c9ad9 100644 --- a/usr/src/cmd/Makefile.check +++ b/usr/src/cmd/Makefile.check @@ -23,6 +23,7 @@ # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2014 Garrett D'Amore # Copyright 2017 Nexenta Systems, Inc. +# Copyright 2019 Peter Tribble # include ../Makefile.master @@ -38,7 +39,6 @@ MANIFEST_TOPDIRS= \ consadm \ coreadm \ cron \ - cvcd \ dispadmin \ drd \ dumpadm \ diff --git a/usr/src/cmd/cvcd/Makefile b/usr/src/cmd/cvcd/Makefile deleted file mode 100644 index b2b85d4613..0000000000 --- a/usr/src/cmd/cvcd/Makefile +++ /dev/null @@ -1,63 +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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# Copyright 2019 Peter Tribble. -# -# Makefile definitions for Starcat Network Console related items. -# -# cmd/cvcd/Makefile -# -# These utilities are specific to the Sun-Fire-15000 platform at this -# time. -# - -PROG= cvcd -MANIFEST= cvc.xml -SVCMETHOD= svc-$(PROG) - -include ../Makefile.cmd - -SUBDIRS = sparc - -ROOTMANIFESTDIR= $(ROOTSVCSYSTEM) - -all := TARGET= all -install := TARGET= install -clean := TARGET= clean -clobber := TARGET= clobber -lint := TARGET= lint - -.KEEP_STATE: - -all lint clean clobber: $(SUBDIRS) - -install: $(SUBDIRS) $(ROOTMANIFEST) $(ROOTSVCMETHOD) - -check: $(CHKMANIFEST) - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: - -include ../Makefile.targ diff --git a/usr/src/cmd/cvcd/cvc.xml b/usr/src/cmd/cvcd/cvc.xml deleted file mode 100644 index 4b88288850..0000000000 --- a/usr/src/cmd/cvcd/cvc.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/usr/src/cmd/cvcd/sparc/Makefile b/usr/src/cmd/cvcd/sparc/Makefile deleted file mode 100644 index e5c629cfc3..0000000000 --- a/usr/src/cmd/cvcd/sparc/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -# -# 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) 1997 by Sun Microsystems, Inc. -# All rights reserved. -# Copyright 2019 Peter Tribble. -# -# Makefile definitions for Starcat's Network Console related items. -# -# cmd/cvcd/sparc/Makefile -# - -SUBDIRS = sun4u - -all := TARGET= all -install := TARGET= install -clean := TARGET= clean -clobber := TARGET= clobber -lint := TARGET= lint - -.KEEP_STATE: - -all install lint clean clobber: $(SUBDIRS) - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: diff --git a/usr/src/cmd/cvcd/sparc/sun4u/Makefile b/usr/src/cmd/cvcd/sparc/sun4u/Makefile deleted file mode 100644 index e9bbcd1148..0000000000 --- a/usr/src/cmd/cvcd/sparc/sun4u/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -# -# 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 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# Copyright 2019 Peter Tribble. -# -# Makefile definitions for Starcat Network Console related items. -# -# cmd/cvcd/sparc/sun4u/Makefile -# - -SUBDIRS = starcat - -all := TARGET= all -install := TARGET= install -clean := TARGET= clean -clobber := TARGET= clobber -lint := TARGET= lint - -.KEEP_STATE: - -all install lint clean clobber: $(SUBDIRS) - -$(SUBDIRS): FRC - @cd $@; pwd; $(MAKE) $(TARGET) - -FRC: diff --git a/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile b/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile deleted file mode 100644 index 05c02a9d28..0000000000 --- a/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile +++ /dev/null @@ -1,62 +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 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -# cmd/cvcd/sparc/sun4u/starcat/cvcd -# -PROG= cvcd -ROOTFS_PROG= $(PROG) -PLATFORM= SUNW,Sun-Fire-15000 - -# Create default so empty rules don't confuse make -CLASS= 32 - -SRCS= $(PROG:%=%.c) -OBJS= $(PROG:%=%.o) - -include ../../../../Makefile.cmd -include ../../../../../Makefile.psm - -FILEMODE= 0755 - -ROOTPSMPROG = $(ROOT_PSM_LIB_DIR)/$(PROG) - -CPPFLAGS = -I$(USR_PSM_INCL_DIR) -I$(SRC)/uts/sun4u/starcat $(CPPFLAGS.master) -CERRWARN += -_gcc=-Wno-unused-variable -CERRWARN += -_gcc=-Wno-uninitialized - -LDLIBS += -lsocket - -.KEEP_STATE: - -all: $(ROOTFS_PROG) - -install: all .WAIT $(ROOTPSMPROG) - -clean: - $(RM) $(PROG) $(OBJS) - -lint: lint_PROG - -include ../../../../Makefile.targ -include ../../../../../Makefile.psm.targ diff --git a/usr/src/cmd/cvcd/sparc/sun4u/starcat/cvcd.c b/usr/src/cmd/cvcd/sparc/sun4u/starcat/cvcd.c deleted file mode 100644 index 044391da7c..0000000000 --- a/usr/src/cmd/cvcd/sparc/sun4u/starcat/cvcd.c +++ /dev/null @@ -1,888 +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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * This code implements the Starcat Virtual Console host daemon (see cvcd(1M)). - * It accepts one TCP connection at a time on a well-known port. Once a - * connection is accepted, the console redirection driver (cvcdredir(7D)) is - * opened, and console I/O is routed back and forth between the two file - * descriptors (network and redirection driver). Per-socket IPsec is used to - * secure the connection if it is enabled with the "-a", "-u" and or "-e" - * command line options. - */ - -#include -#include -#include -#include -#include -#include - -#include -#include /* Just to get FIONBIO... */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include - - -/* - * Header files for per-socket IPsec - */ -#include -#include - -/* - * The IPsec socket option struct, from ipsec(7P): - * - * typedef struct ipsec_req { - * uint_t ipsr_ah_req; AH request - * uint_t ipsr_esp_req; ESP request - * uint_t ipsr_self_encap_req; Self-Encap request - * uint8_t ipsr_auth_alg; Auth algs for AH - * uint8_t ipsr_esp_alg; Encr algs for ESP - * uint8_t ipsr_esp_auth_alg; Auth algs for ESP - * } ipsec_req_t; - * - * The -a option sets the ipsr_auth_alg field. Allowable arguments - * are "none", "md5", or "sha1". The -e option sets the ipsr_esp_alg - * field. Allowable arguments are "none", "des", or "3des". "none" - * is the default for both options. The -u option sets ipsr_esp_auth_alg. - * Allowable arguments are the same as -a. - * - * The arguments ("md5", "des", etc.) are named so that they match - * kmd(1m)'s accepted arguments which are listed on the SC in - * /etc/opt/SUNWSMS/SMS/config/kmd_policy.cf. - */ -#define AH_REQ (IPSEC_PREF_REQUIRED | IPSEC_PREF_UNIQUE) -#define ESP_REQ (IPSEC_PREF_REQUIRED | IPSEC_PREF_UNIQUE) -#define SELF_ENCAP_REQ 0x0 - -/* - * A type to hold the command line argument string used to select a - * particular authentication header (AH) or encapsulating security - * payload (ESP) algorithm and the ID used for that algorithm when - * filling the ipsec_req_t structure which is passed to - * setsockopt(3SOCKET). - */ -typedef struct cvcd_alg { - char *arg_name; - uint8_t alg_id; -} cvcd_alg_t; - -/* - * Misc. defines. - */ -#define NODENAME "/etc/nodename" -#define NETWORK_PFD 0 -#define REDIR_PFD 1 -#define LISTEN_PFD 2 -#define NUM_PFDS 3 - -/* - * Function prototypes - */ -static void cvcd_set_priority(void); -static int cvcd_init_host_socket(int port, uint8_t ah_auth_alg, - uint8_t esp_encr_alg, uint8_t esp_auth_alg); -static void cvcd_do_network_console(void); -static void cvcd_err(int code, char *format, ...); -static void cvcd_usage(void); -static uint8_t cvcd_get_alg(cvcd_alg_t *algs, char *arg); -static boolean_t cvcd_global_policy(void); - -/* - * Globals - */ -static struct pollfd pfds[NUM_PFDS]; -static char progname[MAXPATHLEN]; -static int debug = 0; - -/* - * Array of acceptable -a, -u and -e arguments. - */ -static cvcd_alg_t auth_algs_array[] = { - { "none", SADB_AALG_NONE }, /* -a none or -u none */ - { "md5", SADB_AALG_MD5HMAC }, /* -a md5 or -u md5 */ - { "sha1", SADB_AALG_SHA1HMAC }, /* -a sha1 or -u sha1 */ - { NULL, 0x0 } -}, esp_algs_array[] = { - { "none", SADB_EALG_NONE }, /* -e none */ - { "des", SADB_EALG_DESCBC }, /* -e des */ - { "3des", SADB_EALG_3DESCBC }, /* -e 3des */ - { NULL, 0x0 } -}; - - -int -main(int argc, char **argv) -{ - int err; - int opt; - int tport = 0; - char *hostname; - struct utsname utsname; - int fd; - int i; - struct servent *se; - char prefix[256]; - uint8_t ah_auth_alg = SADB_AALG_NONE; - uint8_t esp_encr_alg = SADB_EALG_NONE; - uint8_t esp_auth_alg = SADB_AALG_NONE; - - (void) setlocale(LC_ALL, ""); - (void) strcpy(progname, argv[0]); - -#ifdef DEBUG - while ((opt = getopt(argc, argv, "a:e:u:dp:")) != EOF) { -#else - while ((opt = getopt(argc, argv, "a:e:u:")) != EOF) { -#endif - switch (opt) { - case 'a' : - case 'u' : - if (opt == 'a') - ah_auth_alg = cvcd_get_alg( - auth_algs_array, optarg); - else - esp_auth_alg = cvcd_get_alg( - auth_algs_array, optarg); - break; - - case 'e' : esp_encr_alg = cvcd_get_alg( - esp_algs_array, optarg); - break; -#ifdef DEBUG - case 'd' : debug = 1; - break; - - case 'p' : tport = atoi(optarg); - break; -#endif /* DEBUG */ - - default : cvcd_usage(); - exit(1); - } - } - - if (uname(&utsname) == -1) { - perror("HOSTNAME not defined"); - exit(1); - } - hostname = utsname.nodename; - - /* - * hostname may still be NULL, depends on when cvcd was started - * in the boot sequence. If it is NULL, try one more time - * to get a hostname -> look in the /etc/nodename file. - */ - if (!strlen(hostname)) { - /* - * try to get the hostname from the /etc/nodename file - * we reuse the utsname.nodename buffer here! hostname - * already points to it. - */ - if ((fd = open(NODENAME, O_RDONLY)) > 0) { - if ((i = read(fd, utsname.nodename, SYS_NMLN)) <= 0) { - cvcd_err(LOG_WARNING, - "failed to acquire hostname"); - } else { - utsname.nodename[i-1] = '\0'; - } - (void) close(fd); - } - } - /* - * If all attempts to get the hostname have failed, put something - * meaningful in the buffer. - */ - if (!strlen(hostname)) { - (void) strcpy(utsname.nodename, "(unknown)"); - } - - /* - * Must be root. - */ - if (debug == 0 && geteuid() != 0) { - fprintf(stderr, "cvcd: Must be root"); - exit(1); - } - - /* - * Daemonize... - */ - if (debug == 0) { - closefrom(0); - (void) chdir("/"); - (void) umask(0); - if (fork() != 0) { - exit(0); - } - (void) setpgrp(); - (void) sprintf(prefix, "%s-(HOSTNAME:%s)", progname, hostname); - openlog(prefix, LOG_CONS | LOG_NDELAY, LOG_LOCAL0); - } - - /* - * Initialize the array of pollfds used to track the listening socket, - * the connection to the console redirection driver, and the network - * connection. - */ - (void) memset((void *)pfds, 0, NUM_PFDS * sizeof (struct pollfd)); - for (i = 0; i < NUM_PFDS; i++) { - pfds[i].fd = -1; - } - - /* SPR 94004 */ - (void) sigignore(SIGTERM); - - /* - * SPR 83644: cvc and kadb are not compatible under heavy loads. - * Fix: will give cvcd highest TS priority at execution time. - */ - cvcd_set_priority(); - - /* - * If not already determined by a command-line flag, figure out which - * port we're supposed to be listening on. - */ - if (tport == 0) { - if ((se = getservbyname(CVCD_SERVICE, "tcp")) == NULL) { - cvcd_err(LOG_ERR, "getservbyname(%s) not found", - CVCD_SERVICE); - exit(1); - } - tport = se->s_port; - } - - if (debug == 1) { - cvcd_err(LOG_DEBUG, "tport = %d, debug = %d", tport, debug); - } - - /* - * Attempt to initialize the socket we'll use to listen for incoming - * connections. No need to check the return value, as the call will - * exit if it fails. - */ - pfds[LISTEN_PFD].fd = cvcd_init_host_socket(tport, ah_auth_alg, - esp_encr_alg, esp_auth_alg); - - /* - * Now that we're all set up, we loop forever waiting for connections - * (one at a time) and then driving network console activity over them. - */ - for (;;) { - /* - * Start by waiting for an incoming connection. - */ - do { - pfds[LISTEN_PFD].events = POLLIN; - err = poll(&(pfds[LISTEN_PFD]), 1, -1); - if (err == -1) { - cvcd_err(LOG_ERR, "poll: %s", strerror(errno)); - exit(1); - } - if ((err > 0) && - (pfds[LISTEN_PFD].revents & POLLIN)) { - fd = accept(pfds[LISTEN_PFD].fd, NULL, NULL); - if ((fd == -1) && (errno != EWOULDBLOCK)) { - cvcd_err(LOG_ERR, "accept: %s", - strerror(errno)); - exit(1); - } - } - } while (fd == -1); - - /* - * We have a connection. Set the new socket nonblocking, and - * initialize the appropriate pollfd. In theory, the new socket - * is _already_ non-blocking because accept() is supposed to - * hand us a socket with the same properties as the socket we're - * listening on, but it won't hurt to make sure. - */ - opt = 1; - err = ioctl(fd, FIONBIO, &opt); - if (err == -1) { - cvcd_err(LOG_ERR, "ioctl: %s", strerror(errno)); - (void) close(fd); - continue; - } - pfds[NETWORK_PFD].fd = fd; - - /* - * Since we're ready to do network console stuff, go ahead and - * open the Network Console redirection driver, which will - * switch traffic from the IOSRAM path to the network path if - * the network path has been selected in cvc. - */ - fd = open(CVCREDIR_DEV, O_RDWR|O_NDELAY); - if (fd == -1) { - cvcd_err(LOG_ERR, "open(redir): %s", strerror(errno)); - exit(1); - } - pfds[REDIR_PFD].fd = fd; - - /* - * We have a network connection and we have the redirection - * driver open, so drive the network console until something - * changes. - */ - cvcd_do_network_console(); - - /* - * cvcd_do_network_console doesn't return until there's a - * problem, so we need to close the network connection and the - * redirection driver and start the whole loop over again. - */ - (void) close(pfds[NETWORK_PFD].fd); - pfds[NETWORK_PFD].fd = -1; - (void) close(pfds[REDIR_PFD].fd); - pfds[REDIR_PFD].fd = -1; - } - - /* NOTREACHED */ - return (1); -} - -/* - * cvcd_get_alg - * - * Returns the ID of the first algorithm found in - * the 'algs' array with a name matching 'arg'. If - * there is no matching algorithm, the function does - * not return. The 'algs' array must be terminated - * by an entry containing a NULL 'arg_name' field. - */ -static uint8_t -cvcd_get_alg(cvcd_alg_t *algs, char *arg) -{ - cvcd_alg_t *alg; - - for (alg = algs; alg->arg_name != NULL && arg != NULL; alg++) { - if (strncmp(alg->arg_name, arg, strlen(alg->arg_name) + 1) - == 0) { - return (alg->alg_id); - } - } - - cvcd_usage(); - exit(1); - /* NOTREACHED */ -} - -/* - * cvcd_set_priority - * - * DESCRIBE - * SPR 83644: cvc and kadb are not compatible under heavy loads. - * Fix: will give cvcd highest TS priority at execution time. - */ -static void -cvcd_set_priority(void) -{ - id_t pid, tsID; - pcparms_t pcparms; - tsparms_t *tsparmsp; - short tsmaxpri; - pcinfo_t info; - - pid = getpid(); - pcparms.pc_cid = PC_CLNULL; - tsparmsp = (tsparms_t *)pcparms.pc_clparms; - - /* Get scheduler properties for this PID */ - if (priocntl(P_PID, pid, PC_GETPARMS, (caddr_t)&pcparms) == -1L) { - cvcd_err(LOG_ERR, "Warning: can't set priority."); - cvcd_err(LOG_ERR, "priocntl(GETPARMS): %s", strerror(errno)); - return; - } - - /* Get class ID and maximum priority for TS process class */ - (void) strcpy(info.pc_clname, "TS"); - if (priocntl(0L, 0L, PC_GETCID, (caddr_t)&info) == -1L) { - cvcd_err(LOG_ERR, "Warning: can't set priority."); - cvcd_err(LOG_ERR, "priocntl(GETCID): %s", strerror(errno)); - return; - } - tsmaxpri = ((struct tsinfo *)info.pc_clinfo)->ts_maxupri; - tsID = info.pc_cid; - - /* Print priority info in debug mode */ - if (debug) { - if (pcparms.pc_cid == tsID) { - cvcd_err(LOG_DEBUG, - "PID: %d, current priority: %d, Max priority: %d.", - pid, tsparmsp->ts_upri, tsmaxpri); - } - } - /* Change proc's priority to maxtspri */ - pcparms.pc_cid = tsID; - tsparmsp->ts_upri = tsmaxpri; - tsparmsp->ts_uprilim = tsmaxpri; - - if (priocntl(P_PID, pid, PC_SETPARMS, (caddr_t)&pcparms) == -1L) { - cvcd_err(LOG_ERR, "Warning: can't set priority."); - cvcd_err(LOG_ERR, "priocntl(SETPARMS): %s", strerror(errno)); - } - - /* Print new priority info in debug mode */ - if (debug) { - if (priocntl(P_PID, pid, PC_GETPARMS, (caddr_t)&pcparms) == - -1L) { - cvcd_err(LOG_ERR, "priocntl(GETPARMS): %s", - strerror(errno)); - } else { - cvcd_err(LOG_DEBUG, "PID: %d, new priority: %d.", pid, - tsparmsp->ts_upri); - } - } -} - - -/* - * cvcd_init_host_socket - * - * Given a TCP port number, create and initialize a socket appropriate for - * accepting incoming connections to that port. - */ -static int -cvcd_init_host_socket(int port, uint8_t ah_auth_alg, uint8_t esp_encr_alg, - uint8_t esp_auth_alg) -{ - int err; - int fd; - int optval; - int optlen = sizeof (optval); - ipsec_req_t ipsec_req; /* For per-socket IPsec */ - struct sockaddr_in6 sin6; /* IPv6 listen socket */ - - /* - * Start by creating the socket, which needs to support IPv6. - */ - fd = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); - if (fd == -1) { - cvcd_err(LOG_ERR, "socket: %s", strerror(errno)); - exit(1); - } - - /* - * Set the SO_REUSEADDR option, and make the socket non-blocking. - */ - optval = 1; - err = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, optlen); - if (err == -1) { - cvcd_err(LOG_ERR, "setsockopt: %s", strerror(errno)); - exit(1); - } - - err = ioctl(fd, FIONBIO, &optval); - if (err == -1) { - cvcd_err(LOG_ERR, "ioctl: %s", strerror(errno)); - exit(1); - } - - /* - * Enable per-socket IPsec if the user specified an AH or ESP - * algorithm to use and global policy is not in effect. - */ - if (!cvcd_global_policy() && - (ah_auth_alg != SADB_AALG_NONE || esp_encr_alg != SADB_EALG_NONE || - esp_auth_alg != SADB_AALG_NONE)) { - bzero(&ipsec_req, sizeof (ipsec_req)); - - /* Hardcoded values */ - ipsec_req.ipsr_self_encap_req = SELF_ENCAP_REQ; - /* User defined */ - ipsec_req.ipsr_auth_alg = ah_auth_alg; - ipsec_req.ipsr_esp_alg = esp_encr_alg; - if (ah_auth_alg != SADB_AALG_NONE) - ipsec_req.ipsr_ah_req = AH_REQ; - if (esp_encr_alg != SADB_EALG_NONE || - esp_auth_alg != SADB_AALG_NONE) { - ipsec_req.ipsr_esp_req = ESP_REQ; - ipsec_req.ipsr_esp_auth_alg = esp_auth_alg; - } - - err = setsockopt(fd, IPPROTO_IPV6, IPV6_SEC_OPT, - (void *)&ipsec_req, sizeof (ipsec_req)); - - if (err == -1) { - cvcd_err(LOG_ERR, "failed to enable per-socket IPsec"); - cvcd_err(LOG_ERR, "setsockopt: %s", strerror(errno)); - exit(1); - } - } - - /* - * Bind the socket to our local address and port. - */ - bzero(&sin6, sizeof (sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_port = htons(port); - sin6.sin6_addr = in6addr_any; - err = bind(fd, (struct sockaddr *)&sin6, sizeof (sin6)); - if (err == -1) { - cvcd_err(LOG_ERR, "bind: %s", strerror(errno)); - exit(1); - } - - /* - * Indicate that we want to accept connections on this socket. Since we - * only allow one connection at a time anyway, specify a maximum backlog - * of 1. - */ - err = listen(fd, 1); - if (err == -1) { - cvcd_err(LOG_ERR, "listen: %s", strerror(errno)); - exit(1); - } - - return (fd); -} - - -/* - * cvcd_do_network_console - * - * With established connections to the network and the redirection driver, - * shuttle data between the two until something goes wrong. - */ -static void -cvcd_do_network_console(void) -{ - int i; - int err; - int count; - short revents; - int input_len = 0; - int output_len = 0; - int input_off = 0; - int output_off = 0; - char input_buf[MAXPKTSZ]; - char output_buf[MAXPKTSZ]; - - for (;;) { - /* - * Wait for activity on any of the open file descriptors, which - * includes the ability to write data if we have any to write. - * If poll() fails, break out of the network console processing - * loop. - */ - pfds[LISTEN_PFD].events = POLLIN; - pfds[NETWORK_PFD].events = POLLIN; - if (output_len != 0) { - pfds[NETWORK_PFD].events |= POLLOUT; - } - pfds[REDIR_PFD].events = POLLIN; - if (input_len != 0) { - pfds[REDIR_PFD].events |= POLLOUT; - } - err = poll(pfds, NUM_PFDS, -1); - if (err == -1) { - cvcd_err(LOG_ERR, "poll: %s", strerror(errno)); - break; - } - - /* - * If any errors or hangups were detected, or one of our file - * descriptors is bad, bail out of the network console - * processing loop. - */ - for (i = 0; i < NUM_PFDS; i++) { - revents = pfds[i].revents; - if (revents & (POLLERR | POLLHUP | POLLNVAL)) { - cvcd_err(LOG_NOTICE, - "poll: status on %s fd:%s%s%s", - ((i == LISTEN_PFD) ? "listen" : - ((i == NETWORK_PFD) ? "network" : "redir")), - (revents & POLLERR) ? " error" : "", - (revents & POLLHUP) ? " hangup" : "", - (revents & POLLNVAL) ? " bad fd" : ""); - goto fail; /* 'break' wouldn't work here */ - } - } - - /* - * Start by rejecting any connection attempts, since we only - * allow one network connection at a time. - */ - if (pfds[LISTEN_PFD].revents & POLLIN) { - int fd; - - fd = accept(pfds[LISTEN_PFD].fd, NULL, NULL); - if (fd > 0) { - (void) close(fd); - } - } - - /* - * If we have data waiting to be written in one direction or the - * other, go ahead and try to send the data on its way. We're - * going to attempt the writes regardless of whether the poll - * indicated that the destinations are ready, because we want to - * find out if either descriptor has a problem (e.g. broken - * network link). - * If an "unexpected" error is detected, give up and break out - * of the network console processing loop. - */ - if (output_len != 0) { - count = write(pfds[NETWORK_PFD].fd, - &(output_buf[output_off]), output_len); - if ((count == -1) && (errno != EAGAIN)) { - cvcd_err(LOG_ERR, "write(network): %s", - strerror(errno)); - break; - } else if (count > 0) { - output_len -= count; - if (output_len == 0) { - output_off = 0; - } else { - output_off += count; - } - } - } - - if (input_len != 0) { - count = write(pfds[REDIR_PFD].fd, - &(input_buf[input_off]), input_len); - if ((count == -1) && (errno != EAGAIN)) { - cvcd_err(LOG_ERR, "write(redir): %s", - strerror(errno)); - break; - } else if (count > 0) { - input_len -= count; - if (input_len == 0) { - input_off = 0; - } else { - input_off += count; - } - } - } - - /* - * Finally, take a look at each data source and, if there isn't - * any residual data from that source still waiting to be - * processed, see if more data can be read. We don't want to - * read more data from a source if we haven't finished - * processing the last data we read from it because doing so - * would maximize the amount of data lost if the network console - * failed or was closed. - * If an "unexpected" error is detected, give up and break out - * of the network console processing loop. - * The call to read() appears to be in the habit of returning 0 - * when you've read all of the data from a stream that has been - * hung up, and poll apparently feels that that condition - * justifies setting POLLIN, so we're going to treat 0 as an - * error return from read(). - */ - if ((output_len == 0) && (pfds[REDIR_PFD].revents & POLLIN)) { - count = read(pfds[REDIR_PFD].fd, output_buf, MAXPKTSZ); - if (count <= 0) { - /* - * Reading 0 simply means there is no data - * available, since this is a terminal. - */ - if ((count < 0) && (errno != EAGAIN)) { - cvcd_err(LOG_ERR, "read(redir): %s", - strerror(errno)); - break; - } - } else { - output_len = count; - output_off = 0; - } - } - - if ((input_len == 0) && (pfds[NETWORK_PFD].revents & POLLIN)) { - count = read(pfds[NETWORK_PFD].fd, input_buf, MAXPKTSZ); - if (count <= 0) { - /* - * Reading 0 here implies a hangup, since this - * is a non-blocking socket that poll() reported - * as having data available. This will - * typically occur when the console user drops - * to OBP or intentially switches to IOSRAM - * mode. - */ - if (count == 0) { - cvcd_err(LOG_NOTICE, - "read(network): hangup detected"); - break; - } else if (errno != EAGAIN) { - cvcd_err(LOG_ERR, "read(network): %s", - strerror(errno)); - break; - } - } else { - input_len = count; - input_off = 0; - } - } - } /* End forever loop */ - - /* - * If we get here, something bad happened during an attempt to access - * either the redirection driver or the network connection. There - * doesn't appear to be any way to avoid the possibility of losing - * console input and/or input in that case, so we should at least report - * the loss if it happens. - * XXX - We could do more, but is it worth the effort? Logging the - * lost data would be pretty easy... actually preserving it - * in the console flow would be a lot harder. We're more robust - * than the previous generation at this point, at least, so - * perhaps that's enough for now? - */ -fail: - if (input_len != 0) { - cvcd_err(LOG_ERR, "console input lost"); - } - if (output_len != 0) { - cvcd_err(LOG_ERR, "console output lost"); - } -} - - -static void -cvcd_usage() -{ -#if defined(DEBUG) - (void) printf("%s [-d] [-p port] " - "[-a none|md5|sha1] [-e none|des|3des] [-u none|md5|sha1]\n", - progname); -#else - (void) printf("%s [-a none|md5|sha1] [-e none|des|3des] " - "[-u none|md5|sha1]\n", progname); -#endif /* DEBUG */ -} - -/* - * cvcd_err () - * - * Description: - * Log messages via syslog daemon. - * - * Input: - * code - logging code - * format - messages to log - * - * Output: - * void - * - */ -static void -cvcd_err(int code, char *format, ...) -{ - va_list varg_ptr; - char buf[MAXPKTSZ]; - - va_start(varg_ptr, format); - (void) vsnprintf(buf, MAXPKTSZ, format, varg_ptr); - va_end(varg_ptr); - - if (debug == 0) { - syslog(code, buf); - } else { - (void) fprintf(stderr, "%s: %s\n", progname, buf); - } -} - -/* - * has_cvcd_token - * - * Look for "?port [cvc_hostd|442]" in input buf. - * Assume only a single thread calls here. - */ -static boolean_t -has_cvcd_token(char *buf) -{ - char *token; - char *delims = "{} \t\n"; - boolean_t port = B_FALSE; - - while ((token = strtok(buf, delims)) != NULL) { - buf = NULL; - if (port == B_TRUE) { - if (strcmp(token, "cvc_hostd") == 0 || - strcmp(token, "442") == 0) { - return (B_TRUE); - } else { - return (B_FALSE); - } - } - if (strlen(token) == 5) { - token++; - if (strcmp(token, "port") == 0) { - port = B_TRUE; - continue; - } - } - } - return (B_FALSE); -} - -/* - * cvcd_global_policy - * - * Check global policy file for cvcd entry. Just covers common cases. - */ -static boolean_t -cvcd_global_policy() -{ - FILE *fp; - char buf[256]; - boolean_t rv = B_FALSE; - - fp = fopen("/etc/inet/ipsecinit.conf", "r"); - if (fp == NULL) - return (B_FALSE); - while (fgets(buf, sizeof (buf), fp) != NULL) { - if (buf[0] == '#') - continue; - if (has_cvcd_token(buf)) { - rv = B_TRUE; - cvcd_err(LOG_NOTICE, "cvcd using global policy"); - break; - } - } - (void) fclose(fp); - return (rv); -} diff --git a/usr/src/cmd/cvcd/svc-cvcd b/usr/src/cmd/cvcd/svc-cvcd deleted file mode 100644 index caeeb9b54c..0000000000 --- a/usr/src/cmd/cvcd/svc-cvcd +++ /dev/null @@ -1,61 +0,0 @@ -#!/sbin/sh -# -# 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 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# Copyright 2019 Peter Tribble. -# -# Start script for cvcd -# -# For modifying parameters passed to cvcd, do not edit -# this script. Instead use svccfg(1m) to modify the SMF -# repository. For example: -# -# svccfg -# svc:> select system/cvc -# svc:system/cvc> setprop cvc/ah_auth = "md5" -# svc:/system/cvc> exit - - -. /lib/svc/share/smf_include.sh - -getproparg() { - val=`svcprop -p $2 $SMF_FMRI` - [ -n "$val" ] && [ "$val" != 'none' ] && echo $1 $val -} - -platform=`/sbin/uname -i` -starcat="SUNW,Sun-Fire-15000" - -if [ $platform = "$starcat" ]; then - args="" - args="$args `getproparg -a cvc/ah_auth`" - args="$args `getproparg -e cvc/esp_encr`" - args="$args `getproparg -u cvc/esp_auth`" - /platform/$platform/lib/cvcd $args # Fail if can't execute - exit # Use cvcd's exit status -else - echo "$SMF_FMRI is not supported on this platform." - exit $SMF_EXIT_ERR_CONFIG -fi - -exit 0 diff --git a/usr/src/cmd/dcs/sparc/sun4u/dcs.xml b/usr/src/cmd/dcs/sparc/sun4u/dcs.xml index 1fa7be34d7..a14f03eeb4 100644 --- a/usr/src/cmd/dcs/sparc/sun4u/dcs.xml +++ b/usr/src/cmd/dcs/sparc/sun4u/dcs.xml @@ -4,6 +4,7 @@ + - - - - - - - - -