#ident "@(#)torx_info	1.40	11/24/92"

###########################################################################
#
# SpiderTCP/X25 Configuration Utilities
#
# Copyright Spider Systems 1991
# Copyright 03 Apr 1995 Sun Microsystems, Inc. All Rights Reserved
#
# TORX_INFO
#  
# Contains configuration information for system management
#
# Many manufacturers names are used in this file, all trademarks
# are acknowledged as the property of their owners.
#
# Solaris/x86 (Intel) version
#
###########################################################################

#
#	 /projects/common/PBRAIN/SCCS/pbrainF/dev/src/clib/data/0/s.torx_info
#	@(#)torx_info	1.40
#
#	Last delta created	15:39:34 10/6/92
#	This file extracted	18:56:20 11/24/92
#

KINFODIR=$X25CONFIGFILES/kerninfo
DINFODIR=$X25LIBFILES/datainfo
NBFILE=$X25CONFIGFILES/brdconf
NETDFILE=$X25CONFIGFILES/netconf


CONTROL=x25netd

# GETTY definitions
GETTYFILE=/etc/conf/cf.d/init.base	# file containing spawned gettys
UUGETTY=/usr/lib/uucp/uugetty		# name/location of uugetty program
GETTY=/etc/getty			# name/location of getty program

# contains time "netcreate" ("kernelcreate") was last called,
# and should be removed when configuring network (kernel).
NCHECKFILE=$X25CONFIGFILES/.netd_check          # netcreate checkfile
KCHECKFILE=$X25CONFIGFILES/.kern_check          # kernelcreate checkfile
KUCHECKFILE=$X25CONFIGFILES/.unix_check         # module rebuild/load checkfile
UCHECKFILE=/kernel/unix                         # last time unix was make

# warning messages displayed when the network starts
ULINE="the networking kernel files should be updated (using \"kernelcreate\")"
KLINE="a new kernel should be made"
NLINE="the netconf file should be updated (using \"netcreate\")"
KUNMSG="WARNING:\n$ULINE,\n$KLINE,\nand $NLINE.\n"
UNMSG="WARNING:\n$KLINE,\nand $NLINE.\n"
NMSG="WARNING:\n$NLINE.\n"

KERNDIR=/kernel/conf/pack.d		# location of kernel directory
					# containing drivers [sS]pace.c files,
NODEDIR=/kernel/conf/node.d		# node files,
INITDIR=/kernel/conf/init.d		# and init files

MODLIST="s_xtimer s_xty s_lapb s_llc2 s_x25  s_xout s_xxx s_npi s_ixe"
LOADLIST="s_xtimer xty lapb llc2 x25  s_xout s_xxx s_npi ixe"
UNLOADLIST="ixe lapb llc2 x25  s_xout s_xxx s_npi s_xtimer xty"

SPACEFILE=space.c			# name of driver's [sS]pace.c file

IDBUILD=/usr/lib/snet/modbuild		# name of kernel build program

# characters to use for certain functions
HELP=\?			# help character
GHELP=\?\?		# general help character
LISTCH==		# list info character
CLEARCH=-		# clear line character
DEFCH=-			# default value character

GHELP_INFO="Enter '$GHELP' to see general help."

######################   VARIABLES   #######################

# Ethernet information

ethrchoice=""			# initialise as empty string

# BOARD INFORMATION

# DRIVER INFORMATION
ethrA_name="SMC 8003 Ethernet card"	# its name
ethrA_modname=s_ethrA
ethrA_dev=llc2			# its upper device/module
ethrA_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrA_device=/dev/smc		# device name
ethrA_type=SMC			# board type
ethrA_lines=1			# no of lines per board
ethrA_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrA_onb" ]
then
	# facilities
	ethrA_facs="${ethrA_facs}ETHR "
	# device of the facility
	ethrA_devs="${ethrA_devs}ethr "
fi

ethrchoice="$ethrchoice ethrA"	# build up list of ethr* choices


# DRIVER INFORMATION
ethrB_name="3Com 3C503 Etherlink II card"	# its name
ethrB_modname=s_ethrB
ethrB_dev=llc2			# its upper device/module
ethrB_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrB_device=/dev/el		# device name
ethrB_type=EL			# board type
ethrB_lines=1			# no of lines per board
ethrB_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrB_onb" ]
then
	# facilities
	ethrB_facs="${ethrB_facs}ETHR "
	# device of the facility
	ethrB_devs="${ethrB_devs}ethr "
fi

ethrchoice="$ethrchoice ethrB"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrC_name="3Com 3C509 Etherlink III card"	# its name
ethrC_modname=s_ethrC
ethrC_dev=llc2			# its upper device/module
ethrC_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrC_device=/dev/elx
ethrC_type=ELX
ethrC_lines=1			# no of lines per board
ethrC_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrC_onb" ]
then
	# facilities
	ethrC_facs="${ethrC_facs}ETHR "
	# device of the facility
	ethrC_devs="${ethrC_devs}ethr "
fi

ethrchoice="$ethrchoice ethrC"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrD_name="SMC Elite 32 twin channel ethernet card"	# its name
ethrD_modname=s_ethrD
ethrD_dev=llc2			# its upper device/module
ethrD_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrD_device=/dev/smce
ethrD_type=SMCE
ethrD_lines=1			# no of lines per board
ethrD_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrD_onb" ]
then
	# facilities
	ethrD_facs="${ethrD_facs}ETHR "
	# device of the facility
	ethrD_devs="${ethrD_devs}ethr "
fi

ethrchoice="$ethrchoice ethrD"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrE_name="SMC Elite32 Ultra ethernet card"	# its name
ethrE_modname=s_ethrE
ethrE_dev=llc2			# its upper device/module
ethrE_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrE_device=/dev/smceu
ethrE_type=SMCEU
ethrE_lines=1			# no of lines per board
ethrE_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrE_onb" ]
then
	# facilities
	ethrE_facs="${ethrE_facs}ETHR "
	# device of the facility
	ethrE_devs="${ethrE_devs}ethr "
fi

ethrchoice="$ethrchoice ethrE"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrF_name="intel EtherExpress16 ethernet card"	# its name
ethrF_modname=s_ethrF
ethrF_dev=llc2			# its upper device/module
ethrF_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrF_device=/dev/iee
ethrF_type=IEE
ethrF_lines=1			# no of lines per board
ethrF_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrF_onb" ]
then
	# facilities
	ethrF_facs="${ethrF_facs}ETHR "
	# device of the facility
	ethrF_devs="${ethrF_devs}ethr "
fi

ethrchoice="$ethrchoice ethrF"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrG_name="intel EtherExpress32 ethernet card"	# its name
ethrG_modname=s_ethrG
ethrG_dev=llc2			# its upper device/module
ethrG_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrG_device=/dev/nee
ethrG_type=NEE
ethrG_lines=1			# no of lines per board
ethrG_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrG_onb" ]
then
	# facilities
	ethrG_facs="${ethrG_facs}ETHR "
	# device of the facility
	ethrG_devs="${ethrG_devs}ethr "
fi

ethrchoice="$ethrchoice ethrG"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrH_name="intel EtherExpress Flash32 ethernet card"	# its name
ethrH_modname=s_ethrH
ethrH_dev=llc2			# its upper device/module
ethrH_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrH_device=/dev/ieef
ethrH_type=IEEF
ethrH_lines=1			# no of lines per board
ethrH_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrH_onb" ]
then
	# facilities
	ethrH_facs="${ethrH_facs}ETHR "
	# device of the facility
	ethrH_devs="${ethrH_devs}ethr "
fi

ethrchoice="$ethrchoice ethrH"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrI_name="intel EtherExpress Pro ethernet card"	# its name
ethrI_modname=s_ethrI
ethrI_dev=llc2			# its upper device/module
ethrI_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrI_device=/dev/eepro
ethrI_type=EEPRO
ethrI_lines=1			# no of lines per board
ethrI_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrI_onb" ]
then
	# facilities
	ethrI_facs="${ethrI_facs}ETHR "
	# device of the facility
	ethrI_devs="${ethrI_devs}ethr "
fi

ethrchoice="$ethrchoice ethrI"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrJ_name="Novell/Eagle ethernet card"	# its name
ethrJ_modname=s_ethrJ
ethrJ_dev=llc2			# its upper device/module
ethrJ_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrJ_device=/dev/nei
ethrJ_type=NEI
ethrJ_lines=1			# no of lines per board
ethrJ_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrJ_onb" ]
then
	# facilities
	ethrJ_facs="${ethrJ_facs}ETHR "
	# device of the facility
	ethrJ_devs="${ethrJ_devs}ethr "
fi

ethrchoice="$ethrchoice ethrJ"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrK_name="racal-Interlan ethernet card"	# its name
ethrK_modname=s_ethrK
ethrK_dev=llc2			# its upper device/module
ethrK_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrK_device=/dev/riles
ethrK_type=RI
ethrK_lines=1			# no of lines per board
ethrK_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrK_onb" ]
then
	# facilities
	ethrK_facs="${ethrK_facs}ETHR "
	# device of the facility
	ethrK_devs="${ethrK_devs}ethr "
fi

ethrchoice="$ethrchoice ethrK"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrL_name="Xircom Pocket Ethernet card"	# its name
ethrL_modname=s_ethrL
ethrL_dev=llc2			# its upper device/module
ethrL_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrL_device=/dev/pe3
ethrL_type=XP
ethrL_lines=1			# no of lines per board
ethrL_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrL_onb" ]
then
	# facilities
	ethrL_facs="${ethrL_facs}ETHR "
	# device of the facility
	ethrL_devs="${ethrL_devs}ethr "
fi

ethrchoice="$ethrchoice ethrL"	# build up list of ethr* choices

# DRIVER INFORMATION
ethrM_name="AMD PCnet ethernet card"	# its name
ethrM_modname=s_ethrM
ethrM_dev=llc2			# its upper device/module
ethrM_upper=ETHR_LOWER		# kernel tuning variable names
				# upper and lower are the same
ethrM_device=/dev/pcn
ethrM_type=PCN
ethrM_lines=1			# no of lines per board
ethrM_onb=			# non-null if driver is on board

# on-board specific info
if [ "$ethrM_onb" ]
then
	# facilities
	ethrM_facs="${ethrM_facs}ETHR "
	# device of the facility
	ethrM_devs="${ethrM_devs}ethr "
fi

ethrchoice="$ethrchoice ethrM"	# build up list of ethr* choices


##################################################################
#
# 			FUNCTIONS
#
##################################################################

# returns true if $1 is older than $2; the files must exist
older()
{
	second=$2
	set -- `ls -t $*`
	test "$1" = "$second"
}

# returns true if $1 is newer than $2; the files must exist
newer()
{
	first=$1
	set -- `ls -t $*`
	test "$1" = "$first"
}

# This function asks a user if he is sure he wants to quit,
# and if so it asks about saving the data file, if necessary.
# It either takes no parameters (indicating no file saving),
# or two parameters (these are passed to "want_save" described below).

sure()
{
	while :
	do
		echo "\nAre you sure you want to quit? \c"
		read answer junk
		case "$answer" in
		[yY]*)	break ;;
		[nN]*)	return 1 ;;
		*)	echo "\nPlease enter 'y' or 'n'." ;;
		esac
	done
	[ $# -gt 0 ] && want_save $*
	return 0
}

# if parameter one (a function) returns true,
# then ask if changes should be saved.
# If the answer is yes, the second parameter (also a function) is called
# The first parameter should be a function which returns true if
# changes have been made to the data file. The second parameter should
# be a function which will save the data file

want_save()
{
	s=$2
	$1 && while :
	do
		echo "\nDo you want to save changes made? \c"
		read answer junk
		case "$answer" in
		[yY]*)	$s ;  break ;;
		[nN]*)	break ;;
		*)	echo "\nPlease enter 'y' or 'n'." ;;
		esac
	done
	return 0
}

# this function displays general help information
gen_help()
{
	echo "
	Command		Action
	-------		------
	$HELP		Give specific help information
	$GHELP		Give this general help information
	RETURN		Use current value (in square brackets)
	q		Quit"
	return 0
}

# Outputs the substring of $2 which is the same length as $1.
# This is usually used to underline $1, $2 being one of the strings below.

underline()
{
	noch=`expr "$1" : ".*"`
	expr "$2" : "\(.\{1,$noch\}\)"
}

# strings to use with the above function
minuses='----------------------------------------------------------------------'
equals='======================================================================'
tildes='~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

# Outputs $1 concatenated with $2, then reduced to the first $3 characters.
# This is usually used to add spaces to end $1, $2 being the space string,
# so that output is in columns

padout()				# pad out $1 with string $2 to $3 chars
{
	expr "$1$2" : "\(.\{1,$3\}\)"
}

# string to use with the above function
spaces='                                                                       '

# This routine returns the maximum of upper connections required by a driver.
# It takes as its parameter the device name of the driver.
max_upper()
{
	eval kfile=\$${1}_kfile
	if [ "$kfile" ]
	then
		infofile=$KINFODIR/$kfile
		. $infofile		# read in file
		# get the number of upper connections
		eval eval echo \\$\$${1}_upper
	else
# Not used in Sun config
		echo 0
#		eval modname=\$${1}_modname
#		infofile=$KERNDIR/$modname/$SPACEFILE
#		# extract value
#		eval upper=\$${1}_upper
#		dvalues "$upper" $infofile
	fi
}
