diff options
author | Peter Wemm <peter@FreeBSD.org> | 1995-12-30 19:02:48 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1995-12-30 19:02:48 +0000 |
commit | a5b996a7ecea192e05c848269fbfb40c1e7c50ef (patch) | |
tree | b43d0e66d9963acc026a6322b81fd219d273736b /usr.sbin | |
parent | df2fbf15a2e56a16c3b54b93a3369b662b6f20e5 (diff) |
recording cvs-1.6 file death
Notes
Notes:
svn path=/cvs2svn/branches/ATT/; revision=13122
Diffstat (limited to 'usr.sbin')
44 files changed, 0 insertions, 4842 deletions
diff --git a/usr.sbin/adduser/adduser b/usr.sbin/adduser/adduser deleted file mode 100644 index 0980004af518..000000000000 --- a/usr.sbin/adduser/adduser +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/perl - - - -# Copyright (c) 1994 GB Data Systems -# All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the Author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# THIS SOFTWARE IS PROVIDED BY GB DATA AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL GB DATA OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -# -# $Id: adduser,v 1.3 1994/12/28 13:49:55 ache Exp $ -# - -$configfile = "\/etc\/adduser.conf"; - -if (-f $configfile) { - open (CONFIG, "$configfile"); - while (<CONFIG>) { - eval "$_"; - } -} - -open (WHOAMI, "whoami|"); - -while (<WHOAMI>) { -$whoami = $_; -} -chop $whoami; - -if ($whoami ne "root") { -system "clear"; -print "\n\nYou must be root to add an user\n\n"; -close WHOAMI; -exit; -} -close WHOAMI; - -# Start getting information and print a banner - -print " Adduser\n"; -print " A system utility for adding users with defaults\n"; -print "\n\n"; - -# -# User ID -# - - -print "Please enter the login name of the user: "; -chop ($userlogin = <STDIN>); - - -sub subuid { -$userid = ""; -print "Please enter the user id or hit enter for the next id: "; -chop ($userid = <STDIN>); -} - -while (!$userid) { -&subuid; -if (!$userid) { - if ($useautoids) { - open (USERID, "+<$userids"); - chop ($xxuserid = <USERID>); - $userid = $xxuserid + 1; - close USERID; - open (USERID, "+>$userids"); - print (USERID "$userid\n"); - close USERID; - } else { &subuid; } -} -} - -# -# Group ID -# - -sub groupids { -print "Please enter the group id or hit enter for the default id: "; -chop ($groupid = <STDIN>); -} - -&groupids; - -while (!$groupid) { - if ($defgroupid) { - if (!$groupid) { - $groupid = "$defgroupid"; - } else { &groupids; } - } else { &groupids; } -} - -# -# User name -# - -print "Please enter the user's name: "; -chop ($username = <STDIN>); - -# -# Home directory -# - -print "Please enter the users home directory or hit enter for default: "; -chop ($userdir = <STDIN>); - -if (!$userdir) { - $userdir = "$defusrdir\/$userlogin"; - print "$userdir\n"; -} - -# -# Login Shell -# - -print "Please enter the users login shell or hit enter for default: "; -chop ($usershell = <STDIN>); - -if (!$usershell) { - $usershell = "$userdefshell"; - print "$usershell\n"; -} - -# -# Create password file entry -# - -print "Opening and locking passwd file in blocking mode.\n"; -open (PASS, '>>/etc/master.passwd'); -flock (PASS, 2) || die "Can't lock passwd file, must be in use!!\n"; -print (PASS "$userlogin::$userid:$groupid::0:0:$username,,,:$userdir:$usershell\n"); -print "Unlocking and closing password file\n"; -flock (PASS,8); -close PASS; -print "Re-indexing password databases\n"; -system 'pwd_mkdb -p /etc/master.passwd'; -system "passwd $userlogin"; - -# -# Create user directory -# -print "Creating user directory\n"; -if (! -e $defusrdir) { - system "mkdir -p $defusrdir\/$userdir"; -} else { - system "mkdir $userdir"; -} - - -print "Copying user shell files\n"; -system "cp $skel_location\/dot.login $userdir\/\.login"; -system "cp $skel_location\/dot.profile $userdir\/\.profile"; - -if ($usershell eq "\/bin\/csh" || $usershell eq "\/usr\/local\/bin\/tcsh") - { - system "cp $skel_location\/dot.cshrc $userdir\/.cshrc"; - } -system "chmod -R 664 $userdir"; -system "chown -R $userid.$groupid $userdir"; - - - -# -# Print out information used in creation of this account -# -print "\n\n"; -print "Information used to create this account follows.\n"; -print "\n"; -print "Login Name: $userlogin\n"; -print "UserId: $userid\n"; -print "GroupId: $groupid\n"; -print "UserName: $username\n"; -print "HomeDir: $userdir\n"; -print "Shell: $usershell\n"; -print "\nDONE\n\n"; - diff --git a/usr.sbin/adduser/adduser.1 b/usr.sbin/adduser/adduser.1 deleted file mode 100644 index 88534d8e3ec5..000000000000 --- a/usr.sbin/adduser/adduser.1 +++ /dev/null @@ -1,75 +0,0 @@ - -.\" Copyright (c) 1994 GB Data Systems -.\" All rights reserved. -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the Author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" THIS SOFTWARE IS PROVIDED BY GB DATA AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL GB DATA OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. - -.\" $Id: adduser.1,v 1.2 1994/12/28 07:11:29 gclarkii Exp $ - -.Dd December 28, 1994 -.Dt ADDUSER 1 -.Os FreeBSD - -.Sh NAME -.Nm adduser - -.Sh SYNOPSIS -.Nm - -.Sh DESCRIPTION -.Nm -is a Perl script for adding users under a BSD system. It has the ability to -keep track of the current userid and increment this automaticly. It can -also use a default group id. -.Ss SETUP -In the normal course of usage there is no setup needed. If you wish to use -auto-increment mode, you must do two things. - -.Bl -enum -compact -.It -Change the variable in -.Pa /etc/adduser.conf -to allow for the auto-increment -.It -Change the file -.Pa /etc/userids -to show the current id number. -.El - -To use the default group id, just change the variable in -.Pa /etc/adduser.conf -to reflect the group that you wish as a default. - -.Sh FILES -.Pa /etc/adduser.conf -.Pa /etc/userids -.Pa /usr/share/skel/* - -.Sh SEE ALSO -.Xr adduser 8 -.Xr perl 1 - -.Sh HISTORY -The adduser command appeared in FreeBSD 2.0C (12-94). - - - diff --git a/usr.sbin/adduser/adduser.conf b/usr.sbin/adduser/adduser.conf deleted file mode 100644 index a5f52dd66660..000000000000 --- a/usr.sbin/adduser/adduser.conf +++ /dev/null @@ -1,12 +0,0 @@ -# -# Configuration file for adduser (1) -# -# $Id:$ - -$useautoids = "1"; # Define this if you wish to use auto-increment -$defgroupid = "20"; # Default ID -$defusrdir = "\/usr\/u"; # Default User Dir -$userdefshell = "\/bin\/csh"; # Default user shell -$skel_location = "\/usr\/share\/skel"; # Location of shell skeletons -$userids = "\.\/userids"; # Location of 'userids' file - diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh deleted file mode 100644 index 58aac329ec89..000000000000 --- a/usr.sbin/adduser/adduser.sh +++ /dev/null @@ -1,195 +0,0 @@ -#!/usr/bin/perl - - - -# Copyright (c) 1994 GB Data Systems -# All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the Author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# THIS SOFTWARE IS PROVIDED BY GB DATA AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL GB DATA OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. - -# -# $Id: adduser,v 1.4 1994/12/28 17:27:21 gclarkii Exp $ -# - -$configfile = "\/etc\/adduser.conf"; - -if (-f $configfile) { - open (CONFIG, "$configfile"); - while (<CONFIG>) { - eval "$_"; - } -} - -open (WHOAMI, "whoami|"); - -while (<WHOAMI>) { -$whoami = $_; -} -chop $whoami; - -if ($whoami ne "root") { -system "clear"; -print "\n\nYou must be root to add an user\n\n"; -close WHOAMI; -exit; -} -close WHOAMI; - -# Start getting information and print a banner - -print " Adduser\n"; -print " A system utility for adding users with defaults\n"; -print "\n\n"; - -# -# User ID -# - - -print "Please enter the login name of the user: "; -chop ($userlogin = <STDIN>); - - -sub subuid { -$userid = ""; -print "Please enter the user id or hit enter for the next id: "; -chop ($userid = <STDIN>); -} - -while (!$userid) { -&subuid; -if (!$userid) { - if ($useautoids) { - open (USERID, "+<$userids"); - chop ($xxuserid = <USERID>); - $userid = $xxuserid + 1; - close USERID; - open (USERID, "+>$userids"); - print (USERID "$userid\n"); - close USERID; - } else { &subuid; } -} -} - -# -# Group ID -# - -sub groupids { -print "Please enter the group id or hit enter for the default id: "; -chop ($groupid = <STDIN>); -} - -&groupids; - -while (!$groupid) { - if ($defgroupid) { - if (!$groupid) { - $groupid = "$defgroupid"; - } else { &groupids; } - } else { &groupids; } -} - -# -# User name -# - -print "Please enter the user's name: "; -chop ($username = <STDIN>); - -# -# Home directory -# - -print "Please enter the users home directory or hit enter for default: "; -chop ($userdir = <STDIN>); - -if (!$userdir) { - $userdir = "$defusrdir\/$userlogin"; - print "$userdir\n"; -} - -# -# Login Shell -# - -print "Please enter the users login shell or hit enter for default: "; -chop ($usershell = <STDIN>); - -if (!$usershell) { - $usershell = "$userdefshell"; - print "$usershell\n"; -} - -# -# Create password file entry -# - -print "Opening and locking passwd file in blocking mode.\n"; -open (PASS, '>>/etc/master.passwd'); -flock (PASS, 2) || die "Can't lock passwd file, must be in use!!\n"; -print (PASS "$userlogin::$userid:$groupid::0:0:$username,,,:$userdir:$usershell\n"); -print "Unlocking and closing password file\n"; -flock (PASS,8); -close PASS; -print "Re-indexing password databases\n"; -system 'pwd_mkdb -p /etc/master.passwd'; -system "passwd $userlogin"; - -# -# Create user directory -# -print "Creating user directory\n"; -if (! -e $defusrdir) { - system "mkdir -p $defusrdir\/$userdir"; -} else { - system "mkdir $userdir"; -} - - -print "Copying user shell files\n"; -system "cp $skel_location\/dot.login $userdir\/\.login"; -system "cp $skel_location\/dot.profile $userdir\/\.profile"; - -if ($usershell eq "\/bin\/csh" || $usershell eq "\/usr\/local\/bin\/tcsh") - { - system "cp $skel_location\/dot.cshrc $userdir\/.cshrc"; - } -system "chmod -R 664 $userdir"; -system "chown -R $userid.$groupid $userdir"; - - - -# -# Print out information used in creation of this account -# -print "\n\n"; -print "Information used to create this account follows.\n"; -print "\n"; -print "Login Name: $userlogin\n"; -print "UserId: $userid\n"; -print "GroupId: $groupid\n"; -print "UserName: $username\n"; -print "HomeDir: $userdir\n"; -print "Shell: $usershell\n"; -print "\nDONE\n\n"; - diff --git a/usr.sbin/adduser/userids b/usr.sbin/adduser/userids deleted file mode 100644 index 3cda32fc2747..000000000000 --- a/usr.sbin/adduser/userids +++ /dev/null @@ -1 +0,0 @@ -515 diff --git a/usr.sbin/bootparamd/bootparamd/bootparam_prot.h b/usr.sbin/bootparamd/bootparamd/bootparam_prot.h deleted file mode 100644 index 66c72274a5fc..000000000000 --- a/usr.sbin/bootparamd/bootparamd/bootparam_prot.h +++ /dev/null @@ -1,81 +0,0 @@ -#include <rpc/types.h> -#include <sys/time.h> -#include <sys/errno.h> -#include <nfs/nfs.h> -#define MAX_MACHINE_NAME 255 -#define MAX_PATH_LEN 1024 -#define MAX_FILEID 32 -#define IP_ADDR_TYPE 1 - -typedef char *bp_machine_name_t; -bool_t xdr_bp_machine_name_t(); - - -typedef char *bp_path_t; -bool_t xdr_bp_path_t(); - - -typedef char *bp_fileid_t; -bool_t xdr_bp_fileid_t(); - - -struct ip_addr_t { - char net; - char host; - char lh; - char impno; -}; -typedef struct ip_addr_t ip_addr_t; -bool_t xdr_ip_addr_t(); - - -struct bp_address { - int address_type; - union { - ip_addr_t ip_addr; - } bp_address_u; -}; -typedef struct bp_address bp_address; -bool_t xdr_bp_address(); - - -struct bp_whoami_arg { - bp_address client_address; -}; -typedef struct bp_whoami_arg bp_whoami_arg; -bool_t xdr_bp_whoami_arg(); - - -struct bp_whoami_res { - bp_machine_name_t client_name; - bp_machine_name_t domain_name; - bp_address router_address; -}; -typedef struct bp_whoami_res bp_whoami_res; -bool_t xdr_bp_whoami_res(); - - -struct bp_getfile_arg { - bp_machine_name_t client_name; - bp_fileid_t file_id; -}; -typedef struct bp_getfile_arg bp_getfile_arg; -bool_t xdr_bp_getfile_arg(); - - -struct bp_getfile_res { - bp_machine_name_t server_name; - bp_address server_address; - bp_path_t server_path; -}; -typedef struct bp_getfile_res bp_getfile_res; -bool_t xdr_bp_getfile_res(); - - -#define BOOTPARAMPROG ((u_long)100026) -#define BOOTPARAMVERS ((u_long)1) -#define BOOTPARAMPROC_WHOAMI ((u_long)1) -extern bp_whoami_res *bootparamproc_whoami_1(); -#define BOOTPARAMPROC_GETFILE ((u_long)2) -extern bp_getfile_res *bootparamproc_getfile_1(); - diff --git a/usr.sbin/bootparamd/bootparamd/bootparam_prot.x b/usr.sbin/bootparamd/bootparamd/bootparam_prot.x deleted file mode 100644 index 6d3c3e79658c..000000000000 --- a/usr.sbin/bootparamd/bootparamd/bootparam_prot.x +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -/* - * RPC for bootparms service. - * There are two procedures: - * WHOAMI takes a net address and returns a client name and also a - * likely net address for routing - * GETFILE takes a client name and file identifier and returns the - * server name, server net address and pathname for the file. - * file identifiers typically include root, swap, pub and dump - */ - -#ifdef RPC_HDR -%#include <rpc/types.h> -%#include <sys/time.h> -%#include <sys/errno.h> -%#include <nfs/nfs.h> -#else -%#ifndef lint -%/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/ -%/*static char sccsid[] = "from: @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ -%static char rcsid[] = "$Id: bootparam_prot.x,v 1.1 1994/08/04 19:01:44 wollman Exp $"; -%#endif /* not lint */ -#endif - -const MAX_MACHINE_NAME = 255; -const MAX_PATH_LEN = 1024; -const MAX_FILEID = 32; -const IP_ADDR_TYPE = 1; - -typedef string bp_machine_name_t<MAX_MACHINE_NAME>; -typedef string bp_path_t<MAX_PATH_LEN>; -typedef string bp_fileid_t<MAX_FILEID>; - -struct ip_addr_t { - char net; - char host; - char lh; - char impno; -}; - -union bp_address switch (int address_type) { - case IP_ADDR_TYPE: - ip_addr_t ip_addr; -}; - -struct bp_whoami_arg { - bp_address client_address; -}; - -struct bp_whoami_res { - bp_machine_name_t client_name; - bp_machine_name_t domain_name; - bp_address router_address; -}; - -struct bp_getfile_arg { - bp_machine_name_t client_name; - bp_fileid_t file_id; -}; - -struct bp_getfile_res { - bp_machine_name_t server_name; - bp_address server_address; - bp_path_t server_path; -}; - -program BOOTPARAMPROG { - version BOOTPARAMVERS { - bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1; - bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2; - } = 1; -} = 100026; diff --git a/usr.sbin/bootparamd/bootparamd/bootparam_prot_xdr.c b/usr.sbin/bootparamd/bootparamd/bootparam_prot_xdr.c deleted file mode 100644 index 72fc2eefcdb8..000000000000 --- a/usr.sbin/bootparamd/bootparamd/bootparam_prot_xdr.c +++ /dev/null @@ -1,166 +0,0 @@ -#include <rpc/rpc.h> -#include "/a/wpaul/CVSWORK/src/usr.sbin/bootparamd/bootparamd/bootparam_prot.h" -#ifndef lint -/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/ -/*static char sccsid[] = "from: @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ -static char rcsid[] = "$Id: bootparam_prot.x,v 1.1 1994/08/04 19:01:44 wollman Exp $"; -#endif /* not lint */ - - -bool_t -xdr_bp_machine_name_t(xdrs, objp) - XDR *xdrs; - bp_machine_name_t *objp; -{ - if (!xdr_string(xdrs, objp, MAX_MACHINE_NAME)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_path_t(xdrs, objp) - XDR *xdrs; - bp_path_t *objp; -{ - if (!xdr_string(xdrs, objp, MAX_PATH_LEN)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_fileid_t(xdrs, objp) - XDR *xdrs; - bp_fileid_t *objp; -{ - if (!xdr_string(xdrs, objp, MAX_FILEID)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_ip_addr_t(xdrs, objp) - XDR *xdrs; - ip_addr_t *objp; -{ - if (!xdr_char(xdrs, &objp->net)) { - return (FALSE); - } - if (!xdr_char(xdrs, &objp->host)) { - return (FALSE); - } - if (!xdr_char(xdrs, &objp->lh)) { - return (FALSE); - } - if (!xdr_char(xdrs, &objp->impno)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_address(xdrs, objp) - XDR *xdrs; - bp_address *objp; -{ - if (!xdr_int(xdrs, &objp->address_type)) { - return (FALSE); - } - switch (objp->address_type) { - case IP_ADDR_TYPE: - if (!xdr_ip_addr_t(xdrs, &objp->bp_address_u.ip_addr)) { - return (FALSE); - } - break; - default: - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_whoami_arg(xdrs, objp) - XDR *xdrs; - bp_whoami_arg *objp; -{ - if (!xdr_bp_address(xdrs, &objp->client_address)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_whoami_res(xdrs, objp) - XDR *xdrs; - bp_whoami_res *objp; -{ - if (!xdr_bp_machine_name_t(xdrs, &objp->client_name)) { - return (FALSE); - } - if (!xdr_bp_machine_name_t(xdrs, &objp->domain_name)) { - return (FALSE); - } - if (!xdr_bp_address(xdrs, &objp->router_address)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_getfile_arg(xdrs, objp) - XDR *xdrs; - bp_getfile_arg *objp; -{ - if (!xdr_bp_machine_name_t(xdrs, &objp->client_name)) { - return (FALSE); - } - if (!xdr_bp_fileid_t(xdrs, &objp->file_id)) { - return (FALSE); - } - return (TRUE); -} - - - - -bool_t -xdr_bp_getfile_res(xdrs, objp) - XDR *xdrs; - bp_getfile_res *objp; -{ - if (!xdr_bp_machine_name_t(xdrs, &objp->server_name)) { - return (FALSE); - } - if (!xdr_bp_address(xdrs, &objp->server_address)) { - return (FALSE); - } - if (!xdr_bp_path_t(xdrs, &objp->server_path)) { - return (FALSE); - } - return (TRUE); -} - - diff --git a/usr.sbin/bootpd/Makefile b/usr.sbin/bootpd/Makefile deleted file mode 100644 index e661b6bb7852..000000000000 --- a/usr.sbin/bootpd/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# bootpd/Makefile -# $Id: Makefile,v 1.1.1.1 1994/09/10 14:44:53 csgr Exp $ - -PROG= bootpd -#CFLAGS+= -DETC_ETHERS -CFLAGS+= -DSYSLOG -DDEBUG -DVEND_CMU - - -SRCS= bootpd.c dovend.c readfile.c hash.c dumptab.c \ - lookup.c getif.c hwaddr.c report.c tzone.c rtmsg.c - -MAN5= bootptab.5 -MAN8= bootpd.8 - -.include <bsd.prog.mk> diff --git a/usr.sbin/bootpd/getether.c b/usr.sbin/bootpd/getether.c deleted file mode 100644 index 724a3767d3a7..000000000000 --- a/usr.sbin/bootpd/getether.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * getether.c : get the ethernet address of an interface - * - * All of this code is quite system-specific. As you may well - * guess, it took a good bit of detective work to figure out! - * - * If you figure out how to do this on another system, - * please let me know. <gwr@mc.com> - */ - -#include <sys/types.h> -#include <sys/socket.h> - -#include <ctype.h> -#include <syslog.h> - -#include "report.h" -#define EALEN 6 - -#if defined(ultrix) || (defined(__osf__) && defined(__alpha)) -/* - * This is really easy on Ultrix! Thanks to - * Harald Lundberg <hl@tekla.fi> for this code. - * - * The code here is not specific to the Alpha, but that was the - * only symbol we could find to identify DEC's version of OSF. - * (Perhaps we should just define DEC in the Makefile... -gwr) - */ - -#include <sys/ioctl.h> -#include <net/if.h> /* struct ifdevea */ - -getether(ifname, eap) - char *ifname, *eap; -{ - int rc = -1; - int fd; - struct ifdevea phys; - bzero(&phys, sizeof(phys)); - strcpy(phys.ifr_name, ifname); - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - report(LOG_ERR, "getether: socket(INET,DGRAM) failed"); - return -1; - } - if (ioctl(fd, SIOCRPHYSADDR, &phys) < 0) { - report(LOG_ERR, "getether: ioctl SIOCRPHYSADDR failed"); - } else { - bcopy(&phys.current_pa[0], eap, EALEN); - rc = 0; - } - close(fd); - return rc; -} - -#define GETETHER -#endif /* ultrix|osf1 */ - - -#ifdef SUNOS - -#include <sys/sockio.h> -#include <sys/time.h> /* needed by net_if.h */ -#include <net/nit_if.h> /* for NIOCBIND */ -#include <net/if.h> /* for struct ifreq */ - -getether(ifname, eap) - char *ifname; /* interface name from ifconfig structure */ - char *eap; /* Ether address (output) */ -{ - int rc = -1; - - struct ifreq ifrnit; - int nit; - - bzero((char *) &ifrnit, sizeof(ifrnit)); - strncpy(&ifrnit.ifr_name[0], ifname, IFNAMSIZ); - - nit = open("/dev/nit", 0); - if (nit < 0) { - report(LOG_ERR, "getether: open /dev/nit: %s", - get_errmsg()); - return rc; - } - do { - if (ioctl(nit, NIOCBIND, &ifrnit) < 0) { - report(LOG_ERR, "getether: NIOCBIND on nit"); - break; - } - if (ioctl(nit, SIOCGIFADDR, &ifrnit) < 0) { - report(LOG_ERR, "getether: SIOCGIFADDR on nit"); - break; - } - bcopy(&ifrnit.ifr_addr.sa_data[0], eap, EALEN); - rc = 0; - } while (0); - close(nit); - return rc; -} - -#define GETETHER -#endif /* SUNOS */ - - -#if defined(__FreeBSD__) || defined(__NetBSD__) -/* Thanks to John Brezak <brezak@ch.hp.com> for this code. */ -#include <sys/ioctl.h> -#include <net/if.h> -#include <net/if_dl.h> -#include <net/if_types.h> - -getether(ifname, eap) - char *ifname; /* interface name from ifconfig structure */ - char *eap; /* Ether address (output) */ -{ - int fd, rc = -1; - register int n; - struct ifreq ibuf[16], ifr; - struct ifconf ifc; - register struct ifreq *ifrp, *ifend; - - /* Fetch the interface configuration */ - fd = socket(AF_INET, SOCK_DGRAM, 0); - if (fd < 0) { - report(LOG_ERR, "getether: socket %s: %s", ifname, get_errmsg()); - return (fd); - } - ifc.ifc_len = sizeof(ibuf); - ifc.ifc_buf = (caddr_t) ibuf; - if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 || - ifc.ifc_len < sizeof(struct ifreq)) { - report(LOG_ERR, "getether: SIOCGIFCONF: %s", get_errmsg); - goto out; - } - /* Search interface configuration list for link layer address. */ - ifrp = ibuf; - ifend = (struct ifreq *) ((char *) ibuf + ifc.ifc_len); - while (ifrp < ifend) { - /* Look for interface */ - if (strcmp(ifname, ifrp->ifr_name) == 0 && - ifrp->ifr_addr.sa_family == AF_LINK && - ((struct sockaddr_dl *) &ifrp->ifr_addr)->sdl_type == IFT_ETHER) { - bcopy(LLADDR((struct sockaddr_dl *) &ifrp->ifr_addr), eap, EALEN); - rc = 0; - break; - } - /* Bump interface config pointer */ - n = ifrp->ifr_addr.sa_len + sizeof(ifrp->ifr_name); - if (n < sizeof(*ifrp)) - n = sizeof(*ifrp); - ifrp = (struct ifreq *) ((char *) ifrp + n); - } - - out: - close(fd); - return (rc); -} - -#define GETETHER -#endif /* __NetBSD__ */ - - -#ifdef SVR4 -/* - * This is for "Streams TCP/IP" by Lachman Associates. - * They sure made this cumbersome! -gwr - */ - -#include <sys/sockio.h> -#include <sys/dlpi.h> -#include <stropts.h> -#ifndef NULL -#define NULL 0 -#endif - -getether(ifname, eap) - char *ifname; /* interface name from ifconfig structure */ - char *eap; /* Ether address (output) */ -{ - int rc = -1; - char devname[32]; - char tmpbuf[sizeof(union DL_primitives) + 16]; - struct strbuf cbuf; - int fd, flags; - union DL_primitives *dlp; - char *enaddr; - int unit = -1; /* which unit to attach */ - - sprintf(devname, "/dev/%s", ifname); - fd = open(devname, 2); - if (fd < 0) { - /* Try without the trailing digit. */ - char *p = devname + 5; - while (isalpha(*p)) - p++; - if (isdigit(*p)) { - unit = *p - '0'; - *p = '\0'; - } - fd = open(devname, 2); - if (fd < 0) { - report(LOG_ERR, "getether: open %s: %s", - devname, get_errmsg()); - return rc; - } - } -#ifdef DL_ATTACH_REQ - /* - * If this is a "Style 2" DLPI, then we must "attach" first - * to tell the driver which unit (board, port) we want. - * For now, decide this based on the device name. - * (Should do "info_req" and check dl_provider_style ...) - */ - if (unit >= 0) { - memset(tmpbuf, 0, sizeof(tmpbuf)); - dlp = (union DL_primitives *) tmpbuf; - dlp->dl_primitive = DL_ATTACH_REQ; - dlp->attach_req.dl_ppa = unit; - cbuf.buf = tmpbuf; - cbuf.len = DL_ATTACH_REQ_SIZE; - if (putmsg(fd, &cbuf, NULL, 0) < 0) { - report(LOG_ERR, "getether: attach: putmsg: %s", get_errmsg()); - goto out; - } - /* Recv the ack. */ - cbuf.buf = tmpbuf; - cbuf.maxlen = sizeof(tmpbuf); - flags = 0; - if (getmsg(fd, &cbuf, NULL, &flags) < 0) { - report(LOG_ERR, "getether: attach: getmsg: %s", get_errmsg()); - goto out; - } - /* - * Check the type, etc. - */ - if (dlp->dl_primitive == DL_ERROR_ACK) { - report(LOG_ERR, "getether: attach: dlpi_errno=%d, unix_errno=%d", - dlp->error_ack.dl_errno, - dlp->error_ack.dl_unix_errno); - goto out; - } - if (dlp->dl_primitive != DL_OK_ACK) { - report(LOG_ERR, "getether: attach: not OK or ERROR"); - goto out; - } - } /* unit >= 0 */ -#endif /* DL_ATTACH_REQ */ - - /* - * Get the Ethernet address the same way the ARP module - * does when it is pushed onto a new stream (bind). - * One should instead be able just do an dl_info_req - * but many drivers do not supply the hardware address - * in the response to dl_info_req (they MUST supply it - * for dl_bind_ack because the ARP module requires it). - */ - memset(tmpbuf, 0, sizeof(tmpbuf)); - dlp = (union DL_primitives *) tmpbuf; - dlp->dl_primitive = DL_BIND_REQ; - dlp->bind_req.dl_sap = 0x8FF; /* XXX - Unused SAP */ - cbuf.buf = tmpbuf; - cbuf.len = DL_BIND_REQ_SIZE; - if (putmsg(fd, &cbuf, NULL, 0) < 0) { - report(LOG_ERR, "getether: bind: putmsg: %s", get_errmsg()); - goto out; - } - /* Recv the ack. */ - cbuf.buf = tmpbuf; - cbuf.maxlen = sizeof(tmpbuf); - flags = 0; - if (getmsg(fd, &cbuf, NULL, &flags) < 0) { - report(LOG_ERR, "getether: bind: getmsg: %s", get_errmsg()); - goto out; - } - /* - * Check the type, etc. - */ - if (dlp->dl_primitive == DL_ERROR_ACK) { - report(LOG_ERR, "getether: bind: dlpi_errno=%d, unix_errno=%d", - dlp->error_ack.dl_errno, - dlp->error_ack.dl_unix_errno); - goto out; - } - if (dlp->dl_primitive != DL_BIND_ACK) { - report(LOG_ERR, "getether: bind: not OK or ERROR"); - goto out; - } - if (dlp->bind_ack.dl_addr_offset == 0) { - report(LOG_ERR, "getether: bind: ack has no address"); - goto out; - } - if (dlp->bind_ack.dl_addr_length < EALEN) { - report(LOG_ERR, "getether: bind: ack address truncated"); - goto out; - } - /* - * Copy the Ethernet address out of the message. - */ - enaddr = tmpbuf + dlp->bind_ack.dl_addr_offset; - memcpy(eap, enaddr, EALEN); - rc = 0; - - out: - close(fd); - return rc; -} - -#define GETETHER -#endif /* SVR4 */ - - -#ifdef linux -/* - * This is really easy on Linux! This version (for linux) - * written by Nigel Metheringham <nigelm@ohm.york.ac.uk> - * - * The code is almost identical to the Ultrix code - however - * the names are different to confuse the innocent :-) - * Most of this code was stolen from the Ultrix bit above. - */ - -#include <sys/ioctl.h> -#include <net/if.h> /* struct ifreq */ - -/* In a properly configured system this should be either sys/socketio.h - or sys/sockios.h, but on my distribution these don't line up correctly */ -#include <linux/sockios.h> /* Needed for IOCTL defs */ - -getether(ifname, eap) - char *ifname, *eap; -{ - int rc = -1; - int fd; - struct ifreq phys; - bzero(&phys, sizeof(phys)); - strcpy(phys.ifr_name, ifname); - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { - report(LOG_ERR, "getether: socket(INET,DGRAM) failed"); - return -1; - } - if (ioctl(fd, SIOCGIFHWADDR, &phys) < 0) { - report(LOG_ERR, "getether: ioctl SIOCGIFHWADDR failed"); - } else { - bcopy(phys.ifr_hwaddr, eap, EALEN); - rc = 0; - } - close(fd); - return rc; -} - -#define GETETHER -#endif /* linux */ - - -/* If we don't know how on this system, just return an error. */ -#ifndef GETETHER -getether(ifname, eap) - char *ifname, *eap; -{ - return -1; -} - -#endif /* !GETETHER */ - -/* - * Local Variables: - * tab-width: 4 - * c-indent-level: 4 - * c-argdecl-indent: 4 - * c-continued-statement-offset: 4 - * c-continued-brace-offset: -4 - * c-label-offset: -4 - * c-brace-offset: 0 - * End: - */ diff --git a/usr.sbin/bootpd/hwaddr.c b/usr.sbin/bootpd/hwaddr.c deleted file mode 100644 index 840b95333567..000000000000 --- a/usr.sbin/bootpd/hwaddr.c +++ /dev/null @@ -1,294 +0,0 @@ -/* - * hwaddr.c - routines that deal with hardware addresses. - * (i.e. Ethernet) - */ - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/socket.h> -#include <sys/ioctl.h> - -#if defined(SUNOS) || defined(SVR4) -#include <sys/sockio.h> -#endif -#ifdef SVR4 -#include <sys/stream.h> -#include <stropts.h> -#include <fcntl.h> -#endif - -#include <net/if_arp.h> -#include <netinet/in.h> -#include <stdio.h> -#ifndef NO_UNISTD -#include <unistd.h> -#endif -#include <syslog.h> - -#ifndef USE_BFUNCS -/* Yes, memcpy is OK here (no overlapped copies). */ -#include <memory.h> -#define bcopy(a,b,c) memcpy(b,a,c) -#define bzero(p,l) memset(p,0,l) -#define bcmp(a,b,c) memcmp(a,b,c) -#endif - -/* For BSD 4.4, set arp entry by writing to routing socket */ -#if defined(BSD) -#if BSD >= 199306 -extern int bsd_arp_set __P((struct in_addr *, char *, int)); -#endif -#endif - -#include "bptypes.h" -#include "hwaddr.h" -#include "report.h" - -extern int debug; - -/* - * Hardware address lengths (in bytes) and network name based on hardware - * type code. List in order specified by Assigned Numbers RFC; Array index - * is hardware type code. Entries marked as zero are unknown to the author - * at this time. . . . - */ - -struct hwinfo hwinfolist[] = -{ - {0, "Reserved"}, /* Type 0: Reserved (don't use this) */ - {6, "Ethernet"}, /* Type 1: 10Mb Ethernet (48 bits) */ - {1, "3Mb Ethernet"}, /* Type 2: 3Mb Ethernet (8 bits) */ - {0, "AX.25"}, /* Type 3: Amateur Radio AX.25 */ - {1, "ProNET"}, /* Type 4: Proteon ProNET Token Ring */ - {0, "Chaos"}, /* Type 5: Chaos */ - {6, "IEEE 802"}, /* Type 6: IEEE 802 Networks */ - {0, "ARCNET"} /* Type 7: ARCNET */ -}; -int hwinfocnt = sizeof(hwinfolist) / sizeof(hwinfolist[0]); - - -/* - * Setup the arp cache so that IP address 'ia' will be temporarily - * bound to hardware address 'ha' of length 'len'. - */ -void -setarp(s, ia, ha, len) - int s; /* socket fd */ - struct in_addr *ia; - u_char *ha; - int len; -{ -#ifdef SIOCSARP - struct arpreq arpreq; /* Arp request ioctl block */ - struct sockaddr_in *si; -#ifdef SVR4 - int fd; - struct strioctl iocb; -#endif /* SVR4 */ - - bzero((caddr_t) & arpreq, sizeof(arpreq)); - arpreq.arp_flags = ATF_INUSE | ATF_COM; - - /* Set up the protocol address. */ - arpreq.arp_pa.sa_family = AF_INET; - si = (struct sockaddr_in *) &arpreq.arp_pa; - si->sin_addr = *ia; - - /* Set up the hardware address. */ - bcopy(ha, arpreq.arp_ha.sa_data, len); - -#ifdef SVR4 - /* - * And now the stuff for System V Rel 4.x which does not - * appear to allow SIOCxxx ioctls on a socket descriptor. - * Thanks to several people: (all sent the same fix) - * Barney Wolff <barney@databus.com>, - * bear@upsys.se (Bj|rn Sj|holm), - * Michael Kuschke <Michael.Kuschke@Materna.DE>, - */ - if ((fd=open("/dev/arp", O_RDWR)) < 0) { - report(LOG_ERR, "open /dev/arp: %s\n", get_errmsg()); - } - iocb.ic_cmd = SIOCSARP; - iocb.ic_timout = 0; - iocb.ic_dp = (char *)&arpreq; - iocb.ic_len = sizeof(arpreq); - if (ioctl(fd, I_STR, (caddr_t)&iocb) < 0) { - report(LOG_ERR, "ioctl I_STR: %s\n", get_errmsg()); - } - close (fd); - -#else /* SVR4 */ - /* - * On SunOS, the ioctl sometimes returns ENXIO, and it - * appears to happen when the ARP cache entry you tried - * to add is already in the cache. (Sigh...) - * XXX - Should this error simply be ignored? -gwr - */ - if (ioctl(s, SIOCSARP, (caddr_t) & arpreq) < 0) { - report(LOG_ERR, "ioctl SIOCSARP: %s", get_errmsg()); - } -#endif /* SVR4 */ -#else /* SIOCSARP */ -#if defined(BSD) && (BSD >= 199306) - bsd_arp_set(ia, ha, len); -#else /* Not BSD 4.4, and SIOCSARP not defined */ - /* - * Oh well, SIOCSARP is not defined. Just run arp(8). - * XXX - Gag! - */ - char buf[256]; - int status; - - sprintf(buf, "arp -s %s %s temp", - inet_ntoa(*ia), haddrtoa(ha, len)); - if (debug > 2) - report(LOG_INFO, buf); - status = system(buf); - if (status) - report(LOG_ERR, "arp failed, exit code=0x%x", status); - return; -#endif /* ! 4.4 BSD */ -#endif /* SIOCSARP */ -} - - -/* - * Convert a hardware address to an ASCII string. - */ -char * -haddrtoa(haddr, hlen) - u_char *haddr; - int hlen; -{ - static char haddrbuf[3 * MAXHADDRLEN + 1]; - char *bufptr; - - if (hlen > MAXHADDRLEN) - hlen = MAXHADDRLEN; - - bufptr = haddrbuf; - while (hlen > 0) { - sprintf(bufptr, "%02X:", (unsigned) (*haddr++ & 0xFF)); - bufptr += 3; - hlen--; - } - bufptr[-1] = 0; - return (haddrbuf); -} - - -/* - * haddr_conv802() - * -------------- - * - * Converts a backwards address to a canonical address and a canonical address - * to a backwards address. - * - * INPUTS: - * adr_in - pointer to six byte string to convert (unsigned char *) - * addr_len - how many bytes to convert - * - * OUTPUTS: - * addr_out - The string is updated to contain the converted address. - * - * CALLER: - * many - * - * DATA: - * Uses conv802table to bit-reverse the address bytes. - */ - -static u_char conv802table[256] = -{ - /* 0x00 */ 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, - /* 0x08 */ 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - /* 0x10 */ 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, - /* 0x18 */ 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - /* 0x20 */ 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, - /* 0x28 */ 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - /* 0x30 */ 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, - /* 0x38 */ 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - /* 0x40 */ 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, - /* 0x48 */ 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - /* 0x50 */ 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, - /* 0x58 */ 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - /* 0x60 */ 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, - /* 0x68 */ 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - /* 0x70 */ 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, - /* 0x78 */ 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - /* 0x80 */ 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, - /* 0x88 */ 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - /* 0x90 */ 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, - /* 0x98 */ 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - /* 0xA0 */ 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, - /* 0xA8 */ 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - /* 0xB0 */ 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, - /* 0xB8 */ 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - /* 0xC0 */ 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, - /* 0xC8 */ 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - /* 0xD0 */ 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, - /* 0xD8 */ 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - /* 0xE0 */ 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, - /* 0xE8 */ 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - /* 0xF0 */ 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, - /* 0xF8 */ 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF, -}; - -void -haddr_conv802(addr_in, addr_out, len) - register u_char *addr_in, *addr_out; - int len; -{ - u_char *lim; - - lim = addr_out + len; - while (addr_out < lim) - *addr_out++ = conv802table[*addr_in++]; -} - -#if 0 -/* - * For the record, here is a program to generate the - * bit-reverse table above. - */ -static int -bitrev(n) - int n; -{ - int i, r; - - r = 0; - for (i = 0; i < 8; i++) { - r <<= 1; - r |= (n & 1); - n >>= 1; - } - return r; -} - -main() -{ - int i; - for (i = 0; i <= 0xFF; i++) { - if ((i & 7) == 0) - printf("/* 0x%02X */", i); - printf(" 0x%02X,", bitrev(i)); - if ((i & 7) == 7) - printf("\n"); - } -} - -#endif - -/* - * Local Variables: - * tab-width: 4 - * c-indent-level: 4 - * c-argdecl-indent: 4 - * c-continued-statement-offset: 4 - * c-continued-brace-offset: -4 - * c-label-offset: -4 - * c-brace-offset: 0 - * End: - */ diff --git a/usr.sbin/bootpd/rtmsg.c b/usr.sbin/bootpd/rtmsg.c deleted file mode 100644 index 6de610271f48..000000000000 --- a/usr.sbin/bootpd/rtmsg.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 1984, 1993 - * The Regents of the University of California. All rights reserved. - * Copyright (c) 1994 - * Geoffrey M. Rehmet, All rights reserved. - * - * This code is derived from software which forms part of the 4.4-Lite - * Berkeley software distribution, which was in derived from software - * contributed to Berkeley by Sun Microsystems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* - * from arp.c 8.2 (Berkeley) 1/2/94 - * $Id$ - */ - -#include <sys/param.h> -/* - * Verify that we are at least 4.4 BSD - */ -#if defined(BSD) -#if BSD >= 199306 - -#include <sys/socket.h> - -#include <net/if.h> -#include <net/if_dl.h> -#include <net/if_types.h> -#include <net/route.h> - -#include <netinet/in.h> -#include <netinet/if_ether.h> - -#include <arpa/inet.h> - -#include <errno.h> -#include <stdio.h> -#include <string.h> -#include <syslog.h> -#include <unistd.h> - -#include "report.h" - - -static int rtmsg __P((int)); - -static int s = -1; /* routing socket */ - - -/* - * Open the routing socket - */ -static void getsocket () { - if (s < 0) { - s = socket(PF_ROUTE, SOCK_RAW, 0); - if (s < 0) { - report(LOG_ERR, "socket %s", strerror(errno)); - exit(1); - } - } -} - -static struct sockaddr_in so_mask = {8, 0, 0, { 0xffffffff}}; -static struct sockaddr_inarp blank_sin = {sizeof(blank_sin), AF_INET }, sin_m; -static struct sockaddr_dl blank_sdl = {sizeof(blank_sdl), AF_LINK }, sdl_m; -static int expire_time, flags, export_only, doing_proxy; -static struct { - struct rt_msghdr m_rtm; - char m_space[512]; -} m_rtmsg; - -/* - * Set an individual arp entry - */ -int bsd_arp_set(ia, eaddr, len) - struct in_addr *ia; - char *eaddr; - int len; -{ - register struct sockaddr_inarp *sin = &sin_m; - register struct sockaddr_dl *sdl; - register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); - u_char *ea; - struct timeval time; - - getsocket(); - sdl_m = blank_sdl; - sin_m = blank_sin; - sin->sin_addr = *ia; - - ea = (u_char *)LLADDR(&sdl_m); - bcopy(eaddr, ea, len); - sdl_m.sdl_alen = len; - doing_proxy = flags = export_only = expire_time = 0; - - /* make arp entry temporary */ - gettimeofday(&time, 0); - expire_time = time.tv_sec + 20 * 60; - -tryagain: - if (rtmsg(RTM_GET) < 0) { - report(LOG_WARNING, "rtmget: %s", strerror(errno)); - return (1); - } - sin = (struct sockaddr_inarp *)(rtm + 1); - sdl = (struct sockaddr_dl *)(sin->sin_len + (char *)sin); - if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) { - if (sdl->sdl_family == AF_LINK && - (rtm->rtm_flags & RTF_LLINFO) && - !(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) { - case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: - case IFT_ISO88024: case IFT_ISO88025: - goto overwrite; - } - if (doing_proxy == 0) { - report(LOG_WARNING, "set: can only proxy for %s\n", - inet_ntoa(sin->sin_addr)); - return (1); - } - if (sin_m.sin_other & SIN_PROXY) { - report(LOG_WARNING, - "set: proxy entry exists for non 802 device\n"); - return(1); - } - sin_m.sin_other = SIN_PROXY; - export_only = 1; - goto tryagain; - } -overwrite: - if (sdl->sdl_family != AF_LINK) { - report(LOG_WARNING, - "cannot intuit interface index and type for %s\n", - inet_ntoa(sin->sin_addr)); - return (1); - } - sdl_m.sdl_type = sdl->sdl_type; - sdl_m.sdl_index = sdl->sdl_index; - return (rtmsg(RTM_ADD)); -} - - -static int rtmsg(cmd) - int cmd; -{ - static int seq; - int rlen; - register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; - register char *cp = m_rtmsg.m_space; - register int l; - - errno = 0; - bzero((char *)&m_rtmsg, sizeof(m_rtmsg)); - rtm->rtm_flags = flags; - rtm->rtm_version = RTM_VERSION; - - switch (cmd) { - default: - report(LOG_ERR, "set_arp: internal wrong cmd - exiting"); - exit(1); - case RTM_ADD: - rtm->rtm_addrs |= RTA_GATEWAY; - rtm->rtm_rmx.rmx_expire = expire_time; - rtm->rtm_inits = RTV_EXPIRE; - rtm->rtm_flags |= (RTF_HOST | RTF_STATIC); - sin_m.sin_other = 0; - if (doing_proxy) { - if (export_only) - sin_m.sin_other = SIN_PROXY; - else { - rtm->rtm_addrs |= RTA_NETMASK; - rtm->rtm_flags &= ~RTF_HOST; - } - } - /* FALLTHROUGH */ - case RTM_GET: - rtm->rtm_addrs |= RTA_DST; - } -#define NEXTADDR(w, s) \ - if (rtm->rtm_addrs & (w)) { \ - bcopy((char *)&s, cp, sizeof(s)); cp += sizeof(s);} - - NEXTADDR(RTA_DST, sin_m); - NEXTADDR(RTA_GATEWAY, sdl_m); - NEXTADDR(RTA_NETMASK, so_mask); - - rtm->rtm_msglen = cp - (char *)&m_rtmsg; - - l = rtm->rtm_msglen; - rtm->rtm_seq = ++seq; - rtm->rtm_type = cmd; - if ((rlen = write(s, (char *)&m_rtmsg, l)) < 0) { - if ((errno != ESRCH) && !(errno == EEXIST && cmd == RTM_ADD)){ - report(LOG_WARNING, "writing to routing socket: %s", - strerror(errno)); - return (-1); - } - } - do { - l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != getpid())); - if (l < 0) - report(LOG_WARNING, "arp: read from routing socket: %s\n", - strerror(errno)); - return (0); -} - -#endif /* BSD */ -#endif /* BSD >= 199306 */ diff --git a/usr.sbin/bootpef/Makefile b/usr.sbin/bootpef/Makefile deleted file mode 100644 index 4abb5f13150b..000000000000 --- a/usr.sbin/bootpef/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# bootpef/Makefile -# $Id: Makefile,v 1.2 1994/09/10 15:00:04 csgr Exp $ - -PROG= bootpef -SRCDIR= ${.CURDIR}/../bootpd -#CFLAGS+= -DETC_ETHERS -CFLAGS+= -DDEBUG -I${SRCDIR} -.PATH: ${SRCDIR} -MANSRC= ${SRCDIR} - -SRCS= bootpef.c dovend.c readfile.c hash.c dumptab.c \ - lookup.c hwaddr.c report.c rtmsg.c tzone.c - -MAN8= bootpef.8 - -.include <bsd.prog.mk> - diff --git a/usr.sbin/bootpgw/Makefile b/usr.sbin/bootpgw/Makefile deleted file mode 100644 index 6be63f68f546..000000000000 --- a/usr.sbin/bootpgw/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# bootpgw/Makefile -# $Id: Makefile,v 1.1.1.1 1994/09/10 14:44:56 csgr Exp $ - -PROG= bootpgw -SRCDIR= ${.CURDIR}/../bootpd -CFLAGS+= -DSYSLOG -DDEBUG -I${SRCDIR} -.PATH: ${SRCDIR} - -SRCS= bootpgw.c getif.c hwaddr.c report.c rtmsg.c - -MAN8= - -.include <bsd.prog.mk> - diff --git a/usr.sbin/bootptest/Makefile b/usr.sbin/bootptest/Makefile deleted file mode 100644 index 35e98679e3fd..000000000000 --- a/usr.sbin/bootptest/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# bootptest/Makefile -# $Id: Makefile,v 1.3 1994/08/22 22:19:04 gwr Exp $ - -PROG= bootptest -SRCDIR= ${.CURDIR}/../bootpd -CFLAGS+= -I${SRCDIR} -.PATH: ${SRCDIR} -MANSRC= ${SRCDIR} - -SRCS= bootptest.c print-bootp.c getif.c getether.c report.c - -MAN8= bootptest.8 - -.include <bsd.prog.mk> - diff --git a/usr.sbin/cron/cron/bitstring.3 b/usr.sbin/cron/cron/bitstring.3 deleted file mode 100644 index efe9ae3c116e..000000000000 --- a/usr.sbin/cron/cron/bitstring.3 +++ /dev/null @@ -1,168 +0,0 @@ -.\" Copyright (c) 1989 The Regents of the University of California. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" Paul Vixie. -.\" -.\" Redistribution and use in source and binary forms are permitted -.\" provided that the above copyright notice and this paragraph are -.\" duplicated in all such forms and that any documentation, -.\" advertising materials, and other materials related to such -.\" distribution and use acknowledge that the software was developed -.\" by the University of California, Berkeley. The name of the -.\" University may not be used to endorse or promote products derived -.\" from this software without specific prior written permission. -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -.\" -.\" @(#)bitstring.3 5.1 (Berkeley) 12/13/89 -.\" -.TH BITSTRING 3 "December 13, 1989" -.UC 4 -.SH NAME -bit_alloc, bit_clear, bit_decl, bit_ffs, bit_nclear, bit_nset, -bit_set, bitstr_size, bit_test \- bit-string manipulation macros -.SH SYNOPSIS -.ft B -.nf -#include <bitstring.h> - -name = bit_alloc(nbits) -bitstr_t *name; -int nbits; - -bit_decl(name, nbits) -bitstr_t name; -int nbits; - -bit_clear(name, bit) -bitstr_t name; -int bit; - -bit_ffc(name, nbits, value) -bitstr_t name; -int nbits, *value; - -bit_ffs(name, nbits, value) -bitstr_t name; -int nbits, *value; - -bit_nclear(name, start, stop) -bitstr_t name; -int start, stop; - -bit_nset(name, start, stop) -bitstr_t name; -int start, stop; - -bit_set(name, bit) -bitstr_t name; -int bit; - -bitstr_size(nbits) -int nbits; - -bit_test(name, bit) -bitstr_t name; -int bit; -.fi -.ft R -.SH DESCRIPTION -These macros operate on strings of bits. -.PP -.I Bit_alloc -returns a pointer of type -.I bitstr_t\ * -to sufficient space to store -.I nbits -bits, or NULL if no space is available. -.PP -.I Bit_decl -is a macro for allocating sufficient space to store -.I nbits -bits on the stack. -.PP -.I Bitstr_size -returns the number of elements of type -.I bitstr_t -necessary to store -.I nbits -bits. -This is useful for copying bit strings. -.PP -.I Bit_clear -and -.I bit_set -clear or set the zero-based numbered bit -.IR bit , -in the bit string -.IR name . -.PP -.I Bit_nset -and -.I bit_nclear -set or clear the zero-based numbered bits from -.I start -to -.I stop -in the bit string -.IR name . -.PP -.I Bit_test -evaluates to zero if the zero-based numbered bit -.I bit -of bit string -.I name -is set, and non-zero otherwise. -.PP -.I Bit_ffs -sets -.I *value -to the zero-based number of the first bit set in the array of -.I nbits -bits referenced by -.IR name . -If no bits are set, -.I *value -is set to -1. -.PP -.I Bit_ffc -sets -.I *value -to the zero-based number of the first bit not set in the array of -.I nbits -bits referenced by -.IR name . -If all bits are set, -.I value -is set to -1. -.SH EXAMPLE -.nf -.in +5 -#include <limits.h> -#include <bitstring.h> - -... -#define LPR_BUSY_BIT 0 -#define LPR_FORMAT_BIT 1 -#define LPR_DOWNLOAD_BIT 2 -... -#define LPR_AVAILABLE_BIT 9 -#define LPR_MAX_BITS 10 - -make_lpr_available() -{ - bitstr_t bit_decl(bitlist, LPR_MAX_BITS); - ... - bit_nclear(bitlist, 0, LPR_MAX_BITS - 1); - ... - if (!bit_test(bitlist, LPR_BUSY_BIT)) { - bit_clear(bitlist, LPR_FORMAT_BIT); - bit_clear(bitlist, LPR_DOWNLOAD_BIT); - bit_set(bitlist, LPR_AVAILABLE_BIT); - } -} -.fi -.SH "SEE ALSO" -malloc(3) diff --git a/usr.sbin/cron/cron/bitstring.h b/usr.sbin/cron/cron/bitstring.h deleted file mode 100644 index d054de3c51c1..000000000000 --- a/usr.sbin/cron/cron/bitstring.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Paul Vixie. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)bitstring.h 5.2 (Berkeley) 4/4/90 - */ - -typedef unsigned char bitstr_t; - -/* internal macros */ - /* byte of the bitstring bit is in */ -#define _bit_byte(bit) \ - ((bit) >> 3) - - /* mask for the bit within its byte */ -#define _bit_mask(bit) \ - (1 << ((bit)&0x7)) - -/* external macros */ - /* bytes in a bitstring of nbits bits */ -#define bitstr_size(nbits) \ - ((((nbits) - 1) >> 3) + 1) - - /* allocate a bitstring */ -#define bit_alloc(nbits) \ - (bitstr_t *)malloc(1, \ - (unsigned int)bitstr_size(nbits) * sizeof(bitstr_t)) - - /* allocate a bitstring on the stack */ -#define bit_decl(name, nbits) \ - (name)[bitstr_size(nbits)] - - /* is bit N of bitstring name set? */ -#define bit_test(name, bit) \ - ((name)[_bit_byte(bit)] & _bit_mask(bit)) - - /* set bit N of bitstring name */ -#define bit_set(name, bit) \ - (name)[_bit_byte(bit)] |= _bit_mask(bit) - - /* clear bit N of bitstring name */ -#define bit_clear(name, bit) \ - (name)[_bit_byte(bit)] &= ~_bit_mask(bit) - - /* clear bits start ... stop in bitstring */ -#define bit_nclear(name, start, stop) { \ - register bitstr_t *_name = name; \ - register int _start = start, _stop = stop; \ - register int _startbyte = _bit_byte(_start); \ - register int _stopbyte = _bit_byte(_stop); \ - if (_startbyte == _stopbyte) { \ - _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \ - (0xff << ((_stop&0x7) + 1))); \ - } else { \ - _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \ - while (++_startbyte < _stopbyte) \ - _name[_startbyte] = 0; \ - _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \ - } \ -} - - /* set bits start ... stop in bitstring */ -#define bit_nset(name, start, stop) { \ - register bitstr_t *_name = name; \ - register int _start = start, _stop = stop; \ - register int _startbyte = _bit_byte(_start); \ - register int _stopbyte = _bit_byte(_stop); \ - if (_startbyte == _stopbyte) { \ - _name[_startbyte] |= ((0xff << (_start&0x7)) & \ - (0xff >> (7 - (_stop&0x7)))); \ - } else { \ - _name[_startbyte] |= 0xff << ((_start)&0x7); \ - while (++_startbyte < _stopbyte) \ - _name[_startbyte] = 0xff; \ - _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \ - } \ -} - - /* find first bit clear in name */ -#define bit_ffc(name, nbits, value) { \ - register bitstr_t *_name = name; \ - register int _byte, _nbits = nbits; \ - register int _stopbyte = _bit_byte(_nbits), _value = -1; \ - for (_byte = 0; _byte <= _stopbyte; ++_byte) \ - if (_name[_byte] != 0xff) { \ - _value = _byte << 3; \ - for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \ - ++_value, _stopbyte >>= 1); \ - break; \ - } \ - *(value) = _value; \ -} - - /* find first bit set in name */ -#define bit_ffs(name, nbits, value) { \ - register bitstr_t *_name = name; \ - register int _byte, _nbits = nbits; \ - register int _stopbyte = _bit_byte(_nbits), _value = -1; \ - for (_byte = 0; _byte <= _stopbyte; ++_byte) \ - if (_name[_byte]) { \ - _value = _byte << 3; \ - for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \ - ++_value, _stopbyte >>= 1); \ - break; \ - } \ - *(value) = _value; \ -} diff --git a/usr.sbin/cron/cron/putman.sh b/usr.sbin/cron/cron/putman.sh deleted file mode 100644 index 4aef625c6174..000000000000 --- a/usr.sbin/cron/cron/putman.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# putman.sh - install a man page according to local custom -# vixie 27dec93 [original] -# -# $Id:$ - -PAGE=$1 -DIR=$2 - -SECT=`expr $PAGE : '[a-z]*.\([0-9]\)'` - -[ -d $DIR/man$SECT ] && { - set -x - cp $PAGE $DIR/man$SECT/$PAGE - set +x -} || { - set -x - nroff -man $PAGE >$DIR/cat$SECT/`basename $PAGE .$SECT`.0 - set +x -} - -exit 0 diff --git a/usr.sbin/crunch/crunchgen/crunched_skel.c b/usr.sbin/crunch/crunchgen/crunched_skel.c deleted file mode 100644 index d605d6ca85e3..000000000000 --- a/usr.sbin/crunch/crunchgen/crunched_skel.c +++ /dev/null @@ -1,107 +0,0 @@ -/* File created via mkskel.sh */ - -char *crunched_skel[] = { - "/*", - " * Copyright (c) 1994 University of Maryland", - " * All Rights Reserved.", - " *", - " * Permission to use, copy, modify, distribute, and sell this software and its", - " * documentation for any purpose is hereby granted without fee, provided that", - " * the above copyright notice appear in all copies and that both that", - " * copyright notice and this permission notice appear in supporting", - " * documentation, and that the name of U.M. not be used in advertising or", - " * publicity pertaining to distribution of the software without specific,", - " * written prior permission. U.M. makes no representations about the", - " * suitability of this software for any purpose. It is provided \"as is\"", - " * without express or implied warranty.", - " *", - " * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL", - " * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.", - " * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES", - " * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION", - " * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN", - " * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.", - " *", - " * Author: James da Silva, Systems Design and Analysis Group", - " * Computer Science Department", - " * University of Maryland at College Park", - " */", - "/*", - " * crunched_main.c - main program for crunched binaries, it branches to a ", - " * particular subprogram based on the value of argv[0]. Also included", - " * is a little program invoked when the crunched binary is called via", - " * its EXECNAME. This one prints out the list of compiled-in binaries,", - " * or calls one of them based on argv[1]. This allows the testing of", - " * the crunched binary without creating all the links.", - " */", - "#include <stdio.h>", - "#include <string.h>", - "", - "struct stub {", - " char *name;", - " int (*f)();", - "};", - "", - "extern struct stub entry_points[];", - "", - "int main(int argc, char **argv)", - "{", - " char *slash, *basename;", - " struct stub *ep;", - "", - " if(argv[0] == NULL || *argv[0] == '\\0')", - " crunched_usage();", - "", - " slash = strrchr(argv[0], '/');", - " basename = slash? slash+1 : argv[0];", - "", - " for(ep=entry_points; ep->name != NULL; ep++)", - " if(!strcmp(basename, ep->name)) break;", - "", - " if(ep->name)", - " return ep->f(argc, argv);", - " else {", - " fprintf(stderr, \"%s: %s not compiled in\\n\", EXECNAME, basename);", - " crunched_usage();", - " }", - "}", - "", - "", - "int crunched_main(int argc, char **argv)", - "{", - " struct stub *ep;", - " int columns, len;", - "", - " if(argc <= 1) ", - " crunched_usage();", - "", - " return main(--argc, ++argv);", - "}", - "", - "", - "int crunched_usage()", - "{", - " int columns, len;", - " struct stub *ep;", - "", - " fprintf(stderr, \"Usage: %s <prog> <args> ..., where <prog> is one of:\\n\",", - " EXECNAME);", - " columns = 0;", - " for(ep=entry_points; ep->name != NULL; ep++) {", - " len = strlen(ep->name) + 1;", - " if(columns+len < 80)", - " columns += len;", - " else {", - " fprintf(stderr, \"\\n\");", - " columns = len;", - " }", - " fprintf(stderr, \" %s\", ep->name);", - " }", - " fprintf(stderr, \"\\n\");", - " exit(1);", - "}", - "", - "/* end of crunched_main.c */", - "", - 0 -}; diff --git a/usr.sbin/dbsym/Makefile b/usr.sbin/dbsym/Makefile deleted file mode 100644 index e1fbf2c2cc8f..000000000000 --- a/usr.sbin/dbsym/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# $Id$ - -PROG= dbsym -NOMAN= noman - -.include <bsd.prog.mk> diff --git a/usr.sbin/dbsym/dbsym.c b/usr.sbin/dbsym/dbsym.c deleted file mode 100644 index 833627c7c0bd..000000000000 --- a/usr.sbin/dbsym/dbsym.c +++ /dev/null @@ -1,255 +0,0 @@ -/* Written by Pace Willisson (pace@blitz.com) - * and placed in the public domain. - */ - -#ifndef lint -static char rcsid[] = "$Id: dbsym.c,v 1.3 1994/01/19 03:52:25 nate Exp $"; -#endif /* not lint */ - -#include <stdio.h> -#include <stdlib.h> -#include <a.out.h> -#include <stab.h> -#include <machine/param.h> -#include <vm/vm_param.h> -#include <vm/lock.h> -#include <vm/pmap.h> -#include <machine/pmap.h> -#include <machine/vmparam.h> - -#define FILE_OFFSET(vadr) (((vadr) - text_adr) - N_DATADDR(hdr) + \ - N_DATOFF(hdr) + N_TXTADDR(hdr)) - -u_int text_adr = KERNBASE; - -struct nlist *old_syms; -int num_old_syms; -char *old_strtab; -int old_strtab_size; - -struct nlist *new_syms; -int num_new_syms; -int new_syms_bytes; -char *new_strtab; -int new_strtab_size; - -int db_symtabsize_adr; -int db_symtab_adr; - -int avail; - -int force = 0; -int zap_locals = 0; -int debugging = 0; - -usage () -{ - fprintf (stderr, "usage: dbsym [-fgx] [-T addr] file\n"); - exit (1); -} - -struct exec hdr; - -main (argc, argv) -char **argv; -{ - FILE *f; - char *name; - extern int optind; - int c, i; - int need; - char *buf, *p; - struct nlist *nsp, *sp; - int len; - - - while ((c = getopt (argc, argv, "fgxT:")) != EOF) { - switch (c) { - case 'f': - force = 1; - break; - case 'g': - debugging = 1; - break; - case 'x': - zap_locals = 1; - break; - case 'T': - text_adr = strtoul(optarg, &p, 16); - if (*p) - err("illegal text address: %s", optarg); - break; - default: - usage (); - } - } - - if (optind >= argc) - usage (); - - name = argv[optind++]; - - if (optind != argc) - usage (); - - if ((f = fopen (name, "r+")) == NULL) { - fprintf (stderr, "can't open %s\n", name); - exit (1); - } - - if (fread ((char *)&hdr, sizeof hdr, 1, f) != 1) { - fprintf (stderr, "can't read header\n"); - exit (1); - } - - if (N_BADMAG (hdr)) { - fprintf (stderr, "bad magic number\n"); - exit (1); - } - - if (hdr.a_syms == 0) { - fprintf (stderr, "no symbols\n"); - exit (1); - } - - fseek (f, N_STROFF (hdr), 0); - if (fread ((char *)&old_strtab_size, sizeof (int), 1, f) != 1) { - fprintf (stderr, "can't read old strtab size\n"); - exit (1); - } - - if ((old_syms = (struct nlist *)malloc (hdr.a_syms)) == NULL - || ((old_strtab = malloc (old_strtab_size)) == NULL) - || ((new_syms = (struct nlist *)malloc (hdr.a_syms)) == NULL) - || ((new_strtab = malloc (old_strtab_size)) == NULL)) { - fprintf (stderr, "out of memory\n"); - exit (1); - } - - fseek (f, N_SYMOFF (hdr), 0); - if (fread ((char *)old_syms, hdr.a_syms, 1, f) != 1) { - fprintf (stderr, "can't read symbols\n"); - exit (1); - } - - fseek (f, N_STROFF (hdr), 0); - if (fread ((char *)old_strtab, old_strtab_size, 1, f) != 1) { - fprintf (stderr, "can't read string table\n"); - exit (1); - } - - num_old_syms = hdr.a_syms / sizeof (struct nlist); - - new_strtab_size = 4; - - nsp = new_syms; - for (i = 0, sp = old_syms; i < num_old_syms; i++, sp++) { - if (zap_locals && !(sp->n_type & N_EXT)) - continue; - - if (sp->n_type & N_STAB) - switch (sp->n_type & ~N_EXT) { - case N_SLINE: - if (debugging) - *nsp++ = *sp; - continue; - case N_FUN: - case N_PSYM: - case N_SO: - if (!debugging) - continue; - goto skip_tests; - break; - default: - continue; - } - - if ((sp->n_type & ~N_EXT) == N_UNDF) - continue; - - if (!debugging && (sp->n_type & ~N_EXT) == N_FN) - continue; - - if (sp->n_un.n_strx == 0) - continue; - - if (sp->n_value < text_adr) - continue; - - if (sp->n_value > (text_adr + hdr.a_text + hdr.a_data + - hdr.a_bss)) - continue; - - skip_tests: - - name = old_strtab + sp->n_un.n_strx; - - len = strlen (name); - - if (len == 0) - continue; - - if (strcmp (name, "gcc_compiled.") == 0) - continue; - - if (strcmp (name, "gcc2_compiled.") == 0) - continue; - - if (strcmp (name, "___gnu_compiled_c") == 0) - continue; - - *nsp = *sp; - - nsp->n_un.n_strx = new_strtab_size; - strcpy (new_strtab + new_strtab_size, name); - new_strtab_size += len + 1; - nsp++; - - if (strcmp (name, "_db_symtab") == 0) - db_symtab_adr = sp->n_value; - if (strcmp (name, "_db_symtabsize") == 0) - db_symtabsize_adr = sp->n_value; - } - - if (db_symtab_adr == 0 || db_symtabsize_adr == 0) - if (!force) { - fprintf (stderr, "couldn't find db_symtab symbols\n"); - exit (1); - } else - exit (0); - - *(int *)new_strtab = new_strtab_size; - num_new_syms = nsp - new_syms; - new_syms_bytes = num_new_syms * sizeof (struct nlist); - - need = sizeof (int) - + num_new_syms * sizeof (struct nlist) - + new_strtab_size; - - fseek (f, FILE_OFFSET (db_symtabsize_adr), 0); - - if (fread ((char *)&avail, sizeof (int), 1, f) != 1) { - fprintf (stderr, "can't read symtabsize\n"); - exit (1); - } - - printf ("dbsym: need %d; avail %d\n", need, avail); - - if (need > avail) { - fprintf (stderr, "not enough room in db_symtab array\n"); - exit (1); - } - - fseek (f, FILE_OFFSET (db_symtab_adr), 0); - fwrite ((char *)&new_syms_bytes, sizeof (int), 1, f); - fwrite ((char *)new_syms, new_syms_bytes, 1, f); - fwrite (new_strtab, new_strtab_size, 1, f); - fflush (f); - - if (feof (f) || ferror (f)) { - fprintf (stderr, "write error\n"); - exit (1); - } - exit (0); -} - diff --git a/usr.sbin/named/tools/nsquery/Makefile b/usr.sbin/named/tools/nsquery/Makefile deleted file mode 100644 index 5263aa12bb62..000000000000 --- a/usr.sbin/named/tools/nsquery/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# @(#)Makefile 5.1 (Berkeley) 5/28/90 - -PROG= nsquery -NOMAN= noman - -.include "../../../Makefile.inc" -.include <bsd.prog.mk> diff --git a/usr.sbin/named/tools/nsquery/nsquery.c b/usr.sbin/named/tools/nsquery/nsquery.c deleted file mode 100644 index c1ac28ea88f6..000000000000 --- a/usr.sbin/named/tools/nsquery/nsquery.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * ++Copyright++ 1986 - * - - * Copyright (c) 1986 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1986 Regents of the University of California.\n\ - portions Copyright (c) 1993 Digital Equipment Corporation\n\ - All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)nsquery.c 4.8 (Berkeley) 6/1/90"; -static char rcsid[] = "$Id: nsquery.c,v 1.2 1994/09/22 20:45:28 pst Exp $"; -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/nameser.h> -#include <arpa/inet.h> -#include <stdio.h> -#include <netdb.h> -#include <resolv.h> -#include <string.h> - -main(argc, argv) - int argc; - char **argv; -{ - extern struct __res_state _res; - register struct hostent *hp; - register char *s; - - res_init(); - - if (argc >= 2 && strcmp(argv[1], "-d") == 0) { - _res.options |= RES_DEBUG; - argc--; - argv++; - } - if (argc < 2) { - fprintf(stderr, "usage: nsquery [-d] host [server]\n"); - exit(1); - } - if (argc == 3) { - hp = gethostbyname(argv[2]); - if (hp == NULL) { - fprintf(stderr, "nsquery:"); - herror(argv[2]); - exit(1); - } - printf("\nServer:\n"); - printanswer(hp); - _res.nsaddr.sin_addr = *(struct in_addr *)hp->h_addr; -#ifdef nsaddr /* struct __res_state includes nscount and nsaddr_list[] */ - _res.nscount = 1; -#endif - } - - hp = gethostbyname(argv[1]); - if (hp == NULL) { - fprintf(stderr, "nsquery: %s: ", argv[1]); - herror((char *)NULL); - exit(1); - } - printanswer(hp); - exit(0); -} - -printanswer(hp) - register struct hostent *hp; -{ - register char **cp; - - printf("Name: %s\n", hp->h_name); -#if BSD >= 43 || defined(h_addr) - printf("Addresses:"); - for (cp = hp->h_addr_list; cp && *cp; cp++) - printf(" %s", inet_ntoa(*(struct in_addr *)(*cp))); - printf("\n"); -#else - printf("Address: %s\n", inet_ntoa(*(struct in_addr *)hp->h_addr)); -#endif - printf("Aliases:"); - for (cp = hp->h_aliases; cp && *cp && **cp; cp++) - printf(" %s", *cp); - printf("\n\n"); -} diff --git a/usr.sbin/named/tools/nstest/Makefile b/usr.sbin/named/tools/nstest/Makefile deleted file mode 100644 index e976d525153b..000000000000 --- a/usr.sbin/named/tools/nstest/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# @(#)Makefile 5.1 (Berkeley) 5/28/90 - -PROG= nstest -NOMAN= noman - -.include "../../../Makefile.inc" -.include <bsd.prog.mk> diff --git a/usr.sbin/named/tools/nstest/nstest.c b/usr.sbin/named/tools/nstest/nstest.c deleted file mode 100644 index d40e748fa1e3..000000000000 --- a/usr.sbin/named/tools/nstest/nstest.c +++ /dev/null @@ -1,423 +0,0 @@ -/* - * ++Copyright++ 1986 - * - - * Copyright (c) 1986 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1986 Regents of the University of California.\n\ - portions Copyright (c) 1993 Digital Equipment Corporation\n\ - All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)nstest.c 4.15 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: nstest.c,v 1.2 1994/09/22 20:45:31 pst Exp $"; -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <arpa/nameser.h> -#include <stdio.h> -#include <resolv.h> - -char *progname; -FILE *log; -#define MAXDATA 256 /* really should get this from named/db.h */ -main(argc, argv) - char **argv; -{ - register char *cp; - register u_char *ucp; - struct hostent *hp; - u_short port = htons(NAMESERVER_PORT); - char buf[BUFSIZ]; - u_char packet[PACKETSZ], answer[8*1024], OldRRData[MAXDATA]; - struct rrec NewRR; - u_int32_t l; - int n, dump_packet; - - NewRR.r_data = (char *) malloc(MAXDATA); - NewRR.r_data = (char *) malloc(MAXDATA); - progname = argv[0]; - dump_packet = 0; - _res.options |= RES_DEBUG|RES_RECURSE; - (void) res_init(); - while (argc > 1 && argv[1][0] == '-') { - argc--; - cp = *++argv; - while (*++cp) - switch (*cp) { - case 'p': - if (--argc <= 0) - usage(); - port = htons(atoi(*++argv)); - break; - - case 'i': - _res.options |= RES_IGNTC; - break; - - case 'v': - _res.options |= RES_USEVC|RES_STAYOPEN; - break; - - case 'r': - _res.options &= ~RES_RECURSE; - break; - - case 'd': - dump_packet++; - break; - - default: - usage(); - } - } - _res.nsaddr.sin_family = AF_INET; - _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); - _res.nsaddr.sin_port = port; - if (argc > 1) { - if (!inet_aton(argv[1], - (struct in_addr *)&_res.nsaddr.sin_addr)) - usage(); - } - if (argc > 2) { - log = fopen(argv[2],"w"); - if (log == NULL) perror(argv[2]); - } - for (;;) { - printf("> "); - fflush(stdout); - if ((cp = fgets(buf, sizeof buf, stdin)) == NULL) - break; - switch (*cp++) { - case 'a': - n = res_mkquery(QUERY, cp, C_IN, T_A, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'A': - n = ntohl(inet_addr(cp)); - putlong((u_int32_t)n, (u_char*)cp); - n = res_mkquery(IQUERY, "", C_IN, T_A, (u_char *)cp, - INT32SZ, NULL, - packet, sizeof(packet)); - break; - - case 'f': - n = res_mkquery(QUERY, cp, C_ANY, T_UINFO, NULL, - 0, NULL, packet, sizeof packet); - break; - - case 'F': - n = res_mkquery(QUERY, cp, C_IN, T_AFSDB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'g': - n = res_mkquery(QUERY, cp, C_ANY, T_GID, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'G': - *(int *)cp = htonl(atoi(cp)); - n = res_mkquery(IQUERY, "", C_ANY, T_GID, (u_char *)cp, - sizeof(int), NULL, packet, sizeof packet); - break; - - case 'c': - n = res_mkquery(QUERY, cp, C_IN, T_CNAME, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'h': - n = res_mkquery(QUERY, cp, C_IN, T_HINFO, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'm': - n = res_mkquery(QUERY, cp, C_IN, T_MX, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'M': - n = res_mkquery(QUERY, cp, C_IN, T_MAILB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'n': - n = res_mkquery(QUERY, cp, C_IN, T_NS, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'p': - n = res_mkquery(QUERY, cp, C_IN, T_PTR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 's': - n = res_mkquery(QUERY, cp, C_IN, T_SOA, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'T': - n = res_mkquery(QUERY, cp, C_IN, T_TXT, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'u': - n = res_mkquery(QUERY, cp, C_ANY, T_UID, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'U': - *(int *)cp = htonl(atoi(cp)); - n = res_mkquery(IQUERY, "", C_ANY, T_UID, (u_char *)cp, - sizeof(int), NULL, - packet, sizeof packet); - break; - - case 'x': - n = res_mkquery(QUERY, cp, C_IN, T_AXFR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'w': - n = res_mkquery(QUERY, cp, C_IN, T_WKS, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'b': - n = res_mkquery(QUERY, cp, C_IN, T_MB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'B': - n = res_mkquery(QUERY, cp, C_IN, T_MG, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'i': - n = res_mkquery(QUERY, cp, C_IN, T_MINFO, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'r': - n = res_mkquery(QUERY, cp, C_IN, T_MR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case '*': - n = res_mkquery(QUERY, cp, C_IN, T_ANY, NULL, 0, - NULL, packet, sizeof packet); - break; - -#ifdef ALLOW_UPDATES - case '^': - { - char IType[10], TempStr[50]; - int Type, oldnbytes, nbytes, i; -#ifdef ALLOW_T_UNSPEC - printf("Data type (a = T_A, u = T_UNSPEC): "); - gets(IType); - if (IType[0] == 'u') { - Type = T_UNSPEC; - printf("How many data bytes? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &nbytes); - for (i = 0; i < nbytes; i++) { - (NewRR.r_data)[i] = (char) i; - } - } else { -#endif /* ALLOW_T_UNSPEC */ - Type = T_A; - nbytes = INT32SZ; - printf( - "Inet addr for new dname (e.g., 192.4.3.2): " - ); - gets(TempStr); - putlong(ntohl(inet_addr(TempStr)), - NewRR.r_data); -#ifdef ALLOW_T_UNSPEC - } -#endif - NewRR.r_class = C_IN; - NewRR.r_type = Type; - NewRR.r_size = nbytes; - NewRR.r_ttl = 99999999; - printf("Add, modify, or modify all (a/m/M)? "); - gets(TempStr); - if (TempStr[0] == 'a') { - n = res_mkquery(UPDATEA, cp, C_IN, Type, - OldRRData, nbytes, - &NewRR, packet, - sizeof packet); - } else { - if (TempStr[0] == 'm') { - printf("How many data bytes in old RR? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &oldnbytes); - for (i = 0; i < oldnbytes; i++) { - OldRRData[i] = (char) i; - } - n = res_mkquery(UPDATEM, cp, - C_IN, Type, - OldRRData, oldnbytes, - &NewRR, packet, - sizeof packet); - } else { /* Modify all */ - n = res_mkquery(UPDATEMA, cp, - C_IN, Type, NULL, 0, - &NewRR, packet, - sizeof packet); - - } - } - } - break; - -#ifdef ALLOW_T_UNSPEC - case 'D': - n = res_mkquery(UPDATEDA, cp, C_IN, T_UNSPEC, - (char *)0, 0, NULL, - packet, sizeof packet); - break; - - case 'd': - { - char TempStr[100]; - int nbytes, i; - printf("How many data bytes in oldrr data? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &nbytes); - for (i = 0; i < nbytes; i++) { - OldRRData[i] = (char) i; - } - n = res_mkquery(UPDATED, cp, C_IN, T_UNSPEC, - OldRRData, nbytes, NULL, - packet, sizeof packet); - } - break; -#endif /* ALLOW_T_UNSPEC */ -#endif /* ALLOW_UPDATES */ - - default: - printf("a{host} - query T_A\n"); - printf("A{addr} - iquery T_A\n"); - printf("b{user} - query T_MB\n"); - printf("B{user} - query T_MG\n"); - printf("f{host} - query T_UINFO\n"); - printf("g{host} - query T_GID\n"); - printf("G{gid} - iquery T_GID\n"); - printf("h{host} - query T_HINFO\n"); - printf("i{host} - query T_MINFO\n"); - printf("p{host} - query T_PTR\n"); - printf("m{host} - query T_MX\n"); - printf("M{host} - query T_MAILB\n"); - printf("n{host} - query T_NS\n"); - printf("r{host} - query T_MR\n"); - printf("s{host} - query T_SOA\n"); - printf("T{host} - query T_TXT\n"); - printf("u{host} - query T_UID\n"); - printf("U{uid} - iquery T_UID\n"); - printf("x{host} - query T_AXFR\n"); - printf("w{host} - query T_WKS\n"); - printf("F{host} - query T_AFSDB\n"); - printf("c{host} - query T_CNAME\n"); - printf("*{host} - query T_ANY\n"); -#ifdef ALLOW_UPDATES - printf("^{host} - add/mod/moda (T_A/T_UNSPEC)\n"); -#ifdef ALLOW_T_UNSPEC - printf("D{host} - deletea T_UNSPEC\n"); - printf("d{host} - delete T_UNSPEC\n"); -#endif /* ALLOW_T_UNSPEC */ -#endif /* ALLOW_UPDATES */ - continue; - } - if (n < 0) { - printf("res_mkquery: buffer too small\n"); - continue; - } - if (log) { - fprintf(log,"SEND QUERY\n"); - fp_query(packet, log); - } - n = res_send(packet, n, answer, sizeof(answer)); - if (n < 0) { - printf("res_send: send error\n"); - if (log) fprintf(log, "res_send: send error\n"); - } - else { - if (dump_packet) { - int f; - f = creat("ns_packet.dump", 0644); - write(f, answer, n); - (void) close(f); - } - if (log) { - fprintf(log, "GOT ANSWER\n"); - fp_query(answer, log); - } - } - } -} - -usage() -{ - fprintf(stderr, "Usage: %s [-v] [-i] [-r] [-d] [-p port] hostaddr\n", - progname); - exit(1); -} diff --git a/usr.sbin/ncrcontrol/ncrcontrol.1 b/usr.sbin/ncrcontrol/ncrcontrol.1 deleted file mode 100644 index 11505f0e1624..000000000000 --- a/usr.sbin/ncrcontrol/ncrcontrol.1 +++ /dev/null @@ -1,286 +0,0 @@ -.\" Copyright (c) 1994 Wolfgang Stanglmeier. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $Id: ncrcontrol.8,v 1.1 94/10/09 21:25:51 wolf Exp $ -.\" -.Dd September 16, 1994 -.Dt NCRCONTROL 8 -.Os FreeBSD -.Sh NAME -.Nm ncrcontrol -.Nd manually configure the ncr810/825 PCI/SCSI device driver -.Sh SYNOPSIS -.\"-------------------------------------------------------- -.\" ncrcontrol [-Mcore] [-Nsystem] [-u unit] [-v] [-v] -i -.\"-------------------------------------------------------- -.Nm ncrcontrol -.Op Fl M Ar core -.Op Fl N Ar system -.Op Fl u Ar unit -.Op Fl v -.Op Fl v -.Fl i -.\"-------------------------------------------------------- -.\" ncrcontrol [-N system] [-u unit] [-p wait] -.\"-------------------------------------------------------- -.Nm ncrcontrol -.Op Fl N Ar system -.Op Fl u Ar unit -.Op Fl p Ar wait -.\"------------------------------------------------------------ -.\" ncrcontrol [-Nsystem] [-u unit] [-t target] -s name=value -.\"------------------------------------------------------------ -.Nm ncrcontrol -.Op Fl N Ar system -.Op Fl u Ar unit -.Op Fl t Ar target -.Fl s -.Ar name=value -.\"------------------------------------------------------------ -.\" ncrcontrol [-Mcore] [-Nsystem] [-u unit] [-t target] -d pattern -.\"------------------------------------------------------------ -.Nm ncrcontrol -.Op Fl M Ar core -.Op Fl N Ar system -.Op Fl u Ar unit -.Op Fl t Ar target -.Fl d -.Ar debug -.\"------------------------------------------------------------ -.\" ncrcontrol [-Nsystem] [-u unit] -w -k torture -.\"------------------------------------------------------------ -.Nm ncrcontrol -.Op Fl N Ar system -.Op Fl u Ar unit -.Fl w -.Fl k -.Ar torture -.\" -.\"===================================================================== -.\" -.Sh DESCRIPTION -The -.Nm ncrcontrol -command symbolically displays the contents of the ncr810/ncr825 -pci/scsi driver control structure. -There are a number of output formats, -depending on the options for the information presented. -It may be used to set some values, too. - -.\"-------------------------------------------------------- -.\" ncrcontrol [-Mcore] [-Nsystem] [-u unit] [-v] [-v] -i -.\"-------------------------------------------------------- -The first form of the command displays an overview of the -connected targets. The -.Fl v -requests a verbose output. - -.\"-------------------------------------------------------- -.\" ncrcontrol [-N system] [-u unit] [-p wait] -.\"-------------------------------------------------------- -Using the second form, with a -.Ar wait -interval specified, -.Nm ncrcontrol -will continuously display the information regarding data -traffic on the selected scsi bus. - -.\"------------------------------------------------------------ -.\" ncrcontrol [-Nsystem] [-u unit] [-t target] -s name=value -.\"------------------------------------------------------------ -The third form sets a configuration value for one or all -targets of a selected scsi bus. -It normally is not needed, if the device driver options are -correctly set in kernel configuration. - -.\"------------------------------------------------------------ -.\" ncrcontrol [-M core] [-N system] [-u unit] [-t target] -w -d pattern -.\"------------------------------------------------------------ -The forth form presents the content of the drivers control -structure. By the -.Ar pattern -certain parts of the output can be enabled/disabled. -It's only used to debug the driver. - -.\"------------------------------------------------------------ -.\" ncrcontrol [-N system] [-u unit] -w -k torture -.\"------------------------------------------------------------ -With the last form certain driver problems can be forced. -THIS MAY CRASH YOUR SYSTEM. -It's only used to debug the driver. - -.\" -.\"===================================================================== -.\" -.Pp -The options have the following meaning: -.Bl -tag -width flag -.\"------------------------------------------------------------ -.\" -d pattern -.\"------------------------------------------------------------ -.It Fl d -Show the content of the drivers control structure. -The -.Ar pattern -selects the fields, which are displayed. With -.Fl d? -you can get a list of valid flags. - -.\"------------------------------------------------------------ -.\" -i -.\"------------------------------------------------------------ -.It Fl i -Show the configuration state of the connected targets. -With the -.Fl v -option you can request a more verbose information. - -.\"------------------------------------------------------------ -.\" -k torture -.\"------------------------------------------------------------ -.It Fl k -Force certain driver problems to check the error recovery -functions. This option should only be used by the developers. -With -.Fl k? -you can get a list of possible tortures. -This option requires the -.Fl w -option to be set. - -.\"------------------------------------------------------------ -.\" -M core -.\"------------------------------------------------------------ -.It Fl M -Extract values associated with the name list from the specified core -instead of the default -.Pa /dev/kmem . -.\"------------------------------------------------------------ -.\" -N system -.\"------------------------------------------------------------ -.It Fl N -Extract the name list from the specified system instead of the default -.Pa /386bsd . - -.\"------------------------------------------------------------ -.\" -p wait -.\"------------------------------------------------------------ -When -.Nm ncrcontrol -is invoked with a -.Ar wait -interval argument, it displays a running count of statistics related to -the transfers on the selected scsi bus. - -This display consists of the number of transfers and number of transferred -byted for the controller and for each connected target. - -(NOT YET COMPLETE) - -.\"------------------------------------------------------------ -.\" -s field=value -.\"------------------------------------------------------------ -.It Fl s -Set a configuration value for one or more targets. -One ore more targets can be selected by the -.Fl t -option. If no target is selected, then the field is set -for all connect targets. - -(NOT YET COMPLETE) - -.\"------------------------------------------------------------ -.\" -t target -.\"------------------------------------------------------------ -.It Fl t -Select the target for the -.Fl s -option. This option may be given more than one time. - -.\"------------------------------------------------------------ -.\" -u unit -.\"------------------------------------------------------------ -.It Fl u -Select the controller unit. -If this option is not given, then controller 0 is assumed. -Most systems have only one controller. - -.\"------------------------------------------------------------ -.\" -v -.\"------------------------------------------------------------ -.It Fl v -Enable verbose output for the -.Fl i -option. - -.\"------------------------------------------------------------ -.\" -w -.\"------------------------------------------------------------ -.It Fl w -Wizard option. -Enable the usage of the -.Fl k -option. - -.\" -.\"===================================================================== -.\" -.Pp -(NOT YET COMPLETE) - -.\" -.\"===================================================================== -.\" -.Sh SEE ALSO -.Xr scsi 5 - -.\" -.\"===================================================================== -.\" -.Sh HISTORY -The -.Nm ncrcontrol -command was hacked for -.Bx 386 -and ported to version 1.1 of -.Bx Free -by Wolfgang Stanglmeier <wolf@dentaro.GUN.de>. -It was ported to -.Bx Net -by Charles M. Hannum <mycroft@gnu.ai.mit.edu> -and to version 2.0 of -.Bx Free -by Stefan Esser <se@zpr.Uni-Koeln.DE>. - -.\" -.\"===================================================================== -.\" -.Sh BUGS -The -.Nm ncrcontrol -was hacked as a debugging tool for the ncr810 driver. -It should be deleted sometimes. -There should be a general tool to change device driver options -on the fly. -The statistical data should be gathered by the generic scsi driver. diff --git a/usr.sbin/pkg_install/+COMMENT b/usr.sbin/pkg_install/+COMMENT deleted file mode 100644 index d29a496f4087..000000000000 --- a/usr.sbin/pkg_install/+COMMENT +++ /dev/null @@ -1 +0,0 @@ -Package install (source), version 0.5
\ No newline at end of file diff --git a/usr.sbin/pkg_install/+CONTENTS b/usr.sbin/pkg_install/+CONTENTS deleted file mode 100644 index ff4d7d9ae915..000000000000 --- a/usr.sbin/pkg_install/+CONTENTS +++ /dev/null @@ -1,2 +0,0 @@ -@cwd /usr/ports -pkg_install diff --git a/usr.sbin/pkg_install/+DESC b/usr.sbin/pkg_install/+DESC deleted file mode 100644 index dd42917cec0a..000000000000 --- a/usr.sbin/pkg_install/+DESC +++ /dev/null @@ -1,5 +0,0 @@ -This is the pkg_install suite of tools for doing maintainance of -software "packages". More documentation is available in the man pages -for each individual command. - -This is pkg_install version 0.5. diff --git a/usr.sbin/pkg_install/pkg b/usr.sbin/pkg_install/pkg deleted file mode 100755 index f3e53c9901b4..000000000000 --- a/usr.sbin/pkg_install/pkg +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/local/bin/wish -f -#$Id: pkg,v 1.6 1993/09/03 23:37:22 rich Exp $ -# -#$Log: pkg,v $ -# Revision 1.6 1993/09/03 23:37:22 rich -# warn user if no tar archives are found in the current directory. -# removed the revision string from the lower text frame. -# -# Revision 1.5 1993/09/03 15:48:04 rich -# glob for .tar.gz, .tar.z and .tar.Z looking for archives -# -# Revision 1.4 1993/08/28 15:53:59 rich -# added version and date info to lower text window. -# -# Revision 1.3 1993/08/28 15:47:12 rich -# filtered out ^Ls in pkg_* output. -# -# -set pkgname "" -wm title . "Package Installation" -#-------------------------------------------------------------- -# The top level main window, consisting of a bar of buttons and a list -# of packages and a description of the current package. -#-------------------------------------------------------------- -frame .menu -relief raised -borderwidth 1 -frame .frame -borderwidth 4 - -scrollbar .frame.scroll -relief sunken -command ".frame.list yview" -listbox .frame.list -yscroll ".frame.scroll set" -relief sunken -setgrid 1 -pack append .frame .frame.scroll {right filly} \ - .frame.list {left expand fill} - -# build the lower window shoing the complete description of a pacage -frame .f -borderwidth 4 -text .f.t -width 80 -height 20 -yscrollcommand ".f.s set" -relief sunken - -# Initially display instructions in this window. Erase the -# instructions and show the package description when the user clicks -# on a package. -# -.f.t insert end "Double click on a package above to see it's -complete description here." -scrollbar .f.s -relief sunken -command ".f.t yview" -pack append .f .f.s {right filly} .f.t {left expand fill} - -bind .frame.list <Double-Button-1> \ - {foreach i [selection get] {do_description $i}} -pack append . .menu {top fill} \ - .f {bottom expand fill} \ - .frame {bottom expand fill} - -#---------------------------------------------------------------- -# Make menu bar: -#---------------------------------------------------------------- -button .menu.inst -text "Install" \ - -command "apply_to_pkg \"pkg_add -v\"" -button .menu.dein -text "Deinstall" \ - -command "apply_to_pkg \"pkg_delete -v\"" -button .menu.installed -text "What is Installed?" \ - -command "list_pkgs \"pkg_info -I -a |tr ' ' ' '\"" -button .menu.available -text "What can I install?" \ - -command "list_pkgs \"pkg_info -I -c [glob -nocomplain *.{tgz,tar.z,tar.gz,tar.Z}] |tr ' ' ' '\"" -button .menu.cont -text "Contents?" \ - -command "global pkgname; apply_to_pkg \"pkg_info -d -v |tr -d ''\"" -button .menu.quit -text "Quit" -command "destroy ." -button .menu.help -text "Help" -command "do_help" - -pack append .menu \ - .menu.inst left \ - .menu.dein left \ - .menu.installed left \ - .menu.available left \ - .menu.cont left \ - .menu.quit left \ - .menu.help right -#------------------------------------------------------- -# Display the package description. -#------------------------------------------------------- -proc list_pkgs {s} { - set line "" - set f [eval "open {| csh -c \"$s\" } r"] - .frame.list delete 0 end - while {[gets $f line] > 0} { - .frame.list insert end $line - } - close $f -} - -# display the list of available packages -set archives [glob -nocomplain *.{tgz,tar.z,tar.gz,tar.Z}] -if {$pkgname == ""} { - .frame.list delete 0 end - .frame.list insert end "Warning: no compressed tar archives files found." -} else { - list_pkgs "pkg_info -I -c $archives |tr ' ' ' '" -} - -#------------------------------------------------------- -# Display the package description. -#------------------------------------------------------- -proc do_description {s} { - global pkgname - regexp {[^ ]*} $s filename - set pkgname $filename - .f.t delete 0.0 end - set cmd "pkg_info -d $filename |tr -d ''" - set f [eval "open {| csh -c \"$cmd\" } r"] - while {![eof $f]} { - .f.t insert end [read $f] - } -} -#------------------------------------------------------- -# package install window. -#------------------------------------------------------- -proc do_help {{w .help}} { - catch {destroy $w} - toplevel $w - wm title $w "Help" - wm iconname $w "Help" - button $w.ok -text OK -command "destroy $w" - message $w.t -relief raised -bd 2 \ - -text "You can install, deinstall and list info on the available packages. To select a package and see it's complete description, press mouse button 1 over the package name. To install a selected package, press the Install button. To exit, press the \"Quit\" button." - pack append $w $w.ok {bottom fillx} $w.t {expand fill} -} -#------------------------------------------------------- -# Apply a command to a package. -#------------------------------------------------------- -proc apply_to_pkg {s} { - global pkgname - .f.t delete 0.0 end - if {$pkgname == ""} { - .f.t insert end "You must double click on a package name first!" - } else { - .f.t delete 0.0 end - .f.t insert end "Running: $s $pkgname\n" - set f [eval "open {| $s $pkgname} r"] - while {![eof $f]} { - .f.t insert end [read $f 64] - } - } -} -#------------------------------------------------------- -# Invoke an arbitrary command. -#------------------------------------------------------- -proc do_command {s} { - .f.t delete 0.0 end - .f.t insert end "Running: $s\n" - set f [eval "open {| $s} r"] - while {![eof $f]} { - .f.t insert end [read $f 64] - } -} -# local variables: -# mode: csh -# compile-command: "" -# comment-start: "# " -# comment-start-skip: "# " -# end: diff --git a/usr.sbin/pkg_manage/pkg_del-inst.hlp b/usr.sbin/pkg_manage/pkg_del-inst.hlp deleted file mode 100644 index 5d0b20889c04..000000000000 --- a/usr.sbin/pkg_manage/pkg_del-inst.hlp +++ /dev/null @@ -1,18 +0,0 @@ - - ********************************************* - * Help for '2. DELETE an installed package' * - ********************************************* - -Choose a package from the list of installed packages to delete. -Move the cursor to the package to be deleted and press enter. - -You may now select to either: - -1. Simulate delete Only display the commands that will - be executed to delete the package, - without actually executing them. -2. Delete This will actually delete the - package. -3. Cancel Return to the package selection menu. - -(use arrow-keys or digit to choose option and press enter) diff --git a/usr.sbin/pkg_manage/pkg_view-inst.hlp b/usr.sbin/pkg_manage/pkg_view-inst.hlp deleted file mode 100644 index c74d400240ad..000000000000 --- a/usr.sbin/pkg_manage/pkg_view-inst.hlp +++ /dev/null @@ -1,12 +0,0 @@ - - ******************************** - * Help for '1. View installed' * - ******************************** - -Choose a package from the list to see the description for the package. - -Move the cursor with the arrow-keys and PgUp and PgDn, press enter -when the cursor highlights the right package. - -When viewing the description use PgUp and PgDn and arrow-keys to move -through the text. diff --git a/usr.sbin/rarpd/ether_addr.c b/usr.sbin/rarpd/ether_addr.c deleted file mode 100644 index 7404c81b18e7..000000000000 --- a/usr.sbin/rarpd/ether_addr.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * ethernet address conversion and lookup routines - * - * Written by Bill Paul <wpaul@ctr.columbia.edu> - * Center for Telecommunications Research - * Columbia University, New York City - * - * This code is public domain. There is no copyright. There are no - * distribution or usage restrictions. There are no strings attached. - * - * Have a party. - * - * $Id: ether_addr.c,v 1.4 1995/03/05 22:03:58 wpaul Exp $ - */ - - -#include <stdio.h> -#include <sys/types.h> -#include <string.h> -#include <sys/param.h> - -#ifndef _PATH_ETHERS -#define _PATH_ETHERS "/etc/ethers" -#endif - -/* - * This should be defined in <netinet/if_ether.h> but it isn't. - */ -struct ether_addr { - unsigned char octet[6]; -}; - -extern int yp_get_default_domain(); -extern int yp_match(); -char *yp_domain; - -/* - * Parse a string of text containing an ethernet address and hostname - * and separate it into its component parts. - */ -int ether_line(l, e, hostname) - char *l; - struct ether_addr *e; - char *hostname; -{ - int i, o[6]; - - i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2], - &o[3], &o[4], &o[5], - hostname); - if (i != 7) - return (i); - - for (i=0; i<6; i++) - e->octet[i] = o[i]; - return (0); -} - -/* - * Convert an ASCII representation of an ethernet address to - * binary form. - */ -struct ether_addr *ether_aton(a) - char *a; -{ - int i; - static struct ether_addr o; - - i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2], - o.octet[3], o.octet[4], o.octet[5]); - if (i != 6) - return (NULL); - return ((struct ether_addr *)&o); -} - -/* - * Convert a binary representation of an ethernet address to - * an ASCII string. - */ -char *ether_ntoa(n) - struct ether_addr *n; -{ - int i; - static char a[18]; - - i = sprintf(a,"%x:%x:%x:%x:%x:%x",n->octet[0],n->octet[1],n->octet[2], - n->octet[3],n->octet[4],n->octet[5]); - if (i < 11) - return (NULL); - return ((char *)&a); -} - -/* - * Map an ethernet address to a hostname. Use either /etc/ethers or - * NIS/YP. - */ - -int ether_ntohost(hostname, e) - char *hostname; - struct ether_addr *e; -{ - FILE *fp; - char buf[BUFSIZ]; - struct ether_addr local_ether; - char local_host[MAXHOSTNAMELEN]; - char *result; - int resultlen; - char *ether_a; - - if ((fp = fopen(_PATH_ETHERS, "r")) == NULL) - return (1); - - while (fgets(buf,BUFSIZ,fp)) { - if (buf[0] == '#') - continue; - if (buf[0] == '+') { - fclose(fp); /* Can ignore /etc/ethers from here on. */ - if (yp_get_default_domain(&yp_domain)) - return(1); - ether_a = ether_ntoa(e); - if (yp_match(yp_domain, "ethers.byaddr", ether_a, - strlen(ether_a), &result, &resultlen)) { - free(result); - return(1); - } - if (!ether_line(result, &local_ether, &local_host)) { - strcpy(hostname, (char *)&local_host); - free(result); - return(0); - } else { - free(result); - return(1); - } - } - if (!ether_line(&buf, &local_ether, &local_host)) { - if (!bcmp((char *)&local_ether.octet[0], - (char *)&e->octet[0], 6)) { - /* We have a match */ - strcpy(hostname, (char *)&local_host); - fclose(fp); - return(0); - } - } - } -fclose(fp); -return (1); -} - -/* - * Map a hostname to an ethernet address using /etc/ethers or - * NIS/YP. - */ -int ether_hostton(hostname, e) - char *hostname; - struct ether_addr *e; -{ - FILE *fp; - char buf[BUFSIZ]; - struct ether_addr local_ether; - char local_host[MAXHOSTNAMELEN]; - char *result; - int resultlen; - - if ((fp = fopen(_PATH_ETHERS, "r")) == NULL) - return (1); - - while (fgets(buf,BUFSIZ,fp)) { - if (buf[0] == '#') - continue; - if (buf[0] == '+') { - fclose(fp); /* Can ignore /etc/ethers from here on. */ - if (yp_get_default_domain(&yp_domain)) - return(1); - if (yp_match(yp_domain, "ethers.byname", hostname, - strlen(hostname), &result, &resultlen)) { - free(result); - return(1); - } - if (!ether_line(result, &local_ether, &local_host)) { - bcopy((char *)&local_ether.octet[0], - (char *)&e->octet[0], 6); - free(result); - return(0); - } else { - free(result); - return(1); - } - } - if (!ether_line(&buf, &local_ether, &local_host)) { - if (!strcmp(hostname, (char *)&local_host)) { - /* We have a match */ - bcopy((char *)&local_ether.octet[0], - (char *)&e->octet[0], 6); - fclose(fp); - return(0); - } - } - } -fclose(fp); -return (1); -} diff --git a/usr.sbin/rtprio/rtprio.2 b/usr.sbin/rtprio/rtprio.2 deleted file mode 100644 index 2c1b4c7f84e7..000000000000 --- a/usr.sbin/rtprio/rtprio.2 +++ /dev/null @@ -1,106 +0,0 @@ -.\" Copyright (c) 1994, Henrik Vestergaard Draboel -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Henrik Vestergaard Draboel. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" $Id: rtprio.2,v 1.2 1994/09/01 12:09:17 davidg Exp $ -.\" -.Dd July 23, 1994 -.Dt RTPRIO 2 -.Sh NAME -.Nm rtprio -.Nd examine or modify a process realtime or idle priority -.Sh SYNOPSIS -.Fd #include <sys/resource.h> -.Fd #include <sys/rtprio.h> -.Ft int -.Fn rtprio "function" "pid_t pid" "struct rtprio *rtp" -.Sh DESCRIPTION -.Fn rtprio -is used to lookup or change the realtime or idle priority of a process. - -.Fa function -specifies the operation to be performed. RTP_LOOKUP to lookup the current priority, -and RTP_SET to set the priority. -.Fa pid -specifies the process to be used, 0 for the current process. - -.Fa *rtp -is a pointer to a struct rtprio which is used to specify the priority and priority type. -This structure has the following form: -.Bd -literal -struct rtprio { - u_short type; - u_short prio; -}; -.Ed -.Pp -The value of the -.Nm type -field may be RTP_PRIO_REALTIME for realtime priorities, -RTP_PRIO_NORMAL for normal priorities, and RTP_PRIO_IDLE for idle priorities. -The priority specified by the -.Nm prio -field ranges between 0 and -.Dv RTP_PRIO_MAX (usually 31) . -0 is the highest possible priority. - -Realtime and idle priority is inherited through fork() and exec(). - -A realtime process can only be preempted by a process of equal or -higher priority, or by an interrupt; idle priority processes will run only -when no other real/normal priority process is runnable. Higher real/idle priority processes -preempt lower real/idle priority processes. Processes of equal real/idle priority are run round-robin. -.Sh RETURN VALUES -.Fn rtprio -will return 0 for success and -1 for all errors. The global variable -.Va errno -will be set to indicate the error. -.Sh ERRORS -.Fn rtprio -will fail if -.Bl -tag -width Er -.It Bq Er EINVAL -The specified -.Fa prio -was out of range. -.It Bq Er EPERM -The calling process is not allowed to set the realtime priority. Only -root is allowed to change the realtime priority of any process, and non-root -may only change the idle priority of the current process. -.It Bq Er ESRCH -The specified process was not found. -.Sh AUTHOR -The original author was Henrik Vestergaard Draboel - hvd@terry.ping.dk. This -implementation in FreeBSD was substantially rewritten by David Greenman. -.Sh SEE ALSO -.Xr rtprio 1 , -.Xr nice 1 , -.Xr ps 1 , -.Xr nice 2 , -.Xr renice 8 - diff --git a/usr.sbin/spkrtest/spkrtest.sh b/usr.sbin/spkrtest/spkrtest.sh deleted file mode 100644 index 319f3526760a..000000000000 --- a/usr.sbin/spkrtest/spkrtest.sh +++ /dev/null @@ -1,38 +0,0 @@ -: -# -# Test script for the speaker driver -# -# v1.0 by Eric S. Raymond (Feb 1990) -# v1.1 rightstuff contributed by Eric S. Tiedemann (est@snark.thyrsus.com) -# -reveille="t255l8c.f.afc~c.f.afc~c.f.afc.f.a..f.~c.f.afc~c.f.afc~c.f.afc~c.f.." -contact="<cd<a#~<a#>f" -dance="t240<cfcfgagaa#b#>dc<a#a.~fg.gaa#.agagegc.~cfcfgagaa#b#>dc<a#a.~fg.gga.agfgfgf." -loony="t255cf8f8edc<a>~cf8f8edd#e~ce8cdce8cd.<a>c8c8c#def8af8" -sinister="mst200o2ola.l8bc.~a.~>l2d#" -rightstuff="olcega.a8f>cd2bgc.c8dee2" -toccata="msl16oldcd4mll8pcb-agf+4.g4p4<msl16dcd4mll8pa.a+f+4p16g4" -startrek="l2b.f+.p16a.c+.p l4mn<b.>e8a2mspg+e8c+f+8b2" - -case $1 in -reveille) echo $reveille >/dev/speaker;; -contact) echo $contact >/dev/speaker;; -dance) echo $dance >/dev/speaker;; -loony) echo $loony >/dev/speaker;; -sinister) echo $sinister >/dev/speaker;; -rightstuff) echo $rightstuff >/dev/speaker;; -toccata) echo $toccata >/dev/speaker;; -startrek) echo $startrek >/dev/speaker;; -*) - echo "No such tune. Available tunes are:" - echo - echo "reveille -- Reveille" - echo "contact -- Contact theme from Close Encounters" - echo "dance -- Lord of the Dance (aka Simple Gifts)" - echo "loony -- Loony Toons theme" - echo "sinister -- standard villain's entrance music" - echo "rightstuff -- a trope from \"The Right Stuff\" score by Bill Conti" - echo "toccata -- opening bars of Bach's Toccata and Fugue in D Minor" - echo "startrek -- opening bars of the theme from Star Trek Classic" - ;; -esac diff --git a/usr.sbin/swapinfo/Makefile b/usr.sbin/swapinfo/Makefile deleted file mode 100644 index fb02166748bc..000000000000 --- a/usr.sbin/swapinfo/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# @(#)Makefile 5.5 (Berkeley) 4/23/91 - -PROG= swapinfo -SRCS= swapinfo.c -.PATH: ${.CURDIR}/../../bin/df - -DPADD= ${LIBMATH} ${LIBUTIL} -LDADD= -lm -lkvm -BINGRP= kmem -BINMODE=2555 - -.include <bsd.prog.mk> diff --git a/usr.sbin/swapinfo/README b/usr.sbin/swapinfo/README deleted file mode 100644 index f8019a89a6c2..000000000000 --- a/usr.sbin/swapinfo/README +++ /dev/null @@ -1,38 +0,0 @@ -swapinfo -======== - -Swapinfo is designed to provide some information to the user about the -state of the swap space on the system. I've written it based on a -brief (!) perusal of the VM code in 386BSD. I could be pretty confused -about how it all fits together, and perhaps this is totally bogus. -It seems to work for me, though. - -How it works: - -During startup, the system traverses the list of configured swap partitions, -and determines the size of the various partitions. As each new partition -is added for swapping (via swapon), the free space on that disk is added -to a linked list of free space. Adjacent areas are coalesced to form -larger areas. The swapping algorithm seems to take the first free section -that it finds [?]. - -Swapinfo reads in the list of configured swap partitions from the /dev/kmem, -to determine the size of the partitions. It then traverses the list -of free space, figuring up how much is still available and how much -has therefore been used. Things get a little hairy in that the swap space -is divided amongst the configured swap partitions so that the first -4096 blocks of swap go on the first swap partition, the second 4096 on -the second swap partition, and so on. This works out to be a fairly -simple bit of code, though. - -More caveats: - -This works on my system. Your milage may vary. Since I'm reading /dev/kmem -to follow a linked list, the program could easily get lost looking for -some free space if anything got changed between reads of /dev/kmem. -If you get occasional inconsistant results, ignore 'em. - -Feel free to send bug reports, flames, etc., to: - -Kevin Lahey -kml@rokkaku.atl.ga.us diff --git a/usr.sbin/swapinfo/devname.c b/usr.sbin/swapinfo/devname.c deleted file mode 100644 index 5f2815d30b8f..000000000000 --- a/usr.sbin/swapinfo/devname.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)devname.c 5.14 (Berkeley) 5/6/91"; -#endif /* LIBC_SCCS and not lint */ - -#include <sys/types.h> -#include <fcntl.h> -#include <db.h> -#include <stdio.h> -#include <paths.h> - -char * -devname(dev, type) - dev_t dev; - mode_t type; -{ - struct { - mode_t type; - dev_t dev; - } bkey; - static DB *db; - static int failure; - DBT data, key; - - if (!db && !failure && - !(db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL))) { - (void)fprintf(stderr, - "warning: no device database %s\n", _PATH_DEVDB); - failure = 1; - } - if (failure) - return("??"); - - /* - * Keys are a mode_t followed by a dev_t. The former is the type of - * the file (mode & S_IFMT), the latter is the st_rdev field. - */ - bkey.dev = dev; - bkey.type = type; - key.data = &bkey; - key.size = sizeof(bkey); - return((db->get)(db, &key, &data, 0L) ? "??" : (char *)data.data); -} diff --git a/usr.sbin/swapinfo/swapinfo.1 b/usr.sbin/swapinfo/swapinfo.1 deleted file mode 100644 index 54e89c547c8f..000000000000 --- a/usr.sbin/swapinfo/swapinfo.1 +++ /dev/null @@ -1,53 +0,0 @@ -.\" -.\" swapinfo -.\" -.Dd February 23, 1993 -.Dt SWAPINFO 1 -.Sh NAME -.Nm swapinfo -.Nd display free swap space -.Sh SYNOPSIS -.Nm swapinfo -.Op Fl k -.Sh DESCRIPTION -.Nm Swapinfo -displays statistics about the amount of free swap space on all of the -swap areas compiled into the kernel. -.Pp -The following options are available: -.Bl -tag -width Ds -.It Fl k -By default, all sizes are reported in 512-byte block counts. -The -.Fl k -option causes the numbers to be reported in kilobyte counts. -.El -.Sh STATISTICS -Statistics are reported for all swap partitions configured into the kernel. -The first column is the device name of the partition. The next column is -the total space available in the partition. The -.Ar Used -column indicates the total blocks used so far; the -.Ar Available -column indicates how much space is remaining on each partition. -The -.Ar Capacity -reports the percentage of space used. -.Pp -If more than one partition is configured into the system, totals for all -of the statistics will be reported in the final line of the report. -.Sh "BUGS AND CAVEATS" -The information reported by -.Nm swapinfo -is stored in the kernel in a linked list. Since we are merely reading -this list out of kernel memory, it is entirely possible that the list could -change as we try to read it. Suspicious and unrepeatable values are probably -incorrect. -.Pp -Statistics are reported for all swap partitions compiled into the kernel, -regardless of whether those partitions are being used. -.Sh AUTHOR -.RS -Kevin Lahey -.br -kml@rokkaku.atl.ga.us diff --git a/usr.sbin/swapinfo/swapinfo.c b/usr.sbin/swapinfo/swapinfo.c deleted file mode 100644 index 811a9366688b..000000000000 --- a/usr.sbin/swapinfo/swapinfo.c +++ /dev/null @@ -1,214 +0,0 @@ -/* - * swapinfo - * - * Swapinfo will provide some information about the state of the swap - * space for the system. It'll determine the number of swap areas, - * their original size, and their utilization. - * - * Kevin Lahey, February 16, 1993 - */ - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/conf.h> -#include <sys/rlist.h> -#include <nlist.h> -#include <kvm.h> -#include <limits.h> - -struct rlist *swaplist; - -static struct nlist nl[] = {{"_swaplist"}, /* list of free swap areas */ -#define VM_SWAPMAP 0 - {"_swdevt"}, /* list of swap devices and sizes */ -#define VM_SWDEVT 1 - {"_nswap"}, /* size of largest swap device */ -#define VM_NSWAP 2 - {"_nswdev"}, /* number of swap devices */ -#define VM_NSWDEV 3 - {"_dmmax"}, /* maximum size of a swap block */ -#define VM_DMMAX 4 - {""}}; - -char *getbsize __P((int *, long *)); -void usage __P((void)); - -main (argc, argv) -int argc; -char **argv; -{ - int i, total_avail, total_free, total_partitions, *by_device, - nswap, nswdev, dmmax, ch; - struct swdevt *swdevt; - struct rlist head; - static long blocksize; - static int headerlen; - static char *header; - kvm_t *kd; - char errbuf[_POSIX2_LINE_MAX]; - - /* We are trying to be simple here: */ - - while ((ch = getopt(argc, argv, "k")) != EOF) - switch(ch) { - case 'k': - putenv("BLOCKSIZE=1k"); - break; - case '?': - default: - usage(); - } - - /* Open up /dev/kmem for reading. */ - - kd = kvm_openfiles((char *)NULL, (char *)NULL, (char *)NULL, 0, errbuf); - if (kd == NULL) { - fprintf (stderr, "%s: kvm_openfiles: %s\n", - argv [0], errbuf); - exit (1); - } - - /* Figure out the offset of the various structures we'll need. */ - - if (kvm_nlist(kd, nl) == -1) { - fprintf (stderr, "%s: kvm_nlist: %s\n", - argv [0], kvm_geterr(kd)); - exit (1); - } - - if (kvm_read(kd, nl[VM_NSWAP].n_value, &nswap, sizeof (nswap)) != - sizeof (nswap)) { - fprintf (stderr, "%s: didn't read all of nswap\n", - argv [0]); - exit (5); - } - - if (kvm_read(kd, nl[VM_NSWDEV].n_value, &nswdev, sizeof (nswdev)) != - sizeof (nswdev)) { - fprintf (stderr, "%s: didn't read all of nswdev\n", - argv [0]); - exit (5); - } - - if (kvm_read(kd, nl[VM_DMMAX].n_value, &dmmax, sizeof (dmmax)) != - sizeof (dmmax)) { - fprintf (stderr, "%s: didn't read all of dmmax\n", - argv [0]); - exit (5); - } - - if ((swdevt = malloc (sizeof (struct swdevt) * nswdev)) == NULL || - (by_device = calloc (sizeof (*by_device), nswdev)) == NULL) { - perror ("malloc"); - exit (5); - } - - if (kvm_read(kd, nl[VM_SWDEVT].n_value, swdevt, - sizeof (struct swdevt) * nswdev) != - sizeof (struct swdevt) * nswdev) { - fprintf (stderr, "%s: didn't read all of swdevt\n", - argv [0]); - exit (5); - } - - if (kvm_read(kd, nl[0].n_value, &swaplist, sizeof (struct rlist *)) != - sizeof (struct rlist *)) { - fprintf (stderr, "%s: didn't read all of swaplist\n", - argv [0]); - exit (5); - } - - /* Traverse the list of free swap space... */ - - total_free = 0; - while (swaplist) { - int top, bottom, next_block; - - if (kvm_read(kd, (long) swaplist, &head, sizeof (struct rlist )) != - sizeof (struct rlist )) { - fprintf (stderr, "%s: didn't read all of head\n", - argv [0]); - exit (5); - } - - top = head.rl_end; - bottom = head.rl_start; - - total_free += top - bottom + 1; - - /* - * Swap space is split up among the configured disk. - * The first dmmax blocks of swap space some from the - * first disk, the next dmmax blocks from the next, - * and so on. The list of free space joins adjacent - * free blocks, ignoring device boundries. If we want - * to keep track of this information per device, we'll - * just have to extract it ourselves. - */ - - while (top / dmmax != bottom / dmmax) { - next_block = ((bottom + dmmax) / dmmax); - by_device [(bottom / dmmax) % nswdev] += - next_block * dmmax - bottom; - bottom = next_block * dmmax; - } - - by_device [(bottom / dmmax) % nswdev] += - top - bottom + 1; - - swaplist = head.rl_next; - } - - header = getbsize(&headerlen, &blocksize); - printf ("%-10s %10s %10s %10s %10s\n", - "Device", header, "Used", "Available", "Capacity"); - for (total_avail = total_partitions = i = 0; i < nswdev; i++) { - printf ("/dev/%-5s %10d ", - devname (swdevt [i].sw_dev, S_IFBLK), - swdevt [i].sw_nblks / (blocksize/512)); - - /* - * Don't report statistics for partitions which have not - * yet been activated via swapon(8). - */ - - if (!swdevt [i].sw_freed) { - printf (" *** not available for swapping ***\n"); - } else { - total_partitions++; - total_avail += swdevt [i].sw_nblks; - printf ("%10d %10d %7.0f%%\n", - (swdevt [i].sw_nblks - by_device [i]) / (blocksize/512), - by_device [i] / (blocksize/512), - (double) (swdevt [i].sw_nblks - - by_device [i]) / - (double) swdevt [i].sw_nblks * 100.0); - } - } - - /* - * If only one partition has been set up via swapon(8), we don't - * need to bother with totals. - */ - - if (total_partitions > 1) - printf ("%-10s %10d %10d %10d %7.0f%%\n", "Total", - total_avail / (blocksize/512), - (total_avail - total_free) / (blocksize/512), - total_free / (blocksize/512), - (double) (total_avail - total_free) / - (double) total_avail * 100.0); - - exit (0); -} - -void -usage() -{ - (void)fprintf(stderr, "usage: swapinfo [-k]\n"); - exit(1); -} - - diff --git a/usr.sbin/tcpdump/tcpdump/tcplex.l b/usr.sbin/tcpdump/tcpdump/tcplex.l deleted file mode 100644 index 3db8a32f33c4..000000000000 --- a/usr.sbin/tcpdump/tcpdump/tcplex.l +++ /dev/null @@ -1,144 +0,0 @@ -%{ -/* - * Copyright (c) 1988-1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that: (1) source code distributions - * retain the above copyright notice and this paragraph in its entirety, (2) - * distributions including binary code include the above copyright notice and - * this paragraph in its entirety in the documentation or other materials - * provided with the distribution, and (3) all advertising materials mentioning - * features or use of this software display the following acknowledgement: - * ``This product includes software developed by the University of California, - * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of - * the University nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifndef lint -static char rcsid[] = - "@(#) $Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/tcplex.l,v 1.1.1.1 1993/06/12 14:42:05 rgrimes Exp $ (LBL)"; -#endif - -/* - * Compiling with gcc under SunOS will cause problems unless we have this - * cruft here. The flex skeleton includes stddef.h which defines these types - * (under gcc). They will conflict with Sun's definitions in sys/types.h. - */ -#define size_t xxxsize_t -#define ptrdiff_t xxxptrdiff_t -#define wchar_t xxxwchar_t -#include <sys/types.h> -#undef size_t -#undef ptrdiff_t -#undef wchar_t - -#include "nametoaddr.h" - -/* - * We need bpf since enum bpf_code is in YYSTYPE. - */ -#include <sys/time.h> -#include <net/bpf.h> - -#include "gencode.h" -#include "y.tab.h" /* "tokdefs.h" */ - -#ifdef FLEX_SCANNER -#undef YY_INPUT -#define YY_INPUT(buf, result, max)\ - {\ - char *src = in_buffer;\ - int i;\ -\ - if (*src == 0)\ - result = YY_NULL;\ - else {\ - for (i = 0; *src && i < max; ++i)\ - buf[i] = *src++;\ - in_buffer += i;\ - result = i;\ - }\ - } -#else -#undef getc -#define getc(fp) (*in_buffer == 0 ? EOF : *in_buffer++) -#endif - -extern YYSTYPE yylval; -static char *in_buffer; - -%} - -N ([0-9]+|(0X|0x)[0-9A-Fa-f]+) -B ([0-9A-Fa-f][0-9A-Fa-f]?) - -%a 3000 - -%% -dst return DST; -src return SRC; - -link|ether|ppp|slip return LINK; -arp return ARP; -rarp return RARP; -ip return IP; -tcp return TCP; -udp return UDP; -icmp return ICMP; - -host return HOST; -net return NET; -port return PORT; -proto return PROTO; - -gateway return GATEWAY; - -less return LESS; -greater return GREATER; -byte return BYTE; -broadcast return TK_BROADCAST; -multicast return TK_MULTICAST; - -and return AND; -or return OR; -not return '!'; - -len return LEN; - -[ \n\t] ; -[+\-*/:\[\]!<>()&|=] return yytext[0]; -">=" return GEQ; -"<=" return LEQ; -"!=" return NEQ; -"==" return '='; -"<<" return LSH; -">>" return RSH; -{N} { yylval.i = stoi(yytext); return NUM; } -({N}\.{N})|({N}\.{N}\.{N})|({N}\.{N}\.{N}\.{N}) { - yylval.h = atoin(yytext); return HID; -} -{B}:{B}:{B}:{B}:{B}:{B} { yylval.e = ETHER_aton(yytext); return EID; } -{B}:+({B}:+)+ { error("bogus ethernet address %s", yytext); } -[A-Za-z][-_.A-Za-z0-9]* { yylval.s = yytext; return ID; } -"\\"[^ !()\n\t]+ { yylval.s = yytext + 1; return ID; } -[^ \[\]\t\n\-_.A-Za-z0-9!<>()&|=]+ { error("illegal token: %s\n", yytext); } -. { error("illegal char '%c'", *yytext); } -%% -void -lex_init(buf) - char *buf; -{ - in_buffer = buf; -} -int -yywrap() -/* so we don't need -ll */ -{ - return 1; -} diff --git a/usr.sbin/tzsetup/tzsetup.sh b/usr.sbin/tzsetup/tzsetup.sh deleted file mode 100644 index f3d9431a1ffe..000000000000 --- a/usr.sbin/tzsetup/tzsetup.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/bin/sh -# $Id: tzsetup.sh,v 1.3 1994/11/02 00:00:17 ache Exp $ -# -# Copyright 1994, Garrett A. Wollman. All rights reserved. -# This script is subject to the terms and conditions listed at the -# end. -# - -ask() { - while true; do - echo -n "$1" "(${2-no default}) " - read ans - if [ -z "$ans" ]; then - ans="$2" - fi - if [ -z "$ans" ]; then - echo 'An empty response is not valid.' - continue - fi - return 0 - done -} - -askyn() { - while : ; do - ask "$1 [yn]?" $2 - case $ans in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - done -} - -select() { - where=$1 - while true; do - echo "Please select a location from the following list which" - echo "has the same legal time as your location:" - echo "" - ls -C /usr/share/zoneinfo/$where - echo "" - echo "Type \`\`exit'' to return to the main menu." - ask "Your choice:" exit - if [ "$ans" = "exit" ]; then return 0; fi - city="$ans" - if [ -r /usr/share/zoneinfo/$where/$city ]; then - echo -n "I think the time in `echo $city | tr _ ' '` is: " - TZ=$where/$city date - if askyn "Is this what you wanted" y; then - rm -f /etc/localtime - cp /usr/share/zoneinfo/$where/$city \ - /etc/localtime && echo "Timezone changed." - return 0 - fi - fi - done -} - -setadjkerntz() { - cat << EOF - -You can configure your system to assume that the battery-backed CMOS -clock is set to your local legal time rather than Universal or -Greenwich time. When the system boots, the \`adjkerntz' program will -examine your current time, reverse-apply the timezone correction, and -then set the system's UTC time to the corrected value. This approach -is NOT guaranteed to always work; in particular, if you reboot your -system during the transition from or to summer time, the calculation -is sometimes impossible, and wierd things may result. - -For this reason, we recommend that, unless you absolutely positively -must leave your CMOS clock on local time, you set your CMOS clock to GMT. - -EOF - if [ -f /etc/wall_cmos_clock ]; then - curr=y - echo "This system is currently set up for local CMOS time." - else - curr=n - echo "This system is currently set up for GMT CMOS time." - fi - if askyn "Do you want a local CMOS clock" $curr; then - touch /etc/wall_cmos_clock - if [ $curr = "n" ] && askyn "Start now" y; then - /sbin/adjkerntz -i - fi - else - rm -f /etc/wall_cmos_clock - fi - echo "Done." -} - -mainmenu() { - set `TZ= date` - if askyn "Is $4, $1 $2 $3 $6 the correct current date and time" n; then - cat << EOF - -Unless your local time is GMT, this probably means that your CMOS -clock is on local time. In this case, the local times that you will -be shown will be incorrect. You should either set your CMOS clock to -GMT, or select option 98 from the main menu after selecting a -timezone. - -EOF - echo -n "Press return to continue ==>" - read junk - fi - - while true; do - cat <<EOH - - - Pick the item that best describes your location: - - 1) Africa - 2) North, South, Central America (includes Greenland) - 3) Atlantic Ocean islands - 4) Asia and the Middle East - 5) Australia - 6) Europe - 7) Indian Ocean islands - 8) Pacific islands (includes Hawaii) - - 98) Select CMOS time status (UTC or local) - 99) Exit this menu - -EOH - ask 'Your choice?' 99 - case $ans in - 1) select Africa;; - 2) select America;; - 3) select Atlantic;; - 4) select Asia;; - 5) select Australia;; - 6) select Europe;; - 7) select Indian;; - 8) select Pacific;; - 9) select Etc;; - 10) select SystemV;; - 98) setadjkerntz;; - 99) return 0;; - esac - done -} - -cat <<EOH -Welcome to `sysctl -n kern.ostype` `sysctl -n kern.osrelease`! - -This program will help you select a default timezone for your users and -for system processes. - -EOH -echo -n 'Press return to continue ==>' -read return - -mainmenu -exit 0 -# -# Copyright (c) 1994 Garrett A. Wollman. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -# SUCH DAMAGE. -# diff --git a/usr.sbin/xntpd/xntpres/Makefile b/usr.sbin/xntpd/xntpres/Makefile deleted file mode 100644 index fc410474f1c6..000000000000 --- a/usr.sbin/xntpd/xntpres/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# $Id: Makefile,v 1.1 1993/12/21 20:38:27 wollman Exp $ -# - -CFLAGS+= -I${.CURDIR}/../include - -.if exists(${.CURDIR}/../lib/obj) -LDADD+= -L${.CURDIR}/../lib/obj -DPADD+= -L${.CURDIR}/../lib/obj/libntp.a -.else -LDADD+= -L${.CURDIR}/../lib -DPADD+= -L${.CURDIR}/../lib/libntp.a -.endif - -LDADD+= -lntp - -PROG= xntpres -NOMAN= -CLEANFILES+= .version version.c - -SRCS= xntpres.c version.c - -beforedepend: version.c - -version.c: ${.CURDIR}/../VERSION - ${.CURDIR}/../scripts/mkversion xntpres - -.include <bsd.prog.mk> diff --git a/usr.sbin/xten/Install.notes b/usr.sbin/xten/Install.notes deleted file mode 100644 index 9725ba402b58..000000000000 --- a/usr.sbin/xten/Install.notes +++ /dev/null @@ -1,222 +0,0 @@ -Installation Notes for X-10 software -Eugene W. Stark (stark@cs.sunysb.edu) -October 30, 1993 - -The TW523 is a carrier-current modem for home control/automation purposes. -It is made by: - - X-10 Inc. - 185A LeGrand Ave. - Northvale, NJ 07647 - USA - (201) 784-9700 or 1-800-526-0027 - - X-10 Home Controls Inc. - 1200 Aerowood Drive, Unit 20 - Mississauga, Ontario - (416) 624-4446 or 1-800-387-3346 - -The TW523 is designed for communications using the X-10 protocol, -which is compatible with a number of home control systems, including -Radio Shack "Plug 'n Power(tm)" and Stanley "Lightmaker(tm)." -I bought my TW523 from: - - Home Control Concepts - 9353-C Activity Road - San Diego, CA 92126 - (619) 693-8887 - -They supplied me with the TW523 (which has an RJ-11 four-wire modular -telephone connector), a modular cable, an RJ-11 to DB-25 connector with -internal wiring, documentation from X-10 on the TW523 (very good), -an instruction manual by Home Control Concepts (not very informative), -and a floppy disk containing binary object code of some demonstration/test -programs and of a C function library suitable for controlling the TW523 -by an IBM PC under MS-DOS (not useful to me other than to verify that -the unit worked). I suggest saving money and buying the bare TW523 -rather than the TW523 development kit (what I bought), because if you -are running 386BSD you don't really care about the DOS binaries. -For details on the X-10 protocol itself, refer to the documentation from -X-10 Inc. - -The interface to the TW-523 consists of four wires on the RJ-11 connector, -which are jumpered to somewhat more wires on the DB-25 connector, which -in turn is intended to plug into the PC parallel printer port. I dismantled -the DB-25 connector to find out what they had done: - - Signal RJ-11 pin DB-25 pin(s) Parallel Port - Transmit TX 4 (Y) 2, 4, 6, 8 Data out - Receive RX 3 (G) 10, 14 -ACK, -AutoFeed - Common 2 (R) 25 Common - Zero crossing 1 (B) 17 -Select Input - -I use the TW-523 and this software in the USA with 120V/60Hz power. -Phil Sampson (vk2jnt@gw.vk2jnt.ampr.org OR sampson@gidday.enet.dec.com) -in Australia has reported success in using a TW-7223 (a local version -of the TW-523) and Tandy modules with this software under 240V/50Hz power. -For reasons explained in the comments in the driver, it will probably not -work if you have three-phase power, but this is usually not the case for -normal residences and offices. - - -1. Installing the TW523 Device Driver - -I assume that you are running FreeBSD. If you are running some other -system, you are more or less on your own, though I can try to help if you -have problems. - -Check the configuration parameters at the beginning of the file - - /sys/i386/isa/tw.c - -Probably the only thing you might need to change is to change the -definition of HALFCYCLE from 8333 to 10000 if you are using 50Hz power. -The driver assumes that the TW523 device is connected to a parallel port. -See the comments near the beginning of the file to find out where to -get a TW523 if you don't have one, and how to make a cable for it to -connect to your parallel port. - -Add a line like the following - - device tw0 at isa? port 0x278 tty irq 5 vector twintr - -to /sys/i386/conf/YOURSYSTEM, but make sure to change the I/O port and -interrupt to match your hardware configuration. - -Cd to /sys/i386/conf and do "config YOURSYSTEM". -Cd to /sys/compile/YOURSYSTEM and do "make depend", then "make". -(If you have any troubles, I suggest starting fresh by doing a full -"make clean; make depend; make".) Assuming the make works correctly, do - - mv /386bsd /386bsd.old - mv 386bsd /386bsd - -(If you are not a trusting person, or you don't have any spare fixit -floppies with working kernels lying around, don't do this without testing -the kernel first by copying it to a fixit floppy and booting from that.) - -Reboot the system. You should see a line indicating that the TW523 has -been configured as the system comes up. If you see this line, then probably -everything is going to work OK, because the TW523 will only get configured -if the driver is able to sync to the power line. If the TW523 is not plugged -in, or the driver is not getting sync for some reason, then you won't see -any message on bootup. - -NOTE: I have received a report that some multi IDE/SIO/PARALLEL cards -"cheat" and use TTL outputs rather than pullup open collector outputs, -and this can mess up the scheme by which sync gets to the driver. -If you are having trouble getting the driver to work, you might want to -look into this possibility. - -In directory /dev, execute the command - - MAKEDEV tw0 - - -2. Installing the X-10 Daemon - -Go to the xten source directory (probably /usr/src/contrib/xten). -Check over the file "paths.h", if desired, to make sure that the entries -are reasonable for your system. On my system, I have a special UID "xten" -for the daemon. If you want to do this, too, you will have to add this UID -to your /etc/master.passwd in the usual way. Otherwise, use "root" or -"daemon" or something. You should change the ownership of /dev/tw0 to -match this UID, so that the daemon will be able to access the TW-523. -Edit the file Makefile.inc in the source directory to specify this UID: - - xtenuser= xten - -Then run "make". If everything is OK, run - - make install - -This should install the daemon "xtend" and the command "xten". - -Make sure the directory /var/spool/xten exists and is owned by the UID -you selected above. This directory is used by the daemon for its log and -device status files. When it is run, the daemon will also create a socket -/var/run/tw523 and it will put its pid in /var/run/xtend.pid so that it can -be signalled from shell scripts. - -Add the following lines to your /etc/rc.local file: - - if [ -x /usr/libexec/xtend ]; then - echo -n ' xtend'; /usr/libexec/xtend - fi - -This will cause the X-10 daemon to be invoked automatically when you boot -the system. To test the installation, you can either reboot now, or -you can just run "xtend" by hand. The daemon should start up, and it should -create files in /var/spool/xten. Check the file /var/spool/xten/Log to -make sure that the daemon started up without any errors. - -Now you are ready to start trying X-10 commands. Try doing - - xten A 1 Off - xten A 1 On 1 Dim:10 - -etc. The "xten" program expects a house code as its first argument, then -a series of key codes, which are either unit names ("1" through "16") or -else are command names. You can find the list of command names by looking -at the table in the file "xten.c". Each key code can optionally be followed -by a colon : then a number specifying the number of times that command is -to be transmitted without gaps between packets. The default is 2, and this -is the normal case, but some commands like Bright and Dim are designed to -be transmitted with counts other than 2. See the X-10 documentation for -more detail. - -The "xten" program works by connecting to "xtend" through a socket, and -asking that the X-10 codes be transmitted over the TW523. All activity -on the TW523 is logged by the daemon in /var/spool/xten/Log. The daemon -also attempts to track the state of all devices. (Of course, most X-10 -devices do not transmit when they are operated manually, so if somebody -operates a device manually there is no way the X-10 daemon will know -about it.) - -3. Low-level Programming of the TW523 Driver - -Normally, you would never operate the TW523 directly, rather you would -use the shell command "xten" or you would connect to "xtend" through its -socket. However, if you don't want to run "xtend", you can manipulate -the TW523 directly through the device /dev/tw0. Have a look at the -xtend code for a programming example. - -The driver supports read(), write(), and select() system calls. -The driver allows multiple processes to read and write simultaneously, -but there is probably not much sense in having more than one reader or more -than one writer at a time, and in fact there may currently be a race -condition in the driver if two processes try to transmit simultaneously -(due to unsynchronized access to the sc_pkt structure in tw_sc). - -Transmission is done by calling write() to send three byte packets of data. -The first byte contains a four bit house code (0=A to 15=P). The second byte -contains five bit unit/key code (0=unit 1 to 15=unit 16, 16=All Units Off -to 31 = Status Request). The third byte specifies the number of times the -packet is to be transmitted without any gaps between successive transmissions. -Normally this is 2, as per the X-10 documentation, but sometimes (e.g. for -bright and dim codes) it can be another value. Each call to write can specify -an arbitrary number of data bytes, but at most one packet will actually be -processed in any call. Any incomplete packet is buffered until a subsequent -call to write() provides data to complete it. Successive calls to write() -leave a three-cycle gap between transmissions, per the X-10 documentation. -The driver transmits each bit only once per half cycle, not three times as -the X-10 documentation states, because the TW523 only provides sync on -each power line zero crossing. So, the driver will probably not work -properly if you have three-phase service. Most residences use a two-wire -system, for which the driver does work. - -Reception is done using read(). The driver produces a series of three -character packets. In each packet, the first character consists of flags, -the second character is a four bit house code (0-15), and the third character -is a five bit key/function code (0-31). The flags are the following: - -#define TW_RCV_LOCAL 1 /* The packet arrived during a local transmission */ -#define TW_RCV_ERROR 2 /* An invalid/corrupted packet was received */ - -The select() system call can be used in the usual way to determine if there -is data ready for reading. - - - Happy Controlling! - Gene Stark - stark@cs.sunysb.edu |