Remove trailing whitespace.
This commit is contained in:
parent
6c06b4e2aa
commit
5ebc7e6281
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8871
@ -40,7 +40,7 @@
|
||||
* to require a specific license from the United States Government.
|
||||
* It is the responsibility of any person or organization contemplating
|
||||
* export to obtain such a license before exporting.
|
||||
*
|
||||
*
|
||||
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
||||
* distribute this software and its documentation for any purpose and
|
||||
* without fee is hereby granted, provided that the above copyright
|
||||
|
@ -467,7 +467,7 @@ auth_send(data, cnt)
|
||||
* We requested strong authentication, however no mechanisms worked.
|
||||
* Therefore, exit on client end.
|
||||
*/
|
||||
printf("Unable to securely authenticate user ... exit\n");
|
||||
printf("Unable to securely authenticate user ... exit\n");
|
||||
exit(0);
|
||||
#endif /* KANNAN */
|
||||
}
|
||||
|
@ -580,7 +580,7 @@ fb64_stream_key(key, stp)
|
||||
* INPUT --(--------->(+)+---> DATA
|
||||
* | |
|
||||
* +-------------+
|
||||
*
|
||||
*
|
||||
*
|
||||
* Given:
|
||||
* iV: Initial vector, 64 bits (8 bytes) long.
|
||||
@ -641,7 +641,7 @@ cfb64_decrypt(data)
|
||||
des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1);
|
||||
bcopy((void *)b, (void *)stp->str_feed, sizeof(Block));
|
||||
stp->str_index = 1; /* Next time will be 1 */
|
||||
index = 0; /* But now use 0 */
|
||||
index = 0; /* But now use 0 */
|
||||
}
|
||||
|
||||
/* On decryption we store (data) which is cypher. */
|
||||
@ -714,7 +714,7 @@ ofb64_decrypt(data)
|
||||
des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1);
|
||||
bcopy((void *)b, (void *)stp->str_feed, sizeof(Block));
|
||||
stp->str_index = 1; /* Next time will be 1 */
|
||||
index = 0; /* But now use 0 */
|
||||
index = 0; /* But now use 0 */
|
||||
}
|
||||
|
||||
return(data ^ stp->str_feed[index]);
|
||||
|
@ -106,7 +106,7 @@ static long remote_supports_decrypt = 0;
|
||||
static Encryptions encryptions[] = {
|
||||
#ifdef DES_ENCRYPTION
|
||||
{ "DES_CFB64", ENCTYPE_DES_CFB64,
|
||||
cfb64_encrypt,
|
||||
cfb64_encrypt,
|
||||
cfb64_decrypt,
|
||||
cfb64_init,
|
||||
cfb64_start,
|
||||
@ -116,7 +116,7 @@ static Encryptions encryptions[] = {
|
||||
cfb64_keyid,
|
||||
cfb64_printsub },
|
||||
{ "DES_OFB64", ENCTYPE_DES_OFB64,
|
||||
ofb64_encrypt,
|
||||
ofb64_encrypt,
|
||||
ofb64_decrypt,
|
||||
ofb64_init,
|
||||
ofb64_start,
|
||||
@ -708,7 +708,7 @@ encrypt_request_end()
|
||||
* Called when ENCRYPT REQUEST-START is received. If we receive
|
||||
* this before a type is picked, then that indicates that the
|
||||
* other side wants us to start encrypting data as soon as we
|
||||
* can.
|
||||
* can.
|
||||
*/
|
||||
void
|
||||
encrypt_request_start(data, cnt)
|
||||
@ -851,7 +851,7 @@ encrypt_start_output(type)
|
||||
i = (*ep->start)(DIR_ENCRYPT, Server);
|
||||
if (encrypt_debug_mode) {
|
||||
printf(">>>%s: Encrypt start: %s (%d) %s\r\n",
|
||||
Name,
|
||||
Name,
|
||||
(i < 0) ? "failed" :
|
||||
"initial negotiation in progress",
|
||||
i, ENCTYPE_NAME(type));
|
||||
|
@ -177,7 +177,7 @@ kerberos4_send(ap)
|
||||
CREDENTIALS cred;
|
||||
int r;
|
||||
|
||||
printf("[ Trying KERBEROS4 ... ]\n");
|
||||
printf("[ Trying KERBEROS4 ... ]\n");
|
||||
if (!UserNameRequested) {
|
||||
if (auth_debug_mode) {
|
||||
printf("Kerberos V4: no user name supplied\r\n");
|
||||
@ -245,7 +245,7 @@ kerberos4_send(ap)
|
||||
des_ecb_encrypt(challenge, challenge, sched, 1);
|
||||
}
|
||||
#endif /* ENCRYPTION */
|
||||
|
||||
|
||||
if (auth_debug_mode) {
|
||||
printf("CK: %d:", kerberos4_cksum(auth.dat, auth.length));
|
||||
printd(auth.dat, auth.length);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Source: /home/ncvs/src/lib/libtelnet/kerberos5.c,v $
|
||||
* $Author: rgrimes $
|
||||
* $Id: kerberos5.c,v 1.1.1.1 1994/05/27 05:00:20 rgrimes Exp $
|
||||
* $Source: /home/ncvs/src/secure/lib/libtelnet/kerberos5.c,v $
|
||||
* $Author: csgr $
|
||||
* $Id: kerberos5.c,v 1.1.1.1 1994/08/12 22:02:59 csgr Exp $
|
||||
*/
|
||||
|
||||
#if !defined(lint) && !defined(SABER)
|
||||
@ -9,7 +9,7 @@ static
|
||||
#ifdef __STDC__
|
||||
const
|
||||
#endif
|
||||
char rcsid_kerberos5_c[] = "$Id: kerberos5.c,v 1.1.1.1 1994/05/27 05:00:20 rgrimes Exp $";
|
||||
char rcsid_kerberos5_c[] = "$Id: kerberos5.c,v 1.1.1.1 1994/08/12 22:02:59 csgr Exp $";
|
||||
#endif /* lint */
|
||||
|
||||
/*-
|
||||
@ -84,7 +84,7 @@ static char sccsid[] = "@(#)kerberos5.c 8.2 (Berkeley) 12/15/93";
|
||||
|
||||
/* kerberos 5 include files (ext-proto.h) will get an appropriate stdlib.h
|
||||
and string.h/strings.h */
|
||||
|
||||
|
||||
#include "encrypt.h"
|
||||
#include "auth.h"
|
||||
#include "misc.h"
|
||||
@ -204,7 +204,7 @@ kerberos5_send(ap)
|
||||
ksum.contents = sum;
|
||||
ksum.length = sizeof(sum);
|
||||
bzero((Voidptr )sum, sizeof(sum));
|
||||
|
||||
|
||||
if (!UserNameRequested) {
|
||||
if (auth_debug_mode) {
|
||||
printf("Kerberos V5: no user name supplied\r\n");
|
||||
@ -254,7 +254,7 @@ kerberos5_send(ap)
|
||||
krb5_free_host_realm(realms);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bzero((char *)&creds, sizeof(creds));
|
||||
creds.server = server;
|
||||
@ -284,7 +284,7 @@ kerberos5_send(ap)
|
||||
ap_opts = AP_OPTS_MUTUAL_REQUIRED;
|
||||
else
|
||||
ap_opts = 0;
|
||||
|
||||
|
||||
r = krb5_mk_req_extended(ap_opts, &ksum, krb5_kdc_default_options, 0,
|
||||
#ifdef ENCRYPTION
|
||||
&newkey,
|
||||
@ -441,7 +441,7 @@ kerberos5_is(ap, data, cnt)
|
||||
goto errout;
|
||||
}
|
||||
Data(ap, KRB_RESPONSE, outbuf.data, outbuf.length);
|
||||
}
|
||||
}
|
||||
if (krb5_unparse_name(authdat->ticket->enc_part2 ->client,
|
||||
&name))
|
||||
name = 0;
|
||||
@ -451,7 +451,7 @@ kerberos5_is(ap, data, cnt)
|
||||
name ? name : "");
|
||||
}
|
||||
auth_finished(ap, AUTH_USER);
|
||||
|
||||
|
||||
free(name);
|
||||
if (authdat->authenticator->subkey &&
|
||||
authdat->authenticator->subkey->keytype == KEYTYPE_DES) {
|
||||
@ -463,7 +463,7 @@ kerberos5_is(ap, data, cnt)
|
||||
(Voidptr )session_key, sizeof(Block));
|
||||
} else
|
||||
break;
|
||||
|
||||
|
||||
#ifdef ENCRYPTION
|
||||
skey.type = SK_DES;
|
||||
skey.length = 8;
|
||||
@ -475,17 +475,17 @@ kerberos5_is(ap, data, cnt)
|
||||
case KRB_FORWARD:
|
||||
inbuf.data = (char *)data;
|
||||
inbuf.length = cnt;
|
||||
if (r = rd_and_store_for_creds(&inbuf, authdat->ticket,
|
||||
if (r = rd_and_store_for_creds(&inbuf, authdat->ticket,
|
||||
UserNameRequested)) {
|
||||
char errbuf[128];
|
||||
|
||||
|
||||
(void) strcpy(errbuf, "Read forwarded creds failed: ");
|
||||
(void) strcat(errbuf, error_message(r));
|
||||
Data(ap, KRB_FORWARD_REJECT, errbuf, -1);
|
||||
if (auth_debug_mode)
|
||||
printf("Could not read forwarded credentials\r\n");
|
||||
}
|
||||
else
|
||||
else
|
||||
Data(ap, KRB_FORWARD_ACCEPT, 0, 0);
|
||||
if (auth_debug_mode)
|
||||
printf("Forwarded credentials obtained\r\n");
|
||||
@ -690,16 +690,16 @@ kerberos5_forward(ap)
|
||||
krb5_ccache ccache;
|
||||
int i;
|
||||
|
||||
if (!(local_creds = (krb5_creds *)
|
||||
if (!(local_creds = (krb5_creds *)
|
||||
calloc(1, sizeof(*local_creds)))) {
|
||||
if (auth_debug_mode)
|
||||
if (auth_debug_mode)
|
||||
printf("Kerberos V5: could not allocate memory for credentials\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (r = krb5_sname_to_principal(RemoteHostName, "host", 1,
|
||||
&local_creds->server)) {
|
||||
if (auth_debug_mode)
|
||||
if (auth_debug_mode)
|
||||
printf("Kerberos V5: could not build server name - %s\r\n",
|
||||
error_message(r));
|
||||
krb5_free_creds(local_creds);
|
||||
@ -707,7 +707,7 @@ kerberos5_forward(ap)
|
||||
}
|
||||
|
||||
if (r = krb5_cc_default(&ccache)) {
|
||||
if (auth_debug_mode)
|
||||
if (auth_debug_mode)
|
||||
printf("Kerberos V5: could not get default ccache - %s\r\n",
|
||||
error_message(r));
|
||||
krb5_free_creds(local_creds);
|
||||
@ -715,7 +715,7 @@ kerberos5_forward(ap)
|
||||
}
|
||||
|
||||
if (r = krb5_cc_get_principal(ccache, &local_creds->client)) {
|
||||
if (auth_debug_mode)
|
||||
if (auth_debug_mode)
|
||||
printf("Kerberos V5: could not get default principal - %s\r\n",
|
||||
error_message(r));
|
||||
krb5_free_creds(local_creds);
|
||||
@ -724,7 +724,7 @@ kerberos5_forward(ap)
|
||||
|
||||
/* Get ticket from credentials cache */
|
||||
if (r = krb5_get_credentials(KRB5_GC_CACHED, ccache, local_creds)) {
|
||||
if (auth_debug_mode)
|
||||
if (auth_debug_mode)
|
||||
printf("Kerberos V5: could not obtain credentials - %s\r\n",
|
||||
error_message(r));
|
||||
krb5_free_creds(local_creds);
|
||||
@ -738,13 +738,13 @@ kerberos5_forward(ap)
|
||||
&local_creds->keyblock,
|
||||
forward_flags & OPTS_FORWARDABLE_CREDS,
|
||||
&forw_creds)) {
|
||||
if (auth_debug_mode)
|
||||
if (auth_debug_mode)
|
||||
printf("Kerberos V5: error getting forwarded creds - %s\r\n",
|
||||
error_message(r));
|
||||
krb5_free_creds(local_creds);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Send forwarded credentials */
|
||||
if (!Data(ap, KRB_FORWARD, forw_creds.data, forw_creds.length)) {
|
||||
if (auth_debug_mode)
|
||||
|
@ -266,7 +266,7 @@ krb4encpwd_is(ap, data, cnt)
|
||||
Data(ap, KRB4_ENCPWD_CHALLENGE, (void *)challenge, strlen(challenge));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Data(ap, KRB4_ENCPWD_REJECT, 0, 0);
|
||||
break;
|
||||
|
@ -36,8 +36,8 @@ static char sccsid[] = "@(#)read_password.c 8.2 (Berkeley) 12/15/93";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
* $Source: /home/ncvs/src/lib/libtelnet/read_password.c,v $
|
||||
* $Author: rgrimes $
|
||||
* $Source: /home/ncvs/src/secure/lib/libtelnet/read_password.c,v $
|
||||
* $Author: csgr $
|
||||
*
|
||||
* Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
|
||||
* of Technology.
|
||||
@ -76,7 +76,7 @@ local_des_read_pw_string(s,max,prompt,verify)
|
||||
{
|
||||
int ok = 0;
|
||||
char *ptr;
|
||||
|
||||
|
||||
jmp_buf old_env;
|
||||
struct sgttyb tty_state;
|
||||
char key_string[BUFSIZ];
|
||||
@ -91,7 +91,7 @@ local_des_read_pw_string(s,max,prompt,verify)
|
||||
goto lose;
|
||||
|
||||
/* save terminal state*/
|
||||
if (ioctl(0,TIOCGETP,(char *)&tty_state) == -1)
|
||||
if (ioctl(0,TIOCGETP,(char *)&tty_state) == -1)
|
||||
return -1;
|
||||
/*
|
||||
push_signals();
|
||||
|
@ -304,7 +304,7 @@ rsaencpwd_is(ap, data, cnt)
|
||||
Data(ap, RSA_ENCPWD_CHALLENGEKEY, (void *)chalkey, chalkey_len);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Data(ap, RSA_ENCPWD_REJECT, 0, 0);
|
||||
break;
|
||||
|
@ -42,7 +42,7 @@
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
|
||||
# define _PATH_TTY "/dev/tty"
|
||||
# ifndef _PATH_LOGIN
|
||||
# define _PATH_LOGIN "/bin/login"
|
||||
|
@ -109,10 +109,10 @@ get_slc_defaults()
|
||||
init_termbuf();
|
||||
|
||||
for (i = 1; i <= NSLC; i++) {
|
||||
slctab[i].defset.flag =
|
||||
slctab[i].defset.flag =
|
||||
spcset(i, &slctab[i].defset.val, &slctab[i].sptr);
|
||||
slctab[i].current.flag = SLC_NOSUPPORT;
|
||||
slctab[i].current.val = 0;
|
||||
slctab[i].current.flag = SLC_NOSUPPORT;
|
||||
slctab[i].current.val = 0;
|
||||
}
|
||||
|
||||
} /* end of get_slc_defaults */
|
||||
@ -286,7 +286,7 @@ change_slc(func, flag, val)
|
||||
register cc_t val;
|
||||
{
|
||||
register int hislevel, mylevel;
|
||||
|
||||
|
||||
hislevel = flag & SLC_LEVELBITS;
|
||||
mylevel = slctab[func].defset.flag & SLC_LEVELBITS;
|
||||
/*
|
||||
@ -345,7 +345,7 @@ change_slc(func, flag, val)
|
||||
* request as he asks.
|
||||
*
|
||||
* If our level is DEFAULT, then just ack whatever was
|
||||
* sent.
|
||||
* sent.
|
||||
*
|
||||
* If he can't change and we can't change,
|
||||
* then degenerate to NOSUPPORT.
|
||||
@ -372,7 +372,7 @@ change_slc(func, flag, val)
|
||||
slctab[func].defset.val;
|
||||
val = slctab[func].current.val;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
add_slc(func, flag, val);
|
||||
}
|
||||
@ -423,7 +423,7 @@ check_slc()
|
||||
slctab[i].current.val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} /* check_slc */
|
||||
|
||||
/*
|
||||
|
@ -388,7 +388,7 @@ gotiac: switch (c) {
|
||||
* All state defaults are negative, and resp defaults to 0.
|
||||
*
|
||||
* When initiating a request to change state to new_state:
|
||||
*
|
||||
*
|
||||
* if ((want_resp == 0 && new_state == my_state) || want_state == new_state) {
|
||||
* do nothing;
|
||||
* } else {
|
||||
|
@ -1076,7 +1076,7 @@ getptyslave()
|
||||
#ifdef USE_TERMIO
|
||||
ttyfd = t;
|
||||
#endif
|
||||
if (ioctl(t, I_PUSH, "ptem") < 0)
|
||||
if (ioctl(t, I_PUSH, "ptem") < 0)
|
||||
fatal(net, "I_PUSH ptem");
|
||||
if (ioctl(t, I_PUSH, "ldterm") < 0)
|
||||
fatal(net, "I_PUSH ldterm");
|
||||
@ -1576,7 +1576,7 @@ start_login(host, autologin, name)
|
||||
if (bftpd) {
|
||||
argv = addarg(argv, "-e");
|
||||
argv = addarg(argv, BFTPPATH);
|
||||
} else
|
||||
} else
|
||||
#endif
|
||||
#if defined (SecurID)
|
||||
/*
|
||||
@ -2061,7 +2061,7 @@ rmut()
|
||||
if (statbf.st_size && utmp) {
|
||||
nutmp = read(f, (char *)utmp, (int)statbf.st_size);
|
||||
nutmp /= sizeof(struct utmp);
|
||||
|
||||
|
||||
for (u = utmp ; u < &utmp[nutmp] ; u++) {
|
||||
if (SCMPN(u->ut_line, line+5) ||
|
||||
u->ut_name[0]==0)
|
||||
|
@ -816,7 +816,7 @@ doit(who)
|
||||
|
||||
#if defined(_SC_CRAY_SECURE_SYS)
|
||||
/*
|
||||
* set ttyp line security label
|
||||
* set ttyp line security label
|
||||
*/
|
||||
if (secflag) {
|
||||
char slave_dev[16];
|
||||
@ -1400,7 +1400,7 @@ telnet(f, p, host)
|
||||
}
|
||||
cleanup(0);
|
||||
} /* end of telnet */
|
||||
|
||||
|
||||
#ifndef TCSIG
|
||||
# ifdef TIOCSIG
|
||||
# define TCSIG TIOCSIG
|
||||
@ -1476,7 +1476,7 @@ int readstream(p, ibuf, bufsize)
|
||||
tp = (struct termio *) (ibuf+1 + sizeof(struct iocblk));
|
||||
vstop = tp->c_cc[VSTOP];
|
||||
vstart = tp->c_cc[VSTART];
|
||||
ixon = tp->c_iflag & IXON;
|
||||
ixon = tp->c_iflag & IXON;
|
||||
break;
|
||||
default:
|
||||
errno = EAGAIN;
|
||||
|
@ -320,7 +320,7 @@ localstat()
|
||||
nfrontp += 7;
|
||||
editmode = useeditmode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Check for changes to special characters in use.
|
||||
@ -422,7 +422,7 @@ clientstat(code, parm1, parm2)
|
||||
uselinemode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Quit now if we can't do it.
|
||||
*/
|
||||
@ -463,7 +463,7 @@ clientstat(code, parm1, parm2)
|
||||
send_will(TELOPT_ECHO, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case LM_MODE:
|
||||
{
|
||||
register int ack, changed;
|
||||
@ -512,7 +512,7 @@ clientstat(code, parm1, parm2)
|
||||
IAC, SE);
|
||||
nfrontp += 7;
|
||||
}
|
||||
|
||||
|
||||
editmode = useeditmode;
|
||||
}
|
||||
|
||||
@ -546,9 +546,9 @@ clientstat(code, parm1, parm2)
|
||||
(void) ioctl(pty, TIOCSWINSZ, (char *)&ws);
|
||||
}
|
||||
#endif /* TIOCSWINSZ */
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case TELOPT_TSPEED:
|
||||
{
|
||||
def_tspeed = parm1;
|
||||
@ -613,7 +613,7 @@ _termstat()
|
||||
*
|
||||
* Some things should not be done until after the login process has started
|
||||
* and all the pty modes are set to what they are supposed to be. This
|
||||
* function is called when the pty state has been processed for the first time.
|
||||
* function is called when the pty state has been processed for the first time.
|
||||
* It calls other functions that do things that were deferred in each module.
|
||||
*/
|
||||
void
|
||||
|
@ -713,7 +713,7 @@ printsub(direction, pointer, length)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case LM_SLC:
|
||||
sprintf(nfrontp, "SLC");
|
||||
nfrontp += strlen(nfrontp);
|
||||
@ -863,7 +863,7 @@ printsub(direction, pointer, length)
|
||||
nfrontp += strlen(nfrontp);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
sprintf(nfrontp, " %d", pointer[i]);
|
||||
nfrontp += strlen(nfrontp);
|
||||
@ -966,7 +966,7 @@ printsub(direction, pointer, length)
|
||||
case TELOPT_AUTHENTICATION:
|
||||
sprintf(nfrontp, "AUTHENTICATION");
|
||||
nfrontp += strlen(nfrontp);
|
||||
|
||||
|
||||
if (length < 2) {
|
||||
sprintf(nfrontp, " (empty suboption??\?)");
|
||||
nfrontp += strlen(nfrontp);
|
||||
@ -1171,13 +1171,13 @@ printdata(tag, ptr, cnt)
|
||||
nfrontp += strlen(nfrontp);
|
||||
for (i = 0; i < 20 && cnt; i++) {
|
||||
sprintf(nfrontp, "%02x", *ptr);
|
||||
nfrontp += strlen(nfrontp);
|
||||
nfrontp += strlen(nfrontp);
|
||||
if (isprint(*ptr)) {
|
||||
xbuf[i] = *ptr;
|
||||
} else {
|
||||
xbuf[i] = '.';
|
||||
}
|
||||
if (i % 2) {
|
||||
if (i % 2) {
|
||||
*nfrontp = ' ';
|
||||
nfrontp++;
|
||||
}
|
||||
@ -1187,6 +1187,6 @@ printdata(tag, ptr, cnt)
|
||||
xbuf[i] = '\0';
|
||||
sprintf(nfrontp, " %s\r\n", xbuf );
|
||||
nfrontp += strlen(nfrontp);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* DIAGNOSTICS */
|
||||
|
@ -234,7 +234,7 @@ control(c)
|
||||
* the "send" command.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
struct sendlist {
|
||||
char *name; /* How user refers to it (case independent) */
|
||||
char *help; /* Help information (0 ==> no help) */
|
||||
@ -2417,7 +2417,7 @@ tn(argc, argv)
|
||||
errno = oerrno;
|
||||
perror((char *)0);
|
||||
host->h_addr_list++;
|
||||
memcpy((caddr_t)&sin.sin_addr,
|
||||
memcpy((caddr_t)&sin.sin_addr,
|
||||
host->h_addr_list[0], host->h_length);
|
||||
(void) NetClose(net);
|
||||
continue;
|
||||
@ -2804,10 +2804,10 @@ cmdrc(m1, m2)
|
||||
* *cpp: If *cpp was equal to NULL, it will be filled
|
||||
* in with a pointer to our static area that has
|
||||
* the option filled in. This will be 32bit aligned.
|
||||
*
|
||||
*
|
||||
* *lenp: This will be filled in with how long the option
|
||||
* pointed to by *cpp is.
|
||||
*
|
||||
*
|
||||
*/
|
||||
unsigned long
|
||||
sourceroute(arg, cpp, lenp)
|
||||
|
@ -65,7 +65,7 @@ tninit()
|
||||
init_terminal();
|
||||
|
||||
init_network();
|
||||
|
||||
|
||||
init_telnet();
|
||||
|
||||
init_sys();
|
||||
@ -192,7 +192,7 @@ main(argc, argv)
|
||||
case 'f':
|
||||
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
|
||||
if (forward_flags & OPTS_FORWARD_CREDS) {
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"%s: Only one of -f and -F allowed.\n",
|
||||
prompt);
|
||||
usage();
|
||||
@ -200,14 +200,14 @@ main(argc, argv)
|
||||
forward_flags |= OPTS_FORWARD_CREDS;
|
||||
#else
|
||||
fprintf(stderr,
|
||||
"%s: Warning: -f ignored, no Kerberos V5 support.\n",
|
||||
"%s: Warning: -f ignored, no Kerberos V5 support.\n",
|
||||
prompt);
|
||||
#endif
|
||||
break;
|
||||
case 'F':
|
||||
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
|
||||
if (forward_flags & OPTS_FORWARD_CREDS) {
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"%s: Only one of -f and -F allowed.\n",
|
||||
prompt);
|
||||
usage();
|
||||
@ -216,7 +216,7 @@ main(argc, argv)
|
||||
forward_flags |= OPTS_FORWARDABLE_CREDS;
|
||||
#else
|
||||
fprintf(stderr,
|
||||
"%s: Warning: -F ignored, no Kerberos V5 support.\n",
|
||||
"%s: Warning: -F ignored, no Kerberos V5 support.\n",
|
||||
prompt);
|
||||
#endif
|
||||
break;
|
||||
|
@ -223,7 +223,7 @@ TerminalSpecialChars(c)
|
||||
/*
|
||||
* Flush output to the terminal
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
TerminalFlushOutput()
|
||||
{
|
||||
@ -946,7 +946,7 @@ process_rings(netin, netout, netex, ttyin, ttyout, poll)
|
||||
|
||||
if (netout) {
|
||||
FD_SET(net, &obits);
|
||||
}
|
||||
}
|
||||
if (ttyout) {
|
||||
FD_SET(tout, &obits);
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ init_telnet()
|
||||
ClearArray(options);
|
||||
|
||||
connected = In3270 = ISend = localflow = donebinarytoggle = 0;
|
||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||
auth_encrypt_connect(connected);
|
||||
#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */
|
||||
restartany = -1;
|
||||
@ -689,7 +689,7 @@ mklist(buf, name)
|
||||
else if (islower(c))
|
||||
*cp = toupper(c);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check for an old V6 2 character name. If the second
|
||||
* name points to the beginning of the buffer, and is
|
||||
@ -1834,7 +1834,7 @@ telrcv()
|
||||
case TS_IAC:
|
||||
process_iac:
|
||||
switch (c) {
|
||||
|
||||
|
||||
case WILL:
|
||||
telrcv_state = TS_WILL;
|
||||
continue;
|
||||
@ -2249,7 +2249,7 @@ telnet(user)
|
||||
{
|
||||
sys_telnet_init();
|
||||
|
||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||
{
|
||||
static char local_host[256] = { 0 };
|
||||
|
||||
|
@ -593,7 +593,7 @@ printsub(direction, pointer, length)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case LM_SLC:
|
||||
fprintf(NetTrace, "SLC");
|
||||
for (i = 2; i < length - 2; i += 3) {
|
||||
@ -725,7 +725,7 @@ printsub(direction, pointer, length)
|
||||
fprintf(NetTrace, "\n");
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
fprintf(NetTrace, " %d", pointer[i]);
|
||||
break;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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$
|
||||
* $Id: coff.c,v 1.1 1994/10/14 08:46:12 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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$
|
||||
* $Id: ibcs2.c,v 1.2 1994/10/14 08:45:16 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
# $Id: Makefile,v 1.1 1995/01/12 13:03:01 ugen Exp $
|
||||
# $Id: Makefile,v 1.2 1995/01/12 13:57:51 ugen Exp $
|
||||
|
||||
.PATH: ${.CURDIR}/../../sys/netinet
|
||||
KMOD= ipfw_mod
|
||||
SRCS= ipfw_lkm.c ip_fw.c
|
||||
SRCS= ipfw_lkm.c ip_fw.c
|
||||
NOMAN=
|
||||
CFLAGS+= -DIPFIREWALL -DIPACCT
|
||||
#
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/exec.h>
|
||||
@ -73,7 +73,7 @@ ipfw_unload(struct lkm_table *lkmtp, int cmd)
|
||||
int s=splnet();
|
||||
#ifdef IPFIREWALL
|
||||
ip_fw_ctl_ptr=NULL;
|
||||
ip_fw_chk_ptr=NULL;
|
||||
ip_fw_chk_ptr=NULL;
|
||||
#endif
|
||||
#ifdef IPACCT
|
||||
ip_acct_ctl_ptr=NULL;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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: socksys.c,v 1.1 1994/10/16 20:38:50 sos Exp $
|
||||
* $Id: socksys.c,v 1.2 1995/01/24 04:22:19 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -40,12 +40,12 @@ int sockopen();
|
||||
int sockclose();
|
||||
int sockioctl();
|
||||
|
||||
struct cdevsw dev_socksys = {
|
||||
(d_open_t *)sockopen, (d_close_t *)sockclose,
|
||||
struct cdevsw dev_socksys = {
|
||||
(d_open_t *)sockopen, (d_close_t *)sockclose,
|
||||
(d_rdwr_t *)enodev, (d_rdwr_t *)enodev,
|
||||
(d_ioctl_t *)sockioctl, (d_stop_t *)enodev,
|
||||
(d_reset_t *)nullop, NULL,
|
||||
(d_select_t *)seltrue, (d_mmap_t *)enodev,
|
||||
(d_select_t *)seltrue, (d_mmap_t *)enodev,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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$
|
||||
* $Id: blank_saver.c,v 1.1 1995/02/22 13:45:30 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -42,17 +42,17 @@ MOD_MISC("blank_saver")
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
|
||||
static void
|
||||
static void
|
||||
blank_saver(int blank)
|
||||
{
|
||||
u_char val;
|
||||
if (blank) {
|
||||
scrn_blanked = 1;
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
|
||||
}
|
||||
else {
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
|
||||
scrn_blanked = 0;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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$
|
||||
* $Id: fade_saver.c,v 1.1 1995/02/22 13:46:32 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -42,7 +42,7 @@ MOD_MISC("fade_saver")
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
|
||||
static void
|
||||
static void
|
||||
fade_saver(int blank)
|
||||
{
|
||||
static int count = 0;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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$
|
||||
* $Id: green_saver.c,v 1.1 1995/02/22 13:47:14 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -42,19 +42,19 @@ MOD_MISC("green_saver")
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
|
||||
static void
|
||||
static void
|
||||
green_saver(int blank)
|
||||
{
|
||||
u_char val;
|
||||
if (blank) {
|
||||
scrn_blanked = 1;
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
|
||||
outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
|
||||
outb(crtc_addr + 1, val & ~0x80);
|
||||
}
|
||||
else {
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
|
||||
outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
|
||||
outb(crtc_addr + 1, val | 0x80);
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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: snake_saver.c,v 1.2 1995/03/30 15:10:20 sos Exp $
|
||||
* $Id: snake_saver.c,v 1.3 1995/05/16 19:10:11 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -42,7 +42,7 @@ MOD_MISC("snake_saver")
|
||||
void (*current_saver)();
|
||||
void (*old_saver)();
|
||||
|
||||
static void
|
||||
static void
|
||||
snake_saver(int blank)
|
||||
{
|
||||
const char saves[] = {"FreeBSD-2.0.5"};
|
||||
@ -70,7 +70,7 @@ snake_saver(int blank)
|
||||
outb(crtc_addr+1, f & 0xff);
|
||||
scrn_blanked = 1;
|
||||
}
|
||||
if (scrn_blanked++ < 4)
|
||||
if (scrn_blanked++ < 4)
|
||||
return;
|
||||
scrn_blanked = 1;
|
||||
*(savs[sizeof(saves)-2]) = scr_map[0x20];
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@ -25,7 +25,7 @@
|
||||
* (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: star_saver.c,v 1.1 1995/02/22 13:47:36 sos Exp $
|
||||
* $Id: star_saver.c,v 1.2 1995/03/30 15:10:03 sos Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -48,31 +48,31 @@ void (*old_saver)();
|
||||
* Alternate saver that got its inspiration from a well known utility
|
||||
* package for an inferior^H^H^H^H^H^Hfamous OS.
|
||||
*/
|
||||
void
|
||||
void
|
||||
star_saver(int blank)
|
||||
{
|
||||
scr_stat *scp = cur_console;
|
||||
int cell, i;
|
||||
char pattern[] = {"...........++++*** "};
|
||||
char colors[] = {FG_DARKGREY, FG_LIGHTGREY,
|
||||
char colors[] = {FG_DARKGREY, FG_LIGHTGREY,
|
||||
FG_WHITE, FG_LIGHTCYAN};
|
||||
static u_short stars[NUM_STARS][2];
|
||||
|
||||
|
||||
if (blank) {
|
||||
if (!scrn_blanked) {
|
||||
scrn_blanked = 1;
|
||||
fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
|
||||
fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
|
||||
scp->xsize * scp->ysize);
|
||||
set_border(0);
|
||||
for(i=0; i<NUM_STARS; i++) {
|
||||
stars[i][0] =
|
||||
stars[i][0] =
|
||||
random() % (scp->xsize*scp->ysize);
|
||||
stars[i][1] = 0;
|
||||
}
|
||||
}
|
||||
cell = random() % NUM_STARS;
|
||||
*((u_short*)(Crtat + stars[cell][0])) =
|
||||
scr_map[pattern[stars[cell][1]]] |
|
||||
*((u_short*)(Crtat + stars[cell][0])) =
|
||||
scr_map[pattern[stars[cell][1]]] |
|
||||
colors[random()%sizeof(colors)] << 8;
|
||||
if ((stars[cell][1]+=(random()%4)) >= sizeof(pattern)-1) {
|
||||
stars[cell][0] = random() % (scp->xsize*scp->ysize);
|
||||
|
@ -97,7 +97,7 @@ int main(argc, argv)
|
||||
}
|
||||
if (init == -1)
|
||||
goto usage;
|
||||
|
||||
|
||||
if (access(_PATH_CLOCK, F_OK))
|
||||
return 0;
|
||||
|
||||
|
@ -705,7 +705,7 @@ display(f, lp)
|
||||
|
||||
case FS_BSDLFS:
|
||||
fprintf(f, " %5d %5d %5d",
|
||||
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
||||
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
||||
pp->p_cpg);
|
||||
break;
|
||||
|
||||
@ -720,7 +720,7 @@ display(f, lp)
|
||||
else
|
||||
putc(' ', f);
|
||||
fprintf(f, "- %d",
|
||||
(pp->p_offset +
|
||||
(pp->p_offset +
|
||||
pp->p_size + lp->d_secpercyl - 1) /
|
||||
lp->d_secpercyl - 1);
|
||||
if (pp->p_size % lp->d_secpercyl)
|
||||
|
@ -705,7 +705,7 @@ display(f, lp)
|
||||
|
||||
case FS_BSDLFS:
|
||||
fprintf(f, " %5d %5d %5d",
|
||||
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
||||
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
||||
pp->p_cpg);
|
||||
break;
|
||||
|
||||
@ -720,7 +720,7 @@ display(f, lp)
|
||||
else
|
||||
putc(' ', f);
|
||||
fprintf(f, "- %d",
|
||||
(pp->p_offset +
|
||||
(pp->p_offset +
|
||||
pp->p_size + lp->d_secpercyl - 1) /
|
||||
lp->d_secpercyl - 1);
|
||||
if (pp->p_size % lp->d_secpercyl)
|
||||
|
@ -55,7 +55,7 @@ struct nlist nlk[] = {
|
||||
|
||||
int quiet = FALSE;
|
||||
|
||||
void
|
||||
void
|
||||
fatal(name, str)
|
||||
char *name, *str;
|
||||
{
|
||||
@ -68,7 +68,7 @@ fatal(name, str)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
error(name, str)
|
||||
char *name, *str;
|
||||
{
|
||||
@ -186,7 +186,7 @@ main(ac, av)
|
||||
fatal("kvmread", NULL);
|
||||
dev_found = 0;
|
||||
|
||||
while(pos_t!=NULL) {
|
||||
while(pos_t!=NULL) {
|
||||
if (kvm_read(kd, pos_t, &buf1, sizeof(struct isa_device)) < 0)
|
||||
fatal("kvmread", NULL);
|
||||
|
||||
@ -222,7 +222,7 @@ main(ac, av)
|
||||
if (buf1.id_id != 0)
|
||||
if (verbose)
|
||||
printf(
|
||||
"kernel: id=%u io=%X irq=%d drq=%d maddr=%X msize=%d flags=%X enabled=%X \n",
|
||||
"kernel: id=%u io=%X irq=%d drq=%d maddr=%X msize=%d flags=%X enabled=%X \n",
|
||||
buf1.id_id, buf1.id_iobase, buf1.id_irq, buf1.id_drq,
|
||||
buf1.id_maddr, buf1.id_msize, buf1.id_flags, buf1.id_enabled);
|
||||
|
||||
|
@ -108,7 +108,7 @@ int mapdirs __P((ino_t maxino, long *tapesize));
|
||||
|
||||
/* file dumping routines */
|
||||
void blksout __P((daddr_t *blkp, int frags, ino_t ino));
|
||||
void bread __P((daddr_t blkno, char *buf, int size));
|
||||
void bread __P((daddr_t blkno, char *buf, int size));
|
||||
void dumpino __P((struct dinode *dp, ino_t ino));
|
||||
void dumpmap __P((char *map, int type, ino_t ino));
|
||||
void writeheader __P((ino_t ino));
|
||||
|
@ -93,7 +93,7 @@ main(argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
register ino_t ino;
|
||||
register int dirty;
|
||||
register int dirty;
|
||||
register struct dinode *dp;
|
||||
register struct fstab *dt;
|
||||
register char *map;
|
||||
@ -359,7 +359,7 @@ main(argc, argv)
|
||||
the end of each block written, and not in mid-block.
|
||||
Assume no erroneous blocks; this can be compensated
|
||||
for with an artificially low tape size. */
|
||||
fetapes =
|
||||
fetapes =
|
||||
( tapesize /* blocks */
|
||||
* TP_BSIZE /* bytes/block */
|
||||
* (1.0/density) /* 0.1" / byte */
|
||||
|
@ -171,7 +171,7 @@ struct group *gp;
|
||||
|
||||
/*
|
||||
* Get the names from the group entry "operator" to notify.
|
||||
*/
|
||||
*/
|
||||
void
|
||||
set_operators()
|
||||
{
|
||||
@ -300,7 +300,7 @@ timeest()
|
||||
if (tnow >= tschedule) {
|
||||
tschedule = tnow + 300;
|
||||
if (blockswritten < 500)
|
||||
return;
|
||||
return;
|
||||
deltat = tstart_writing - tnow +
|
||||
(1.0 * (tnow - tstart_writing))
|
||||
/ blockswritten * tapesize;
|
||||
|
@ -318,12 +318,12 @@ trewind()
|
||||
|
||||
for (f = 0; f < SLAVES; f++) {
|
||||
/*
|
||||
* Drain the results, but unlike EOT we DO (or should) care
|
||||
* what the return values were, since if we detect EOT after
|
||||
* we think we've written the last blocks to the tape anyway,
|
||||
* Drain the results, but unlike EOT we DO (or should) care
|
||||
* what the return values were, since if we detect EOT after
|
||||
* we think we've written the last blocks to the tape anyway,
|
||||
* we have to replay those blocks with rollforward.
|
||||
*
|
||||
* fixme: punt for now.
|
||||
* fixme: punt for now.
|
||||
*/
|
||||
if (slaves[f].sent) {
|
||||
if (atomic(read, slaves[f].fd, (char *)&got, sizeof got)
|
||||
@ -391,9 +391,9 @@ rollforward()
|
||||
ntb = (union u_spcl *)tslp->tblock[1];
|
||||
|
||||
/*
|
||||
* Each of the N slaves should have requests that need to
|
||||
* be replayed on the next tape. Use the extra slave buffers
|
||||
* (slaves[SLAVES]) to construct request lists to be sent to
|
||||
* Each of the N slaves should have requests that need to
|
||||
* be replayed on the next tape. Use the extra slave buffers
|
||||
* (slaves[SLAVES]) to construct request lists to be sent to
|
||||
* each slave in turn.
|
||||
*/
|
||||
for (i = 0; i < SLAVES; i++) {
|
||||
@ -401,7 +401,7 @@ rollforward()
|
||||
otb = (union u_spcl *)slp->tblock;
|
||||
|
||||
/*
|
||||
* For each request in the current slave, copy it to tslp.
|
||||
* For each request in the current slave, copy it to tslp.
|
||||
*/
|
||||
|
||||
prev = NULL;
|
||||
@ -445,8 +445,8 @@ rollforward()
|
||||
|
||||
if (prev->dblk != 0) {
|
||||
/*
|
||||
* If the last one was a disk block, make the
|
||||
* first of this one be the last bit of that disk
|
||||
* If the last one was a disk block, make the
|
||||
* first of this one be the last bit of that disk
|
||||
* block...
|
||||
*/
|
||||
q->dblk = prev->dblk +
|
||||
@ -454,7 +454,7 @@ rollforward()
|
||||
ntb = (union u_spcl *)tslp->tblock;
|
||||
} else {
|
||||
/*
|
||||
* It wasn't a disk block. Copy the data to its
|
||||
* It wasn't a disk block. Copy the data to its
|
||||
* new location in the buffer.
|
||||
*/
|
||||
q->dblk = 0;
|
||||
@ -548,7 +548,7 @@ startnewtape(top)
|
||||
case X_FINOK:
|
||||
msg("Child %d finishes X_FINOK\n", childpid);
|
||||
break;
|
||||
case X_ABORT:
|
||||
case X_ABORT:
|
||||
msg("Child %d finishes X_ABORT\n", childpid);
|
||||
break;
|
||||
case X_REWRITE:
|
||||
@ -598,7 +598,7 @@ startnewtape(top)
|
||||
while ((tapefd = (host ? rmtopen(tape, 2) :
|
||||
pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
|
||||
#else
|
||||
while ((tapefd = (pipeout ? 1 :
|
||||
while ((tapefd = (pipeout ? 1 :
|
||||
open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
|
||||
#endif
|
||||
{
|
||||
@ -613,7 +613,7 @@ startnewtape(top)
|
||||
blocksthisvol = 0;
|
||||
if (top)
|
||||
newtape++; /* new tape signal */
|
||||
spcl.c_count = slp->count;
|
||||
spcl.c_count = slp->count;
|
||||
/*
|
||||
* measure firstrec in TP_BSIZE units since restore doesn't
|
||||
* know the correct ntrec value...
|
||||
@ -707,13 +707,13 @@ enslave()
|
||||
Exit(X_FINOK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < SLAVES; i++)
|
||||
(void) atomic(write, slaves[i].fd,
|
||||
(char *) &slaves[(i + 1) % SLAVES].pid,
|
||||
(void) atomic(write, slaves[i].fd,
|
||||
(char *) &slaves[(i + 1) % SLAVES].pid,
|
||||
sizeof slaves[0].pid);
|
||||
|
||||
master = 0;
|
||||
|
||||
master = 0;
|
||||
}
|
||||
|
||||
void
|
||||
@ -769,7 +769,7 @@ doslave(cmd, slave_number)
|
||||
p->count * TP_BSIZE);
|
||||
} else {
|
||||
if (p->count != 1 || atomic(read, cmd,
|
||||
(char *)slp->tblock[trecno],
|
||||
(char *)slp->tblock[trecno],
|
||||
TP_BSIZE) != TP_BSIZE)
|
||||
quit("master/slave protocol botched.\n");
|
||||
}
|
||||
@ -798,7 +798,7 @@ doslave(cmd, slave_number)
|
||||
#ifdef WRITEDEBUG
|
||||
printf("slave %d wrote %d\n", slave_number, wrote);
|
||||
#endif
|
||||
if (wrote < 0)
|
||||
if (wrote < 0)
|
||||
break;
|
||||
if (wrote == 0)
|
||||
eot_count++;
|
||||
@ -806,7 +806,7 @@ doslave(cmd, slave_number)
|
||||
}
|
||||
|
||||
#ifdef WRITEDEBUG
|
||||
if (size != writesize)
|
||||
if (size != writesize)
|
||||
printf("slave %d only wrote %d out of %d bytes and gave up.\n",
|
||||
slave_number, size, writesize);
|
||||
#endif
|
||||
@ -828,7 +828,7 @@ doslave(cmd, slave_number)
|
||||
* (for EOT handling)
|
||||
*/
|
||||
(void) atomic(write, cmd, (char *)&size, sizeof size);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If partial write, don't want next slave to go.
|
||||
|
@ -545,14 +545,14 @@ getino(inum)
|
||||
* Error recovery is attempted at most BREADEMAX times before seeking
|
||||
* consent from the operator to continue.
|
||||
*/
|
||||
int breaderrors = 0;
|
||||
int breaderrors = 0;
|
||||
#define BREADEMAX 32
|
||||
|
||||
void
|
||||
bread(blkno, buf, size)
|
||||
daddr_t blkno;
|
||||
char *buf;
|
||||
int size;
|
||||
int size;
|
||||
{
|
||||
int cnt, i;
|
||||
extern int errno;
|
||||
|
@ -221,10 +221,10 @@ dump_ifile(fd, lfsp, do_ientries)
|
||||
dump_cleaner_info(lfsp, ipage);
|
||||
print_suheader;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < (lfsp->lfs_segtabsz + lfsp->lfs_cleansz)) {
|
||||
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
||||
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
||||
lfsp->lfs_sepb);
|
||||
if (!inum)
|
||||
if(!do_ientries)
|
||||
@ -251,11 +251,11 @@ dump_ifile(fd, lfsp, do_ientries)
|
||||
if (i < lfsp->lfs_cleansz) {
|
||||
dump_cleaner_info(lfsp, ipage);
|
||||
continue;
|
||||
} else
|
||||
} else
|
||||
i -= lfsp->lfs_cleansz;
|
||||
|
||||
if (i < lfsp->lfs_segtabsz) {
|
||||
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
||||
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
||||
lfsp->lfs_sepb);
|
||||
if (!inum)
|
||||
if(!do_ientries)
|
||||
@ -285,7 +285,7 @@ dump_ifile(fd, lfsp, do_ientries)
|
||||
if (i < lfsp->lfs_cleansz) {
|
||||
dump_cleaner_info(lfsp, ipage);
|
||||
continue;
|
||||
} else
|
||||
} else
|
||||
i -= lfsp->lfs_cleansz;
|
||||
|
||||
if (i < lfsp->lfs_segtabsz) {
|
||||
@ -385,7 +385,7 @@ dump_sum(fd, lfsp, sp, segnum, addr)
|
||||
int numblocks;
|
||||
struct dinode *inop;
|
||||
|
||||
if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum,
|
||||
if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum,
|
||||
LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum)))) {
|
||||
(void)printf("dumplfs: %s %d address 0x%lx\n",
|
||||
"corrupt summary block; segment", segnum, addr);
|
||||
@ -410,10 +410,10 @@ dump_sum(fd, lfsp, sp, segnum, addr)
|
||||
printf(" Inode addresses:");
|
||||
for (dp--, i = 0; i < sp->ss_ninos; dp--) {
|
||||
printf("\t0x%X {", *dp);
|
||||
get(fd, *dp << (lfsp->lfs_bshift - lfsp->lfs_fsbtodb), inop,
|
||||
get(fd, *dp << (lfsp->lfs_bshift - lfsp->lfs_fsbtodb), inop,
|
||||
(1 << lfsp->lfs_bshift));
|
||||
for (j = 0; i < sp->ss_ninos && j < INOPB(lfsp); j++, i++) {
|
||||
if (j > 0)
|
||||
if (j > 0)
|
||||
(void)printf(", ");
|
||||
(void)printf("%d", inop[j].di_inumber);
|
||||
}
|
||||
@ -463,7 +463,7 @@ dump_segment(fd, segnum, addr, lfsp, dump_sb)
|
||||
do {
|
||||
get(fd, sum_offset, sumblock, LFS_SUMMARY_SIZE);
|
||||
sump = (SEGSUM *)sumblock;
|
||||
if (sump->ss_sumsum != cksum (&sump->ss_datasum,
|
||||
if (sump->ss_sumsum != cksum (&sump->ss_datasum,
|
||||
LFS_SUMMARY_SIZE - sizeof(sump->ss_sumsum))) {
|
||||
sbp = (struct lfs *)sump;
|
||||
if (sb = (sbp->lfs_magic == LFS_MAGIC)) {
|
||||
@ -479,7 +479,7 @@ dump_segment(fd, segnum, addr, lfsp, dump_sb)
|
||||
nblocks = dump_sum(fd, lfsp, sump, segnum, sum_offset >>
|
||||
(lfsp->lfs_bshift - lfsp->lfs_fsbtodb));
|
||||
if (nblocks)
|
||||
sum_offset += LFS_SUMMARY_SIZE +
|
||||
sum_offset += LFS_SUMMARY_SIZE +
|
||||
(nblocks << lfsp->lfs_bshift);
|
||||
else
|
||||
sum_offset = 0;
|
||||
|
@ -40,7 +40,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "From: @(#)swapon.c 8.1 (Berkeley) 6/5/93";*/
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: dumpon.c,v 1.1 1995/05/12 19:10:09 wollman Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <errno.h>
|
||||
@ -99,7 +99,7 @@ main(int argc, char **argv)
|
||||
mib[0] = CTL_KERN;
|
||||
mib[1] = KERN_DUMPDEV;
|
||||
|
||||
rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev,
|
||||
rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev,
|
||||
sizeof stab.st_rdev);
|
||||
if (rv) {
|
||||
err(EX_OSERR, "sysctl: kern.dumpdev");
|
||||
@ -110,7 +110,7 @@ main(int argc, char **argv)
|
||||
printf("%s: crash dumps disabled\n", whoami);
|
||||
} else {
|
||||
printf("%s: crash dumps to %s (%lu, %lu)\n",
|
||||
whoami, argv[0],
|
||||
whoami, argv[0],
|
||||
(unsigned long)major(stab.st_rdev),
|
||||
(unsigned long)minor(stab.st_rdev));
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
#
|
||||
|
||||
PROG= fdisk
|
||||
PROG= fdisk
|
||||
SRCS= fdisk.c
|
||||
MAN8= fdisk.8
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
/*
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1992 Carnegie Mellon University
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||
* the rights to redistribute these changes.
|
||||
*/
|
||||
@ -89,37 +89,37 @@ static int i_flag = 0; /* replace partition data */
|
||||
static int u_flag = 0; /* update partition data */
|
||||
|
||||
static unsigned char bootcode[] = {
|
||||
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
||||
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
||||
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
||||
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
||||
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
||||
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
||||
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
||||
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
||||
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
||||
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
||||
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
||||
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
||||
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
||||
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
||||
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
||||
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
||||
0xeb, 0xf4, 0xfb, 0xeb, 0xfe,
|
||||
'M', 'i', 's', 's', 'i', 'n', 'g', ' ',
|
||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
||||
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||
'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ',
|
||||
'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0,
|
||||
'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ',
|
||||
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
||||
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
struct part_type
|
||||
@ -128,46 +128,46 @@ struct part_type
|
||||
char *name;
|
||||
}part_types[] =
|
||||
{
|
||||
{0x00, "unused"}
|
||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||
,{0x02, "XENIX / filesystem"}
|
||||
,{0x03, "XENIX /usr filesystem"}
|
||||
,{0x04, "Primary DOS with 16 bit FAT"}
|
||||
,{0x05, "Extended DOS"}
|
||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||
,{0x08, "AIX filesystem"}
|
||||
,{0x09, "AIX boot partition or Coherent"}
|
||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||
,{0x10, "OPUS"}
|
||||
,{0x40, "VENIX 286"}
|
||||
,{0x50, "DM"}
|
||||
,{0x51, "DM"}
|
||||
,{0x52, "CP/M or Microport SysV/AT"}
|
||||
,{0x56, "GB"}
|
||||
,{0x61, "Speed"}
|
||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||
,{0x64, "Novell Netware 2.xx"}
|
||||
,{0x65, "Novell Netware 3.xx"}
|
||||
,{0x75, "PCIX"}
|
||||
,{0x80, "Minix 1.1 ... 1.4a"}
|
||||
,{0x81, "Minix 1.4b ... 1.5.10"}
|
||||
,{0x82, "Linux swap"}
|
||||
,{0x83, "Linux filesystem"}
|
||||
,{0x93, "Amoeba filesystem"}
|
||||
,{0x94, "Amoeba bad block table"}
|
||||
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
||||
{0x00, "unused"}
|
||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||
,{0x02, "XENIX / filesystem"}
|
||||
,{0x03, "XENIX /usr filesystem"}
|
||||
,{0x04, "Primary DOS with 16 bit FAT"}
|
||||
,{0x05, "Extended DOS"}
|
||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||
,{0x08, "AIX filesystem"}
|
||||
,{0x09, "AIX boot partition or Coherent"}
|
||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||
,{0x10, "OPUS"}
|
||||
,{0x40, "VENIX 286"}
|
||||
,{0x50, "DM"}
|
||||
,{0x51, "DM"}
|
||||
,{0x52, "CP/M or Microport SysV/AT"}
|
||||
,{0x56, "GB"}
|
||||
,{0x61, "Speed"}
|
||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||
,{0x64, "Novell Netware 2.xx"}
|
||||
,{0x65, "Novell Netware 3.xx"}
|
||||
,{0x75, "PCIX"}
|
||||
,{0x80, "Minix 1.1 ... 1.4a"}
|
||||
,{0x81, "Minix 1.4b ... 1.5.10"}
|
||||
,{0x82, "Linux swap"}
|
||||
,{0x83, "Linux filesystem"}
|
||||
,{0x93, "Amoeba filesystem"}
|
||||
,{0x94, "Amoeba bad block table"}
|
||||
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
||||
,{0xA7, "NEXTSTEP"}
|
||||
,{0xB7, "BSDI BSD/386 filesystem"}
|
||||
,{0xB8, "BSDI BSD/386 swap"}
|
||||
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
||||
,{0xE1, "Speed"}
|
||||
,{0xE3, "Speed"}
|
||||
,{0xE4, "Speed"}
|
||||
,{0xF1, "Speed"}
|
||||
,{0xF2, "DOS 3.3+ Secondary"}
|
||||
,{0xF4, "Speed"}
|
||||
,{0xFF, "BBT (Bad Blocks Table)"}
|
||||
,{0xB7, "BSDI BSD/386 filesystem"}
|
||||
,{0xB8, "BSDI BSD/386 swap"}
|
||||
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
||||
,{0xE1, "Speed"}
|
||||
,{0xE3, "Speed"}
|
||||
,{0xE4, "Speed"}
|
||||
,{0xF1, "Speed"}
|
||||
,{0xF2, "DOS 3.3+ Secondary"}
|
||||
,{0xF4, "Speed"}
|
||||
,{0xFF, "BBT (Bad Blocks Table)"}
|
||||
};
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ int i;
|
||||
|
||||
if (argc > 0)
|
||||
disk = argv[0];
|
||||
|
||||
|
||||
if (open_disk(u_flag) < 0)
|
||||
exit(1);
|
||||
|
||||
@ -302,7 +302,7 @@ struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[3]);
|
||||
int size = disksecs - start;
|
||||
int rest;
|
||||
|
||||
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
||||
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
||||
mboot.signature = BOOT_MAGIC;
|
||||
|
||||
partp->dp_typ = DOSPTYP_386BSD;
|
||||
@ -366,7 +366,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i;
|
||||
dos(partp->dp_start+partp->dp_size - 1,
|
||||
&partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd);
|
||||
}
|
||||
|
||||
|
||||
print_part(i);
|
||||
} while (!ok("Are we happy with this entry?"));
|
||||
}
|
||||
@ -456,7 +456,7 @@ open_disk(u_flag)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (stat(disk, &st) == -1) {
|
||||
if (stat(disk, &st) == -1) {
|
||||
fprintf(stderr, "%s: Can't get file status of %s\n",
|
||||
name, disk);
|
||||
return -1;
|
||||
@ -516,7 +516,7 @@ get_params(verbose)
|
||||
|
||||
read_s0()
|
||||
{
|
||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
fprintf(stderr, "%s: Can't read fdisk partition table\n", name);
|
||||
return -1;
|
||||
}
|
||||
@ -545,7 +545,7 @@ write_s0()
|
||||
flag = 1;
|
||||
if (ioctl(fd, DIOCWLABEL, &flag) < 0)
|
||||
perror("ioctl DIOCWLABEL");
|
||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
fprintf(stderr, "%s: Can't write fdisk partition table\n",
|
||||
name);
|
||||
return -1;
|
||||
@ -687,7 +687,7 @@ int type;
|
||||
int counter = 0;
|
||||
struct part_type *ptr = part_types;
|
||||
|
||||
|
||||
|
||||
while(counter < numentries)
|
||||
{
|
||||
if(ptr->type == type)
|
||||
|
@ -149,7 +149,7 @@ dirscan(idesc)
|
||||
dirty(bp);
|
||||
sbdirty();
|
||||
}
|
||||
if (n & STOP)
|
||||
if (n & STOP)
|
||||
return (n);
|
||||
}
|
||||
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
||||
@ -512,7 +512,7 @@ makeentry(parent, ino, name)
|
||||
struct dinode *dp;
|
||||
struct inodesc idesc;
|
||||
char pathbuf[MAXPATHLEN + 1];
|
||||
|
||||
|
||||
if (parent < ROOTINO || parent >= maxino ||
|
||||
ino < ROOTINO || ino >= maxino)
|
||||
return (0);
|
||||
|
@ -112,14 +112,14 @@ struct inodesc {
|
||||
|
||||
/*
|
||||
* Linked list of duplicate blocks.
|
||||
*
|
||||
*
|
||||
* The list is composed of two parts. The first part of the
|
||||
* list (from duplist through the node pointed to by muldup)
|
||||
* contains a single copy of each duplicate block that has been
|
||||
* contains a single copy of each duplicate block that has been
|
||||
* found. The second part of the list (from muldup to the end)
|
||||
* contains duplicate blocks that have been found more than once.
|
||||
* To check if a block has been found as a duplicate it is only
|
||||
* necessary to search from duplist through muldup. To find the
|
||||
* necessary to search from duplist through muldup. To find the
|
||||
* total number of times that a block has been found as a duplicate
|
||||
* the entire list must be searched for occurences of the block
|
||||
* in question. The following diagram shows a sample list where
|
||||
|
@ -374,7 +374,7 @@ inocleanup()
|
||||
free((char *)inpsort);
|
||||
inphead = inpsort = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
inodirty()
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ main(argc, argv)
|
||||
case 'c':
|
||||
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
||||
break;
|
||||
|
||||
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
||||
sbdirty();
|
||||
}
|
||||
if (cvtlevel && sblk.b_dirty) {
|
||||
/*
|
||||
/*
|
||||
* Write out the duplicate super blocks
|
||||
*/
|
||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
|
@ -211,7 +211,7 @@ pass2check(idesc)
|
||||
dirp->d_type = typemap[dirp->d_ino];
|
||||
ret |= ALTERED;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* check for "."
|
||||
*/
|
||||
if (idesc->id_entryno != 0)
|
||||
|
@ -117,7 +117,7 @@ pass5()
|
||||
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
||||
newcg->cg_boff =
|
||||
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
||||
newcg->cg_iusedoff = newcg->cg_boff +
|
||||
newcg->cg_iusedoff = newcg->cg_boff +
|
||||
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
||||
newcg->cg_freeoff =
|
||||
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
||||
maxrun = ndisks;
|
||||
nextdisk = disks;
|
||||
for (passno = 0; passno < maxrun; ++passno) {
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
nrun > 0)
|
||||
sleep(10);
|
||||
if (ret)
|
||||
|
@ -157,7 +157,7 @@ setup(dev)
|
||||
sbdirty();
|
||||
}
|
||||
}
|
||||
if (sblock.fs_interleave < 1 ||
|
||||
if (sblock.fs_interleave < 1 ||
|
||||
sblock.fs_interleave > sblock.fs_nsect) {
|
||||
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
||||
sblock.fs_interleave);
|
||||
@ -169,7 +169,7 @@ setup(dev)
|
||||
dirty(&asblk);
|
||||
}
|
||||
}
|
||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||
sblock.fs_npsect > sblock.fs_nsect*2) {
|
||||
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
||||
sblock.fs_npsect);
|
||||
@ -277,7 +277,7 @@ setup(dev)
|
||||
}
|
||||
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
||||
if (lncntp == NULL) {
|
||||
printf("cannot alloc %u bytes for lncntp\n",
|
||||
printf("cannot alloc %u bytes for lncntp\n",
|
||||
(unsigned)(maxino + 1) * sizeof(short));
|
||||
goto badsb;
|
||||
}
|
||||
@ -289,7 +289,7 @@ setup(dev)
|
||||
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
||||
sizeof(struct inoinfo *));
|
||||
if (inpsort == NULL || inphead == NULL) {
|
||||
printf("cannot alloc %u bytes for inphead\n",
|
||||
printf("cannot alloc %u bytes for inphead\n",
|
||||
(unsigned)numdirs * sizeof(struct inoinfo *));
|
||||
goto badsb;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ dirscan(idesc)
|
||||
dirty(bp);
|
||||
sbdirty();
|
||||
}
|
||||
if (n & STOP)
|
||||
if (n & STOP)
|
||||
return (n);
|
||||
}
|
||||
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
||||
@ -512,7 +512,7 @@ makeentry(parent, ino, name)
|
||||
struct dinode *dp;
|
||||
struct inodesc idesc;
|
||||
char pathbuf[MAXPATHLEN + 1];
|
||||
|
||||
|
||||
if (parent < ROOTINO || parent >= maxino ||
|
||||
ino < ROOTINO || ino >= maxino)
|
||||
return (0);
|
||||
|
@ -112,14 +112,14 @@ struct inodesc {
|
||||
|
||||
/*
|
||||
* Linked list of duplicate blocks.
|
||||
*
|
||||
*
|
||||
* The list is composed of two parts. The first part of the
|
||||
* list (from duplist through the node pointed to by muldup)
|
||||
* contains a single copy of each duplicate block that has been
|
||||
* contains a single copy of each duplicate block that has been
|
||||
* found. The second part of the list (from muldup to the end)
|
||||
* contains duplicate blocks that have been found more than once.
|
||||
* To check if a block has been found as a duplicate it is only
|
||||
* necessary to search from duplist through muldup. To find the
|
||||
* necessary to search from duplist through muldup. To find the
|
||||
* total number of times that a block has been found as a duplicate
|
||||
* the entire list must be searched for occurences of the block
|
||||
* in question. The following diagram shows a sample list where
|
||||
|
@ -374,7 +374,7 @@ inocleanup()
|
||||
free((char *)inpsort);
|
||||
inphead = inpsort = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
inodirty()
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ main(argc, argv)
|
||||
case 'c':
|
||||
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
||||
break;
|
||||
|
||||
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
||||
sbdirty();
|
||||
}
|
||||
if (cvtlevel && sblk.b_dirty) {
|
||||
/*
|
||||
/*
|
||||
* Write out the duplicate super blocks
|
||||
*/
|
||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
|
@ -211,7 +211,7 @@ pass2check(idesc)
|
||||
dirp->d_type = typemap[dirp->d_ino];
|
||||
ret |= ALTERED;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* check for "."
|
||||
*/
|
||||
if (idesc->id_entryno != 0)
|
||||
|
@ -117,7 +117,7 @@ pass5()
|
||||
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
||||
newcg->cg_boff =
|
||||
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
||||
newcg->cg_iusedoff = newcg->cg_boff +
|
||||
newcg->cg_iusedoff = newcg->cg_boff +
|
||||
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
||||
newcg->cg_freeoff =
|
||||
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
||||
maxrun = ndisks;
|
||||
nextdisk = disks;
|
||||
for (passno = 0; passno < maxrun; ++passno) {
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
nrun > 0)
|
||||
sleep(10);
|
||||
if (ret)
|
||||
|
@ -157,7 +157,7 @@ setup(dev)
|
||||
sbdirty();
|
||||
}
|
||||
}
|
||||
if (sblock.fs_interleave < 1 ||
|
||||
if (sblock.fs_interleave < 1 ||
|
||||
sblock.fs_interleave > sblock.fs_nsect) {
|
||||
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
||||
sblock.fs_interleave);
|
||||
@ -169,7 +169,7 @@ setup(dev)
|
||||
dirty(&asblk);
|
||||
}
|
||||
}
|
||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||
sblock.fs_npsect > sblock.fs_nsect*2) {
|
||||
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
||||
sblock.fs_npsect);
|
||||
@ -277,7 +277,7 @@ setup(dev)
|
||||
}
|
||||
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
||||
if (lncntp == NULL) {
|
||||
printf("cannot alloc %u bytes for lncntp\n",
|
||||
printf("cannot alloc %u bytes for lncntp\n",
|
||||
(unsigned)(maxino + 1) * sizeof(short));
|
||||
goto badsb;
|
||||
}
|
||||
@ -289,7 +289,7 @@ setup(dev)
|
||||
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
||||
sizeof(struct inoinfo *));
|
||||
if (inpsort == NULL || inphead == NULL) {
|
||||
printf("cannot alloc %u bytes for inphead\n",
|
||||
printf("cannot alloc %u bytes for inphead\n",
|
||||
(unsigned)numdirs * sizeof(struct inoinfo *));
|
||||
goto badsb;
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ dirscan(idesc)
|
||||
dirty(bp);
|
||||
sbdirty();
|
||||
}
|
||||
if (n & STOP)
|
||||
if (n & STOP)
|
||||
return (n);
|
||||
}
|
||||
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
||||
@ -512,7 +512,7 @@ makeentry(parent, ino, name)
|
||||
struct dinode *dp;
|
||||
struct inodesc idesc;
|
||||
char pathbuf[MAXPATHLEN + 1];
|
||||
|
||||
|
||||
if (parent < ROOTINO || parent >= maxino ||
|
||||
ino < ROOTINO || ino >= maxino)
|
||||
return (0);
|
||||
|
@ -112,14 +112,14 @@ struct inodesc {
|
||||
|
||||
/*
|
||||
* Linked list of duplicate blocks.
|
||||
*
|
||||
*
|
||||
* The list is composed of two parts. The first part of the
|
||||
* list (from duplist through the node pointed to by muldup)
|
||||
* contains a single copy of each duplicate block that has been
|
||||
* contains a single copy of each duplicate block that has been
|
||||
* found. The second part of the list (from muldup to the end)
|
||||
* contains duplicate blocks that have been found more than once.
|
||||
* To check if a block has been found as a duplicate it is only
|
||||
* necessary to search from duplist through muldup. To find the
|
||||
* necessary to search from duplist through muldup. To find the
|
||||
* total number of times that a block has been found as a duplicate
|
||||
* the entire list must be searched for occurences of the block
|
||||
* in question. The following diagram shows a sample list where
|
||||
|
@ -374,7 +374,7 @@ inocleanup()
|
||||
free((char *)inpsort);
|
||||
inphead = inpsort = NULL;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
inodirty()
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ main(argc, argv)
|
||||
case 'c':
|
||||
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
||||
break;
|
||||
|
||||
|
||||
case 'd':
|
||||
debug++;
|
||||
break;
|
||||
@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
||||
sbdirty();
|
||||
}
|
||||
if (cvtlevel && sblk.b_dirty) {
|
||||
/*
|
||||
/*
|
||||
* Write out the duplicate super blocks
|
||||
*/
|
||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) 1980, 1986, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
|
@ -211,7 +211,7 @@ pass2check(idesc)
|
||||
dirp->d_type = typemap[dirp->d_ino];
|
||||
ret |= ALTERED;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* check for "."
|
||||
*/
|
||||
if (idesc->id_entryno != 0)
|
||||
|
@ -117,7 +117,7 @@ pass5()
|
||||
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
||||
newcg->cg_boff =
|
||||
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
||||
newcg->cg_iusedoff = newcg->cg_boff +
|
||||
newcg->cg_iusedoff = newcg->cg_boff +
|
||||
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
||||
newcg->cg_freeoff =
|
||||
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
||||
maxrun = ndisks;
|
||||
nextdisk = disks;
|
||||
for (passno = 0; passno < maxrun; ++passno) {
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
nrun > 0)
|
||||
sleep(10);
|
||||
if (ret)
|
||||
|
@ -157,7 +157,7 @@ setup(dev)
|
||||
sbdirty();
|
||||
}
|
||||
}
|
||||
if (sblock.fs_interleave < 1 ||
|
||||
if (sblock.fs_interleave < 1 ||
|
||||
sblock.fs_interleave > sblock.fs_nsect) {
|
||||
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
||||
sblock.fs_interleave);
|
||||
@ -169,7 +169,7 @@ setup(dev)
|
||||
dirty(&asblk);
|
||||
}
|
||||
}
|
||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||
sblock.fs_npsect > sblock.fs_nsect*2) {
|
||||
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
||||
sblock.fs_npsect);
|
||||
@ -277,7 +277,7 @@ setup(dev)
|
||||
}
|
||||
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
||||
if (lncntp == NULL) {
|
||||
printf("cannot alloc %u bytes for lncntp\n",
|
||||
printf("cannot alloc %u bytes for lncntp\n",
|
||||
(unsigned)(maxino + 1) * sizeof(short));
|
||||
goto badsb;
|
||||
}
|
||||
@ -289,7 +289,7 @@ setup(dev)
|
||||
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
||||
sizeof(struct inoinfo *));
|
||||
if (inpsort == NULL || inphead == NULL) {
|
||||
printf("cannot alloc %u bytes for inphead\n",
|
||||
printf("cannot alloc %u bytes for inphead\n",
|
||||
(unsigned)numdirs * sizeof(struct inoinfo *));
|
||||
goto badsb;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
#
|
||||
#
|
||||
|
||||
PROG= fdisk
|
||||
PROG= fdisk
|
||||
SRCS= fdisk.c
|
||||
MAN8= fdisk.8
|
||||
|
||||
|
@ -1,25 +1,25 @@
|
||||
/*
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1992 Carnegie Mellon University
|
||||
* All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||
* the rights to redistribute these changes.
|
||||
*/
|
||||
@ -89,37 +89,37 @@ static int i_flag = 0; /* replace partition data */
|
||||
static int u_flag = 0; /* update partition data */
|
||||
|
||||
static unsigned char bootcode[] = {
|
||||
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
||||
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
||||
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
||||
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
||||
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
||||
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
||||
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
||||
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
||||
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
||||
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
||||
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
||||
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
||||
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
||||
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
||||
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
||||
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
||||
0xeb, 0xf4, 0xfb, 0xeb, 0xfe,
|
||||
'M', 'i', 's', 's', 'i', 'n', 'g', ' ',
|
||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
||||
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||
'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ',
|
||||
'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0,
|
||||
'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ',
|
||||
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
||||
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
||||
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
struct part_type
|
||||
@ -128,46 +128,46 @@ struct part_type
|
||||
char *name;
|
||||
}part_types[] =
|
||||
{
|
||||
{0x00, "unused"}
|
||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||
,{0x02, "XENIX / filesystem"}
|
||||
,{0x03, "XENIX /usr filesystem"}
|
||||
,{0x04, "Primary DOS with 16 bit FAT"}
|
||||
,{0x05, "Extended DOS"}
|
||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||
,{0x08, "AIX filesystem"}
|
||||
,{0x09, "AIX boot partition or Coherent"}
|
||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||
,{0x10, "OPUS"}
|
||||
,{0x40, "VENIX 286"}
|
||||
,{0x50, "DM"}
|
||||
,{0x51, "DM"}
|
||||
,{0x52, "CP/M or Microport SysV/AT"}
|
||||
,{0x56, "GB"}
|
||||
,{0x61, "Speed"}
|
||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||
,{0x64, "Novell Netware 2.xx"}
|
||||
,{0x65, "Novell Netware 3.xx"}
|
||||
,{0x75, "PCIX"}
|
||||
,{0x80, "Minix 1.1 ... 1.4a"}
|
||||
,{0x81, "Minix 1.4b ... 1.5.10"}
|
||||
,{0x82, "Linux swap"}
|
||||
,{0x83, "Linux filesystem"}
|
||||
,{0x93, "Amoeba filesystem"}
|
||||
,{0x94, "Amoeba bad block table"}
|
||||
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
||||
{0x00, "unused"}
|
||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||
,{0x02, "XENIX / filesystem"}
|
||||
,{0x03, "XENIX /usr filesystem"}
|
||||
,{0x04, "Primary DOS with 16 bit FAT"}
|
||||
,{0x05, "Extended DOS"}
|
||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||
,{0x08, "AIX filesystem"}
|
||||
,{0x09, "AIX boot partition or Coherent"}
|
||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||
,{0x10, "OPUS"}
|
||||
,{0x40, "VENIX 286"}
|
||||
,{0x50, "DM"}
|
||||
,{0x51, "DM"}
|
||||
,{0x52, "CP/M or Microport SysV/AT"}
|
||||
,{0x56, "GB"}
|
||||
,{0x61, "Speed"}
|
||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||
,{0x64, "Novell Netware 2.xx"}
|
||||
,{0x65, "Novell Netware 3.xx"}
|
||||
,{0x75, "PCIX"}
|
||||
,{0x80, "Minix 1.1 ... 1.4a"}
|
||||
,{0x81, "Minix 1.4b ... 1.5.10"}
|
||||
,{0x82, "Linux swap"}
|
||||
,{0x83, "Linux filesystem"}
|
||||
,{0x93, "Amoeba filesystem"}
|
||||
,{0x94, "Amoeba bad block table"}
|
||||
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
||||
,{0xA7, "NEXTSTEP"}
|
||||
,{0xB7, "BSDI BSD/386 filesystem"}
|
||||
,{0xB8, "BSDI BSD/386 swap"}
|
||||
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
||||
,{0xE1, "Speed"}
|
||||
,{0xE3, "Speed"}
|
||||
,{0xE4, "Speed"}
|
||||
,{0xF1, "Speed"}
|
||||
,{0xF2, "DOS 3.3+ Secondary"}
|
||||
,{0xF4, "Speed"}
|
||||
,{0xFF, "BBT (Bad Blocks Table)"}
|
||||
,{0xB7, "BSDI BSD/386 filesystem"}
|
||||
,{0xB8, "BSDI BSD/386 swap"}
|
||||
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
||||
,{0xE1, "Speed"}
|
||||
,{0xE3, "Speed"}
|
||||
,{0xE4, "Speed"}
|
||||
,{0xF1, "Speed"}
|
||||
,{0xF2, "DOS 3.3+ Secondary"}
|
||||
,{0xF4, "Speed"}
|
||||
,{0xFF, "BBT (Bad Blocks Table)"}
|
||||
};
|
||||
|
||||
|
||||
@ -216,7 +216,7 @@ int i;
|
||||
|
||||
if (argc > 0)
|
||||
disk = argv[0];
|
||||
|
||||
|
||||
if (open_disk(u_flag) < 0)
|
||||
exit(1);
|
||||
|
||||
@ -302,7 +302,7 @@ struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[3]);
|
||||
int size = disksecs - start;
|
||||
int rest;
|
||||
|
||||
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
||||
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
||||
mboot.signature = BOOT_MAGIC;
|
||||
|
||||
partp->dp_typ = DOSPTYP_386BSD;
|
||||
@ -366,7 +366,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i;
|
||||
dos(partp->dp_start+partp->dp_size - 1,
|
||||
&partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd);
|
||||
}
|
||||
|
||||
|
||||
print_part(i);
|
||||
} while (!ok("Are we happy with this entry?"));
|
||||
}
|
||||
@ -456,7 +456,7 @@ open_disk(u_flag)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (stat(disk, &st) == -1) {
|
||||
if (stat(disk, &st) == -1) {
|
||||
fprintf(stderr, "%s: Can't get file status of %s\n",
|
||||
name, disk);
|
||||
return -1;
|
||||
@ -516,7 +516,7 @@ get_params(verbose)
|
||||
|
||||
read_s0()
|
||||
{
|
||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
fprintf(stderr, "%s: Can't read fdisk partition table\n", name);
|
||||
return -1;
|
||||
}
|
||||
@ -545,7 +545,7 @@ write_s0()
|
||||
flag = 1;
|
||||
if (ioctl(fd, DIOCWLABEL, &flag) < 0)
|
||||
perror("ioctl DIOCWLABEL");
|
||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||
fprintf(stderr, "%s: Can't write fdisk partition table\n",
|
||||
name);
|
||||
return -1;
|
||||
@ -687,7 +687,7 @@ int type;
|
||||
int counter = 0;
|
||||
struct part_type *ptr = part_types;
|
||||
|
||||
|
||||
|
||||
while(counter < numentries)
|
||||
{
|
||||
if(ptr->type == type)
|
||||
|
@ -105,7 +105,7 @@ check_stat(int fd, int wr)
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((s & QS_FMTOK) == 0) {
|
||||
fprintf(stderr, "tape is not formatted\n");
|
||||
return(2);
|
||||
|
@ -68,8 +68,8 @@ static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <nlist.h>
|
||||
#include <kvm.h>
|
||||
#include <nlist.h>
|
||||
#include <kvm.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
struct ifreq ifr, ridreq;
|
||||
@ -287,7 +287,7 @@ ifconfig(argc,argv,af,rafp,flag)
|
||||
perror("ioctl (SIOCGIFMTU)");
|
||||
else
|
||||
mtu = ifr.ifr_mtu;
|
||||
if (argc == 0) {
|
||||
if (argc == 0) {
|
||||
status();
|
||||
return(0);
|
||||
}
|
||||
@ -701,7 +701,7 @@ ether_status()
|
||||
m += printf("%02x%c",
|
||||
*cp++ & 0xff,
|
||||
n > 0 ? ':' : ' ');
|
||||
putchar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -710,7 +710,7 @@ ether_status()
|
||||
}
|
||||
kvm_close(kvmd);
|
||||
}
|
||||
|
||||
|
||||
Perror(cmd)
|
||||
char *cmd;
|
||||
{
|
||||
|
@ -678,14 +678,14 @@ single_user()
|
||||
return (state_func_t) requested_transition;
|
||||
|
||||
if (!WIFEXITED(status)) {
|
||||
if (WTERMSIG(status) == SIGKILL) {
|
||||
/*
|
||||
* reboot(8) killed shell?
|
||||
if (WTERMSIG(status) == SIGKILL) {
|
||||
/*
|
||||
* reboot(8) killed shell?
|
||||
*/
|
||||
warning("single user shell terminated.");
|
||||
sleep(STALL_TIMEOUT);
|
||||
_exit(0);
|
||||
} else {
|
||||
} else {
|
||||
warning("single user shell terminated, restarting");
|
||||
return (state_func_t) single_user;
|
||||
}
|
||||
@ -797,7 +797,7 @@ start_session_db()
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1215,7 +1215,7 @@ multi_user()
|
||||
/*
|
||||
* If the administrator has not set the security level to -1
|
||||
* to indicate that the kernel should not run multiuser in secure
|
||||
* mode, and the run script has not set a higher level of security
|
||||
* mode, and the run script has not set a higher level of security
|
||||
* than level 1, then put the kernel into secure mode.
|
||||
*/
|
||||
if (getsecuritylevel() == 0)
|
||||
@ -1391,7 +1391,7 @@ strk (char *p)
|
||||
return 0;
|
||||
|
||||
c = *t;
|
||||
while (c == ' ' || c == '\t' )
|
||||
while (c == ' ' || c == '\t' )
|
||||
c = *++t;
|
||||
if (!c) {
|
||||
t = 0;
|
||||
@ -1401,7 +1401,7 @@ strk (char *p)
|
||||
if (c == '\'') {
|
||||
c = *++t;
|
||||
q = t;
|
||||
while (c && c != '\'')
|
||||
while (c && c != '\'')
|
||||
c = *++t;
|
||||
if (!c) /* unterminated string */
|
||||
q = t = 0;
|
||||
@ -1411,7 +1411,7 @@ strk (char *p)
|
||||
while (c && c != ' ' && c != '\t' )
|
||||
c = *++t;
|
||||
*t++ = 0;
|
||||
if (!c)
|
||||
if (!c)
|
||||
t = 0;
|
||||
}
|
||||
return q;
|
||||
|
@ -77,11 +77,11 @@ char action_tab[][MAXSTR]={
|
||||
"f",
|
||||
#define A_FLUSH 6
|
||||
"z",
|
||||
#define A_ZERO 7
|
||||
#define A_ZERO 7
|
||||
"l",
|
||||
#define A_LIST 8
|
||||
#define A_LIST 8
|
||||
"po",
|
||||
#define A_POLICY 9
|
||||
#define A_POLICY 9
|
||||
"",
|
||||
#define A_NONE 10
|
||||
};
|
||||
@ -158,7 +158,7 @@ u_long mask;
|
||||
return -1;
|
||||
}
|
||||
mask=mask>>1;
|
||||
}
|
||||
}
|
||||
return h_num;
|
||||
}
|
||||
|
||||
@ -178,16 +178,16 @@ int i,mb;
|
||||
if (do_short && do_acct) {
|
||||
printf("%8d:%8d ",chain->fw_bcnt,chain->fw_pcnt);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (do_short)
|
||||
if (c_t==FW) {
|
||||
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
||||
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
||||
if (chain->fw_flg & IP_FW_F_PRN)
|
||||
printf("l");
|
||||
else
|
||||
printf("a");
|
||||
else
|
||||
else
|
||||
if (chain->fw_flg & IP_FW_F_PRN)
|
||||
if (chain->fw_flg & IP_FW_F_ICMPRPL)
|
||||
printf("R");
|
||||
@ -199,19 +199,19 @@ if (do_short)
|
||||
else
|
||||
printf("d");
|
||||
} else {
|
||||
if (chain->fw_flg & IP_FW_F_BIDIR)
|
||||
if (chain->fw_flg & IP_FW_F_BIDIR)
|
||||
printf("b");
|
||||
else
|
||||
else
|
||||
printf("s");
|
||||
}
|
||||
else
|
||||
if (c_t==FW) {
|
||||
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
||||
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
||||
if (chain->fw_flg & IP_FW_F_PRN)
|
||||
printf("log ");
|
||||
else
|
||||
printf("accept ");
|
||||
else
|
||||
else
|
||||
if (chain->fw_flg & IP_FW_F_PRN)
|
||||
if (chain->fw_flg & IP_FW_F_ICMPRPL)
|
||||
printf("lreject ");
|
||||
@ -223,9 +223,9 @@ else
|
||||
else
|
||||
printf("deny ");
|
||||
} else {
|
||||
if (chain->fw_flg & IP_FW_F_BIDIR)
|
||||
if (chain->fw_flg & IP_FW_F_BIDIR)
|
||||
printf("bidir ");
|
||||
else
|
||||
else
|
||||
printf("single ");
|
||||
}
|
||||
|
||||
@ -299,9 +299,9 @@ else
|
||||
comma = " ";
|
||||
for (i=0;i<chain->fw_nsp; i++ ) {
|
||||
printf("%s%d",comma,chain->fw_pts[i]);
|
||||
if (i==0 && (chain->fw_flg & IP_FW_F_SRNG))
|
||||
if (i==0 && (chain->fw_flg & IP_FW_F_SRNG))
|
||||
comma = ":";
|
||||
else
|
||||
else
|
||||
comma = ",";
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ else
|
||||
printf("%s",he->h_name);
|
||||
} else {
|
||||
printf(inet_ntoa(chain->fw_dst));
|
||||
if (adrt!=ULONG_MAX)
|
||||
if (adrt!=ULONG_MAX)
|
||||
if ((mb=mask_bits(chain->fw_dmsk))>=0)
|
||||
printf("/%d",mb);
|
||||
else {
|
||||
@ -336,7 +336,7 @@ else
|
||||
printf("%s%d",comma,chain->fw_pts[chain->fw_nsp+i]);
|
||||
if (i==chain->fw_nsp && (chain->fw_flg & IP_FW_F_DRNG))
|
||||
comma = ":";
|
||||
else
|
||||
else
|
||||
comma = ",";
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ int a_max;
|
||||
int *is_range;
|
||||
{
|
||||
char *s_pr2,*s_h,*s_t,*cp;
|
||||
u_short p1,p2;
|
||||
u_short p1,p2;
|
||||
int i=0;
|
||||
|
||||
(void)strtok(str,":");
|
||||
@ -556,7 +556,7 @@ struct hostent *hptr;
|
||||
mask->s_addr=0L;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (mask) {
|
||||
(void)strtok(str,"/");
|
||||
@ -564,7 +564,7 @@ struct hostent *hptr;
|
||||
(void)strtok(str,":");
|
||||
sm_oct=strtok(NULL,"");
|
||||
}
|
||||
|
||||
|
||||
if (!inet_aton(str,addr)) {
|
||||
if (do_resolv) {
|
||||
if (!(hptr=gethostbyname(str))) {
|
||||
@ -581,7 +581,7 @@ struct hostent *hptr;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is in case mask we
|
||||
* This is in case mask we
|
||||
* want to set IP only
|
||||
*/
|
||||
if (!mask)
|
||||
@ -603,7 +603,7 @@ struct hostent *hptr;
|
||||
htonl(ULONG_MAX<<(sizeof(u_long)*CHAR_BIT-n_bit));
|
||||
else
|
||||
mask->s_addr=0L;
|
||||
}
|
||||
}
|
||||
|
||||
if (sm_oct) {
|
||||
if (!inet_aton(sm_oct,mask)) {
|
||||
@ -620,14 +620,14 @@ struct hostent *hptr;
|
||||
}
|
||||
|
||||
|
||||
int set_entry_ifname(str,frwl)
|
||||
int set_entry_ifname(str,frwl)
|
||||
char *str;
|
||||
struct ip_fw * frwl;
|
||||
{
|
||||
char name[IFNAMSIZ],buf[IFNAMSIZ],*sptr;
|
||||
short unit;
|
||||
int i;
|
||||
|
||||
|
||||
i=0; sptr=str;
|
||||
while(isalpha(*sptr++)) {
|
||||
i++;
|
||||
@ -654,7 +654,7 @@ int i;
|
||||
}
|
||||
|
||||
|
||||
void set_entry(av,frwl)
|
||||
void set_entry(av,frwl)
|
||||
char **av;
|
||||
struct ip_fw * frwl;
|
||||
{
|
||||
@ -711,7 +711,7 @@ int token;
|
||||
show_usage("Missing 'to' specification.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
set_entry_ip(*av,&(frwl->fw_dst),&(frwl->fw_dmsk));
|
||||
got_to = 1;
|
||||
}
|
||||
@ -729,7 +729,7 @@ int token;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try first to set interface name
|
||||
* Try first to set interface name
|
||||
* from arguments.set_entry_ip() will exit on
|
||||
* wrong argument.
|
||||
*/
|
||||
@ -838,7 +838,7 @@ if (*av==NULL || strlen(*av)<=0) {
|
||||
}
|
||||
if (kvm_nlist(kd,nlf) < 0 || nlf[0].n_type == 0) {
|
||||
fprintf(stderr,"%s: kvm_nlist: no namelist in %s\n",
|
||||
progname,getbootfile());
|
||||
progname,getbootfile());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -900,7 +900,7 @@ struct ip_fw frwl;
|
||||
|
||||
s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW );
|
||||
if ( s < 0 ) {
|
||||
fprintf(stderr,"%s: Can't open raw socket.Must be root to use this programm. \n",progname);
|
||||
fprintf(stderr,"%s: Can't open raw socket.Must be root to use this programm. \n",progname);
|
||||
exit(1);
|
||||
}
|
||||
if ( ac == 1 ) {
|
||||
@ -922,7 +922,7 @@ struct ip_fw frwl;
|
||||
case '?':
|
||||
default:
|
||||
show_usage(NULL);
|
||||
exit(1);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (*(av+=optind)==NULL) {
|
||||
@ -956,13 +956,13 @@ struct ip_fw frwl;
|
||||
int_t=AC;
|
||||
break;
|
||||
case A_FLUSH:
|
||||
flush(++av);
|
||||
flush(++av);
|
||||
exit(0); /* successful exit */
|
||||
case A_LIST:
|
||||
list(++av);
|
||||
list(++av);
|
||||
exit(0); /* successful exit */
|
||||
case A_ZERO:
|
||||
zero();
|
||||
zero();
|
||||
exit(0); /* successful exit */
|
||||
case A_POLICY:
|
||||
policy(++av);
|
||||
@ -974,7 +974,7 @@ struct ip_fw frwl;
|
||||
|
||||
if (is_check)
|
||||
goto proto_switch;
|
||||
|
||||
|
||||
if (!int_notdef)
|
||||
if (*(++av)==NULL) {
|
||||
show_usage(NULL);
|
||||
@ -1078,14 +1078,14 @@ struct ip_fw frwl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
set_entry(av,&frwl);
|
||||
set_entry(av,&frwl);
|
||||
frwl.fw_flg=flags;
|
||||
|
||||
if (is_check) {
|
||||
#ifndef disabled
|
||||
fprintf(stderr,"%s: checking disabled.\n",progname);
|
||||
#else
|
||||
|
||||
|
||||
struct ip *pkt;
|
||||
struct tcphdr *th;
|
||||
int p_len=sizeof(struct ip)+sizeof(struct tcphdr);
|
||||
@ -1120,10 +1120,10 @@ struct ip_fw frwl;
|
||||
}
|
||||
pkt->ip_src.s_addr=frwl.fw_src.s_addr;
|
||||
pkt->ip_dst.s_addr=frwl.fw_dst.s_addr;
|
||||
|
||||
|
||||
th->th_sport=htons(frwl.fw_pts[0]);
|
||||
th->th_dport=htons(frwl.fw_pts[frwl.fw_nsp]);
|
||||
|
||||
|
||||
if (setsockopt(s,IPPROTO_IP,ctl,pkt,p_len))
|
||||
printf("Packet DENYED.\n");
|
||||
else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: md5.c,v 1.3 1995/02/26 01:55:31 phk Exp $
|
||||
* $Id: md5.c,v 1.4 1995/02/26 02:00:35 phk Exp $
|
||||
*
|
||||
* Derived from:
|
||||
*/
|
||||
@ -67,7 +67,7 @@ main(argc, argv)
|
||||
MDTestSuite();
|
||||
else {
|
||||
p = MD5File(argv[i]);
|
||||
if (!p)
|
||||
if (!p)
|
||||
perror(argv[i]);
|
||||
else
|
||||
printf("MD5 (%s) = %s\n", argv[i], p);
|
||||
|
@ -29,7 +29,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: modload.c,v 1.6 1995/01/23 04:07:57 wollman Exp $
|
||||
* $Id: modload.c,v 1.7 1995/03/16 17:11:21 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -106,7 +106,7 @@ linkcmd(kernel, entry, outfile, address, object)
|
||||
waitpid(pid, &status, 0);
|
||||
|
||||
if(WIFSIGNALED(status)) {
|
||||
errx(1, "%s got signal: %s", _PATH_LD,
|
||||
errx(1, "%s got signal: %s", _PATH_LD,
|
||||
sys_siglist[WTERMSIG(status)]);
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ mount_ufs(argc, argv)
|
||||
/*warnx("ufs: filesystem not found");*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) {
|
||||
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
||||
switch (errno) {
|
||||
@ -128,7 +128,7 @@ mount_ufs(argc, argv)
|
||||
if (mntflags & MNT_UPDATE)
|
||||
(void)fprintf(stderr,
|
||||
"Specified device does not match mounted device.\n");
|
||||
else
|
||||
else
|
||||
(void)fprintf(stderr,
|
||||
"Incorrect super block.\n");
|
||||
break;
|
||||
|
@ -117,7 +117,7 @@ mount_ufs(argc, argv)
|
||||
/*warnx("ufs: filesystem not found");*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) {
|
||||
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
||||
switch (errno) {
|
||||
@ -128,7 +128,7 @@ mount_ufs(argc, argv)
|
||||
if (mntflags & MNT_UPDATE)
|
||||
(void)fprintf(stderr,
|
||||
"Specified device does not match mounted device.\n");
|
||||
else
|
||||
else
|
||||
(void)fprintf(stderr,
|
||||
"Incorrect super block.\n");
|
||||
break;
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)conf.c 8.2 (Berkeley) 3/27/94
|
||||
*
|
||||
* $Id: conf.c,v 1.2 1992/05/27 07:09:27 jsp Exp jsp $
|
||||
* $Id: conf.c,v 1.2 1995/02/21 04:05:20 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -131,7 +131,7 @@ qelem *q0;
|
||||
}
|
||||
ins_que(&p0->p_q, q0->q_back);
|
||||
return (1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static path *palloc(cline, lno)
|
||||
|
@ -220,7 +220,7 @@ main(argc, argv)
|
||||
conf_read(&q, conf);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Accept a new connection
|
||||
* Will get EINTR if a signal has arrived, so just
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* @(#)conf.c 8.2 (Berkeley) 3/27/94
|
||||
*
|
||||
* $Id: conf.c,v 1.2 1992/05/27 07:09:27 jsp Exp jsp $
|
||||
* $Id: conf.c,v 1.2 1995/02/21 04:05:20 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@ -131,7 +131,7 @@ qelem *q0;
|
||||
}
|
||||
ins_que(&p0->p_q, q0->q_back);
|
||||
return (1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static path *palloc(cline, lno)
|
||||
|
@ -220,7 +220,7 @@ main(argc, argv)
|
||||
conf_read(&q, conf);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Accept a new connection
|
||||
* Will get EINTR if a signal has arrived, so just
|
||||
|
@ -68,12 +68,12 @@ static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94";
|
||||
|
||||
/*
|
||||
* This routine provides the user interface to mounting a umap layer.
|
||||
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
||||
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
||||
* where the next lower level is mounted, the place where the umap layer is to
|
||||
* be mounted, the name of the user mapfile, and the name of the group
|
||||
* mapfile. The routine checks the ownerships and permissions on the
|
||||
* mapfiles, then opens and reads them. Then it calls mount(), which
|
||||
* will, in turn, call the umap version of mount.
|
||||
* will, in turn, call the umap version of mount.
|
||||
*/
|
||||
|
||||
struct mntopt mopts[] = {
|
||||
@ -130,7 +130,7 @@ main(argc, argv)
|
||||
#ifdef MAPSECURITY
|
||||
/*
|
||||
* Check that group and other don't have write permissions on
|
||||
* this mapfile, and that the mapfile belongs to root.
|
||||
* this mapfile, and that the mapfile belongs to root.
|
||||
*/
|
||||
if (fstat(fileno(fp), &statbuf))
|
||||
err(1, "%s%s", mapfile, not);
|
||||
@ -177,7 +177,7 @@ main(argc, argv)
|
||||
#ifdef MAPSECURITY
|
||||
/*
|
||||
* Check that group and other don't have write permissions on
|
||||
* this group mapfile, and that the file belongs to root.
|
||||
* this group mapfile, and that the file belongs to root.
|
||||
*/
|
||||
if (fstat(fileno(gfp), &statbuf))
|
||||
err(1, "%s%s", gmapfile, not);
|
||||
|
@ -68,12 +68,12 @@ static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94";
|
||||
|
||||
/*
|
||||
* This routine provides the user interface to mounting a umap layer.
|
||||
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
||||
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
||||
* where the next lower level is mounted, the place where the umap layer is to
|
||||
* be mounted, the name of the user mapfile, and the name of the group
|
||||
* mapfile. The routine checks the ownerships and permissions on the
|
||||
* mapfiles, then opens and reads them. Then it calls mount(), which
|
||||
* will, in turn, call the umap version of mount.
|
||||
* will, in turn, call the umap version of mount.
|
||||
*/
|
||||
|
||||
struct mntopt mopts[] = {
|
||||
@ -130,7 +130,7 @@ main(argc, argv)
|
||||
#ifdef MAPSECURITY
|
||||
/*
|
||||
* Check that group and other don't have write permissions on
|
||||
* this mapfile, and that the mapfile belongs to root.
|
||||
* this mapfile, and that the mapfile belongs to root.
|
||||
*/
|
||||
if (fstat(fileno(fp), &statbuf))
|
||||
err(1, "%s%s", mapfile, not);
|
||||
@ -177,7 +177,7 @@ main(argc, argv)
|
||||
#ifdef MAPSECURITY
|
||||
/*
|
||||
* Check that group and other don't have write permissions on
|
||||
* this group mapfile, and that the file belongs to root.
|
||||
* this group mapfile, and that the file belongs to root.
|
||||
*/
|
||||
if (fstat(fileno(gfp), &statbuf))
|
||||
err(1, "%s%s", gmapfile, not);
|
||||
|
@ -43,7 +43,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
|
||||
static const char rcsid[] =
|
||||
"$Id: mountd.c,v 1.5 1995/03/26 23:36:38 wpaul Exp $";
|
||||
"$Id: mountd.c,v 1.6 1995/05/21 19:31:09 phk Exp $";
|
||||
#endif /*not lint*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -580,14 +580,14 @@ put_exlist(dp, xdrsp, adp, putdefp)
|
||||
if (!xdr_bool(xdrsp, &true))
|
||||
return (1);
|
||||
strp = grp->gr_ptr.gt_hostent->h_name;
|
||||
if (!xdr_string(xdrsp, &strp,
|
||||
if (!xdr_string(xdrsp, &strp,
|
||||
RPCMNT_NAMELEN))
|
||||
return (1);
|
||||
} else if (grp->gr_type == GT_NET) {
|
||||
if (!xdr_bool(xdrsp, &true))
|
||||
return (1);
|
||||
strp = grp->gr_ptr.gt_net.nt_name;
|
||||
if (!xdr_string(xdrsp, &strp,
|
||||
if (!xdr_string(xdrsp, &strp,
|
||||
RPCMNT_NAMELEN))
|
||||
return (1);
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ mkfs(pp, fsys, fi, fo)
|
||||
fsize, sblock.fs_fsize);
|
||||
exit(23);
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* Calculate the number of cylinders per group
|
||||
*/
|
||||
sblock.fs_cpg = cpg;
|
||||
@ -645,7 +645,7 @@ mkfs(pp, fsys, fi, fo)
|
||||
sblock.fs_cssize - i < sblock.fs_bsize ?
|
||||
sblock.fs_cssize - i : sblock.fs_bsize,
|
||||
((char *)fscs) + i);
|
||||
/*
|
||||
/*
|
||||
* Write out the duplicate super blocks
|
||||
*/
|
||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||
@ -712,7 +712,7 @@ initcg(cylno, utime)
|
||||
acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag;
|
||||
acg.cg_btotoff = &acg.cg_space[0] - (u_char *)(&acg.cg_link);
|
||||
acg.cg_boff = acg.cg_btotoff + sblock.fs_cpg * sizeof(long);
|
||||
acg.cg_iusedoff = acg.cg_boff +
|
||||
acg.cg_iusedoff = acg.cg_boff +
|
||||
sblock.fs_cpg * sblock.fs_nrpos * sizeof(short);
|
||||
acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, NBBY);
|
||||
if (sblock.fs_contigsumsize <= 0) {
|
||||
@ -1110,7 +1110,7 @@ calloc(size, numelm)
|
||||
free(ptr)
|
||||
char *ptr;
|
||||
{
|
||||
|
||||
|
||||
/* do not worry about it for now */
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ static struct lfs lfs_default = {
|
||||
/* lfs_offset */ 0,
|
||||
/* lfs_lastpseg */ 0,
|
||||
/* lfs_tstamp */ 0,
|
||||
/* lfs_maxsymlinklen */ MAXSYMLINKLEN,
|
||||
/* lfs_maxsymlinklen */ MAXSYMLINKLEN,
|
||||
/* lfs_minfree */ MINFREE,
|
||||
/* lfs_maxfilesize */ 0,
|
||||
/* lfs_dbpseg */ DFL_LFSSEG/DEV_BSIZE,
|
||||
@ -144,7 +144,7 @@ static struct lfs lfs_default = {
|
||||
/* lfs_flags */ 0,
|
||||
/* lfs_fsmnt */ { 0 },
|
||||
/* lfs_pad */ { 0 },
|
||||
/* lfs_pad2 */ { 0 },
|
||||
/* lfs_pad2 */ { 0 },
|
||||
/* lfs_cksum */ 0
|
||||
};
|
||||
|
||||
@ -161,7 +161,7 @@ struct direct lfs_lf_dir[] = {
|
||||
{ ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
|
||||
};
|
||||
|
||||
static daddr_t make_dinode
|
||||
static daddr_t make_dinode
|
||||
__P((ino_t, struct dinode *, int, daddr_t, struct lfs *));
|
||||
static void make_dir __P(( void *, struct direct *, int));
|
||||
static void put __P((int, off_t, void *, size_t));
|
||||
@ -251,7 +251,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
lfsp->lfs_nseg = lfsp->lfs_dsize / lfsp->lfs_ssize;
|
||||
lfsp->lfs_maxfilesize = maxtable[lfsp->lfs_bshift] << lfsp->lfs_bshift;
|
||||
|
||||
/*
|
||||
/*
|
||||
* The number of free blocks is set from the number of segments times
|
||||
* the segment size - 2 (that we never write because we need to make
|
||||
* sure the cleaner can run). Then we'll subtract off the room for the
|
||||
@ -278,7 +278,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
/* Figure out where the superblocks are going to live */
|
||||
lfsp->lfs_sboffs[0] = LFS_LABELPAD/lp->d_secsize;
|
||||
for (i = 1; i < LFS_MAXNUMSB; i++) {
|
||||
sb_addr = ((i * sb_interval) <<
|
||||
sb_addr = ((i * sb_interval) <<
|
||||
(lfsp->lfs_segshift - lfsp->lfs_bshift + lfsp->lfs_fsbtodb))
|
||||
+ lfsp->lfs_sboffs[0];
|
||||
if (sb_addr > partp->p_size)
|
||||
@ -287,15 +287,15 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
}
|
||||
last_sb_addr = lfsp->lfs_sboffs[i - 1];
|
||||
lfsp->lfs_lastseg = lfsp->lfs_sboffs[0];
|
||||
lfsp->lfs_nextseg =
|
||||
lfsp->lfs_nextseg =
|
||||
lfsp->lfs_sboffs[1] ? lfsp->lfs_sboffs[1] : lfsp->lfs_sboffs[0];
|
||||
lfsp->lfs_curseg = lfsp->lfs_lastseg;
|
||||
|
||||
/*
|
||||
* Initialize the segment usage table. The first segment will
|
||||
* contain the superblock, the cleanerinfo (cleansz), the segusage
|
||||
* table * (segtabsz), 1 block's worth of IFILE entries, the root
|
||||
* directory, the lost+found directory and one block's worth of
|
||||
* contain the superblock, the cleanerinfo (cleansz), the segusage
|
||||
* table * (segtabsz), 1 block's worth of IFILE entries, the root
|
||||
* directory, the lost+found directory and one block's worth of
|
||||
* inodes (containing the ifile, root, and l+f inodes).
|
||||
*/
|
||||
if (!(cleaninfo = malloc(lfsp->lfs_cleansz << lfsp->lfs_bshift)))
|
||||
@ -317,7 +317,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
lfsp->lfs_bfree -=
|
||||
fsbtodb(lfsp, lfsp->lfs_cleansz + lfsp->lfs_segtabsz + 4);
|
||||
|
||||
/*
|
||||
/*
|
||||
* Now figure out the address of the ifile inode. The inode block
|
||||
* appears immediately after the segment summary.
|
||||
*/
|
||||
@ -336,27 +336,27 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
segp->su_nsums = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Initialize dynamic accounting. The blocks available for
|
||||
* writing are the bfree blocks minus 1 segment summary for
|
||||
* each segment since you can't write any new data without
|
||||
* creating a segment summary - 2 segments that the cleaner
|
||||
* needs.
|
||||
*/
|
||||
lfsp->lfs_avail = lfsp->lfs_bfree - lfsp->lfs_nseg -
|
||||
lfsp->lfs_avail = lfsp->lfs_bfree - lfsp->lfs_nseg -
|
||||
fsbtodb(lfsp, 2 * lfsp->lfs_ssize);
|
||||
lfsp->lfs_uinodes = 0;
|
||||
/*
|
||||
* Ready to start writing segments. The first segment is different
|
||||
* because it contains the segment usage table and the ifile inode
|
||||
* as well as a superblock. For the rest of the segments, set the
|
||||
* as well as a superblock. For the rest of the segments, set the
|
||||
* time stamp to be 0 so that the first segment is the most recent.
|
||||
* For each segment that is supposed to contain a copy of the super
|
||||
* block, initialize its first few blocks and its segment summary
|
||||
* block, initialize its first few blocks and its segment summary
|
||||
* to indicate this.
|
||||
*/
|
||||
lfsp->lfs_nfiles = LFS_FIRST_INUM - 1;
|
||||
lfsp->lfs_cksum =
|
||||
lfsp->lfs_cksum =
|
||||
cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum));
|
||||
|
||||
/* Now create a block of disk inodes */
|
||||
@ -370,13 +370,13 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
fatal("%s", strerror(errno));
|
||||
ifile = (IFILE *)ipagep;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Initialize IFILE. It is the next block following the
|
||||
* block of inodes (whose address has been calculated in
|
||||
* lfsp->lfs_idaddr;
|
||||
*/
|
||||
sb_addr = lfsp->lfs_idaddr + lfsp->lfs_bsize / lp->d_secsize;
|
||||
sb_addr = make_dinode(LFS_IFILE_INUM, dip,
|
||||
sb_addr = make_dinode(LFS_IFILE_INUM, dip,
|
||||
lfsp->lfs_cleansz + lfsp->lfs_segtabsz+1, sb_addr, lfsp);
|
||||
dip->di_mode = IFREG|IREAD|IWRITE;
|
||||
ip = &ifile[LFS_IFILE_INUM];
|
||||
@ -404,10 +404,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
/* Make all the other dinodes invalid */
|
||||
for (i = INOPB(lfsp)-3, dip++; i; i--, dip++)
|
||||
dip->di_inumber = LFS_UNUSED_INUM;
|
||||
|
||||
|
||||
|
||||
/* Link remaining IFILE entries in free list */
|
||||
for (ip = &ifile[LFS_FIRST_INUM], i = LFS_FIRST_INUM;
|
||||
for (ip = &ifile[LFS_FIRST_INUM], i = LFS_FIRST_INUM;
|
||||
i < lfsp->lfs_ifpb; ++ip) {
|
||||
ip->if_version = 1;
|
||||
ip->if_daddr = LFS_UNUSED_DADDR;
|
||||
@ -421,10 +421,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
dp = datasump = malloc (blocks_used * sizeof(u_long));
|
||||
*dp++ = ((u_long *)dpagep)[0]; /* inode block */
|
||||
for (i = 0; i < lfsp->lfs_cleansz; i++)
|
||||
*dp++ = ((u_long *)cleaninfo)[(i << lfsp->lfs_bshift) /
|
||||
*dp++ = ((u_long *)cleaninfo)[(i << lfsp->lfs_bshift) /
|
||||
sizeof(u_long)]; /* Cleaner info */
|
||||
for (i = 0; i < lfsp->lfs_segtabsz; i++)
|
||||
*dp++ = ((u_long *)segtable)[(i << lfsp->lfs_bshift) /
|
||||
*dp++ = ((u_long *)segtable)[(i << lfsp->lfs_bshift) /
|
||||
sizeof(u_long)]; /* Segusage table */
|
||||
*dp++ = ((u_long *)ifile)[0]; /* Ifile */
|
||||
|
||||
@ -450,20 +450,20 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
off += lfsp->lfs_bsize;
|
||||
|
||||
/*
|
||||
* use ipagep for space for writing out other stuff. It used to
|
||||
* use ipagep for space for writing out other stuff. It used to
|
||||
* contain the ifile, but we're done with it.
|
||||
*/
|
||||
|
||||
/* Write out the root and lost and found directories */
|
||||
bzero(ipagep, lfsp->lfs_bsize);
|
||||
make_dir(ipagep, lfs_root_dir,
|
||||
make_dir(ipagep, lfs_root_dir,
|
||||
sizeof(lfs_root_dir) / sizeof(struct direct));
|
||||
*dp++ = ((u_long *)ipagep)[0];
|
||||
put(fd, off, ipagep, lfsp->lfs_bsize);
|
||||
off += lfsp->lfs_bsize;
|
||||
|
||||
bzero(ipagep, lfsp->lfs_bsize);
|
||||
make_dir(ipagep, lfs_lf_dir,
|
||||
make_dir(ipagep, lfs_lf_dir,
|
||||
sizeof(lfs_lf_dir) / sizeof(struct direct));
|
||||
*dp++ = ((u_long *)ipagep)[0];
|
||||
put(fd, off, ipagep, lfsp->lfs_bsize);
|
||||
@ -472,7 +472,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
lfsp->lfs_offset = (off + lfsp->lfs_bsize) / lp->d_secsize;
|
||||
put(fd, LFS_LABELPAD, lfsp, sizeof(struct lfs));
|
||||
|
||||
/*
|
||||
/*
|
||||
* Finally, calculate all the fields for the summary structure
|
||||
* and write it.
|
||||
*/
|
||||
@ -536,9 +536,9 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
file_info.fi_ino = LOSTFOUNDINO;
|
||||
bcopy(&file_info, sump, sizeof(FINFO));
|
||||
|
||||
((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] =
|
||||
((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] =
|
||||
lfsp->lfs_idaddr;
|
||||
((SEGSUM *)ipagep)->ss_sumsum = cksum(ipagep+sizeof(summary.ss_sumsum),
|
||||
((SEGSUM *)ipagep)->ss_sumsum = cksum(ipagep+sizeof(summary.ss_sumsum),
|
||||
LFS_SUMMARY_SIZE - sizeof(summary.ss_sumsum));
|
||||
put(fd, LFS_LABELPAD + LFS_SBPAD, ipagep, LFS_SUMMARY_SIZE);
|
||||
|
||||
@ -556,9 +556,9 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
put(fd, off, sp, LFS_SUMMARY_SIZE);
|
||||
|
||||
/* Now, write rest of segments containing superblocks */
|
||||
lfsp->lfs_cksum =
|
||||
lfsp->lfs_cksum =
|
||||
cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum));
|
||||
for (seg_addr = last_addr = lfsp->lfs_sboffs[0], j = 1, i = 1;
|
||||
for (seg_addr = last_addr = lfsp->lfs_sboffs[0], j = 1, i = 1;
|
||||
i < lfsp->lfs_nseg; i++) {
|
||||
|
||||
seg_addr += lfsp->lfs_ssize << lfsp->lfs_fsbtodb;
|
||||
@ -571,10 +571,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
||||
j++;
|
||||
put(fd, seg_seek, lfsp, sizeof(struct lfs));
|
||||
seg_seek += LFS_SBPAD;
|
||||
}
|
||||
}
|
||||
|
||||
/* Summary */
|
||||
sp->ss_sumsum = cksum(&sp->ss_datasum,
|
||||
sp->ss_sumsum = cksum(&sp->ss_datasum,
|
||||
LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum));
|
||||
put(fd, seg_seek, sp, LFS_SUMMARY_SIZE);
|
||||
}
|
||||
@ -649,7 +649,7 @@ make_dinode(ino, dip, nblocks, saddr, lfsp)
|
||||
|
||||
/*
|
||||
* Construct a set of directory entries in "bufp". We assume that all the
|
||||
* entries in protodir fir in the first DIRBLKSIZ.
|
||||
* entries in protodir fir in the first DIRBLKSIZ.
|
||||
*/
|
||||
static void
|
||||
make_dir(bufp, protodir, entries)
|
||||
|
@ -323,7 +323,7 @@ main(argc, argv)
|
||||
if (bsize <= 0)
|
||||
bsize = MIN(DFL_LFSBLOCK, 8 * fsize);
|
||||
}
|
||||
|
||||
|
||||
if (segsize == 0) {
|
||||
segsize = pp->p_cpg * bsize;
|
||||
if (segsize <= 0)
|
||||
|
@ -706,8 +706,8 @@ status()
|
||||
double temp_min = nreceived ? tmin : 0;
|
||||
(void)fprintf(stderr, "%ld/%ld packets received (%ld%%) "
|
||||
"%.3f min / %.3f avg / %.3f max\n",
|
||||
nreceived, ntransmitted,
|
||||
(ntransmitted ?
|
||||
nreceived, ntransmitted,
|
||||
(ntransmitted ?
|
||||
100 - (int) (((ntransmitted - nreceived) * 100)
|
||||
/ ntransmitted)
|
||||
: 0),
|
||||
@ -755,7 +755,7 @@ finish()
|
||||
tcsetattr (0, TCSANOW, &ts);
|
||||
}
|
||||
|
||||
if (nreceived)
|
||||
if (nreceived)
|
||||
exit(0);
|
||||
else
|
||||
exit(2);
|
||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
||||
maxrun = ndisks;
|
||||
nextdisk = disks;
|
||||
for (passno = 0; passno < maxrun; ++passno) {
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||
nrun > 0)
|
||||
sleep(10);
|
||||
if (ret)
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Rdisc (this program) was developed by 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 Rdisc without charge, and they may freely
|
||||
* Rdisc (this program) was developed by 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 Rdisc without charge, and they may freely
|
||||
* distribute it.
|
||||
*
|
||||
* RDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
@ -57,7 +57,7 @@
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
|
||||
/*
|
||||
/*
|
||||
* TBD
|
||||
* Use 255.255.255.255 for broadcasts - not the interface broadcast
|
||||
* address.
|
||||
@ -162,7 +162,7 @@ int solicit = 0;
|
||||
int responder;
|
||||
int ntransmitted = 0;
|
||||
int nreceived = 0;
|
||||
int forever = 0; /* Never give up on host. If 0 defer fork until
|
||||
int forever = 0; /* Never give up on host. If 0 defer fork until
|
||||
* first response.
|
||||
*/
|
||||
|
||||
@ -177,7 +177,7 @@ int preference = 0; /* Setable with -p option */
|
||||
/* Host variables */
|
||||
int max_solicitations = MAX_SOLICITATIONS;
|
||||
unsigned int solicitation_interval = SOLICITATION_INTERVAL;
|
||||
int best_preference = 1; /* Set to record only the router(s) with the
|
||||
int best_preference = 1; /* Set to record only the router(s) with the
|
||||
best preference in the kernel. Not set
|
||||
puts all routes in the kernel. */
|
||||
|
||||
@ -196,7 +196,7 @@ do_fork()
|
||||
{
|
||||
int t;
|
||||
long pid;
|
||||
|
||||
|
||||
if (trace)
|
||||
return;
|
||||
|
||||
@ -271,7 +271,7 @@ char *argv[];
|
||||
if (argc != 0) {
|
||||
val = strtol(av[0], (char **)NULL, 0);
|
||||
if (val < 4 || val > 1800) {
|
||||
(void) fprintf(stderr,
|
||||
(void) fprintf(stderr,
|
||||
"Bad Max Advertizement Interval\n");
|
||||
exit(1);
|
||||
}
|
||||
@ -281,7 +281,7 @@ char *argv[];
|
||||
} else {
|
||||
prusage();
|
||||
/* NOTREACHED*/
|
||||
}
|
||||
}
|
||||
goto next;
|
||||
case 'p':
|
||||
argc--, av++;
|
||||
@ -403,7 +403,7 @@ char *argv[];
|
||||
int fromlen = sizeof (from);
|
||||
int cc;
|
||||
|
||||
if ( (cc=recvfrom(s, (char *)packet, len, 0,
|
||||
if ( (cc=recvfrom(s, (char *)packet, len, 0,
|
||||
(struct sockaddr *)&from, &fromlen)) < 0) {
|
||||
if( errno == EINTR )
|
||||
continue;
|
||||
@ -444,8 +444,8 @@ void timer()
|
||||
if (ntransmitted < initial_advertisements)
|
||||
left_until_advertise = initial_advert_interval;
|
||||
else
|
||||
left_until_advertise = min_adv_int +
|
||||
((max_adv_int - min_adv_int) *
|
||||
left_until_advertise = min_adv_int +
|
||||
((max_adv_int - min_adv_int) *
|
||||
(random() % 1000)/1000);
|
||||
} else if (solicit && left_until_solicit <= 0) {
|
||||
ntransmitted++;
|
||||
@ -464,9 +464,9 @@ void timer()
|
||||
|
||||
/*
|
||||
* S O L I C I T O R
|
||||
*
|
||||
* Compose and transmit an ICMP ROUTER SOLICITATION REQUEST packet.
|
||||
* The IP packet will be added on by the kernel.
|
||||
*
|
||||
* Compose and transmit an ICMP ROUTER SOLICITATION REQUEST packet.
|
||||
* The IP packet will be added on by the kernel.
|
||||
*/
|
||||
void
|
||||
solicitor(sin)
|
||||
@ -475,7 +475,7 @@ solicitor(sin)
|
||||
static u_char outpack[MAXPACKET];
|
||||
register struct icmp *icp = (struct icmp *) ALLIGN(outpack);
|
||||
int packetlen, i;
|
||||
|
||||
|
||||
if (verbose) {
|
||||
logtrace("Sending solicitation to %s\n",
|
||||
pr_name(sin->sin_addr));
|
||||
@ -489,7 +489,7 @@ solicitor(sin)
|
||||
/* Compute ICMP checksum here */
|
||||
icp->icmp_cksum = in_cksum( (u_short *)icp, packetlen );
|
||||
|
||||
if (isbroadcast(sin))
|
||||
if (isbroadcast(sin))
|
||||
i = sendbcast(s, (char *)outpack, packetlen);
|
||||
else if (ismulticast(sin))
|
||||
i = sendmcast( s, (char *)outpack, packetlen, sin);
|
||||
@ -508,9 +508,9 @@ solicitor(sin)
|
||||
|
||||
/*
|
||||
* A V E R T I S E
|
||||
*
|
||||
* Compose and transmit an ICMP ROUTER ADVERTISEMENT packet.
|
||||
* The IP packet will be added on by the kernel.
|
||||
*
|
||||
* Compose and transmit an ICMP ROUTER ADVERTISEMENT packet.
|
||||
* The IP packet will be added on by the kernel.
|
||||
*/
|
||||
void
|
||||
advertise(sin)
|
||||
@ -520,23 +520,23 @@ advertise(sin)
|
||||
register struct icmp_ra *rap = (struct icmp_ra *) ALLIGN(outpack);
|
||||
struct icmp_ra_addr *ap;
|
||||
int packetlen, i, cc;
|
||||
|
||||
|
||||
if (verbose) {
|
||||
logtrace("Sending advertisement to %s\n",
|
||||
pr_name(sin->sin_addr));
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < num_interfaces; i++) {
|
||||
rap->icmp_type = ICMP_ROUTER_ADVERTISEMENT;
|
||||
rap->icmp_code = 0;
|
||||
rap->icmp_cksum = 0;
|
||||
rap->icmp_num_addrs = 0;
|
||||
rap->icmp_num_addrs = 0;
|
||||
rap->icmp_wpa = 2;
|
||||
rap->icmp_lifetime = lifetime;
|
||||
packetlen = 8;
|
||||
|
||||
/*
|
||||
* TODO handle multiple logical interfaces per
|
||||
/*
|
||||
* TODO handle multiple logical interfaces per
|
||||
* physical interface. (increment with rap->icmp_wpa * 4 for
|
||||
* each address.)
|
||||
*/
|
||||
@ -550,15 +550,15 @@ advertise(sin)
|
||||
/* Compute ICMP checksum here */
|
||||
rap->icmp_cksum = in_cksum( (u_short *)rap, packetlen );
|
||||
|
||||
if (isbroadcast(sin))
|
||||
cc = sendbcastif(s, (char *)outpack, packetlen,
|
||||
if (isbroadcast(sin))
|
||||
cc = sendbcastif(s, (char *)outpack, packetlen,
|
||||
&interfaces[i]);
|
||||
else if (ismulticast(sin))
|
||||
cc = sendmcastif( s, (char *)outpack, packetlen, sin,
|
||||
&interfaces[i]);
|
||||
else {
|
||||
struct interface *ifp = &interfaces[i];
|
||||
/*
|
||||
/*
|
||||
* Verify that the interface matches the destination
|
||||
* address.
|
||||
*/
|
||||
@ -567,11 +567,11 @@ advertise(sin)
|
||||
if (debug) {
|
||||
logdebug("Unicast to %s ",
|
||||
pr_name(sin->sin_addr));
|
||||
logdebug("on interface %s\n",
|
||||
logdebug("on interface %s\n",
|
||||
pr_name(ifp->address));
|
||||
}
|
||||
cc = sendto( s, (char *)outpack, packetlen, 0,
|
||||
(struct sockaddr *)sin,
|
||||
(struct sockaddr *)sin,
|
||||
sizeof(struct sockaddr));
|
||||
} else
|
||||
cc = packetlen;
|
||||
@ -637,7 +637,7 @@ char *pr_name(addr)
|
||||
static char buf[256];
|
||||
|
||||
phe = gethostbyaddr((char *)&addr.s_addr, 4, AF_INET);
|
||||
if (phe == NULL)
|
||||
if (phe == NULL)
|
||||
return( inet_ntoa(addr));
|
||||
(void) sprintf(buf, "%s (%s)", phe->h_name, inet_ntoa(addr));
|
||||
return(buf);
|
||||
@ -711,7 +711,7 @@ struct sockaddr_in *from;
|
||||
return;
|
||||
}
|
||||
if (rap->icmp_num_addrs < 1) {
|
||||
if (verbose)
|
||||
if (verbose)
|
||||
logtrace("ICMP %s from %s: No addresses\n",
|
||||
pr_type((int)rap->icmp_type),
|
||||
pr_name(from->sin_addr));
|
||||
@ -725,14 +725,14 @@ struct sockaddr_in *from;
|
||||
rap->icmp_wpa);
|
||||
return;
|
||||
}
|
||||
if ((unsigned)cc <
|
||||
if ((unsigned)cc <
|
||||
ICMP_MINLEN + rap->icmp_num_addrs * rap->icmp_wpa * 4) {
|
||||
if (verbose)
|
||||
logtrace("ICMP %s from %s: Too short %d, %d\n",
|
||||
pr_type((int)rap->icmp_type),
|
||||
pr_name(from->sin_addr),
|
||||
cc,
|
||||
ICMP_MINLEN +
|
||||
cc,
|
||||
ICMP_MINLEN +
|
||||
rap->icmp_num_addrs * rap->icmp_wpa * 4);
|
||||
return;
|
||||
}
|
||||
@ -756,16 +756,16 @@ struct sockaddr_in *from;
|
||||
for (i = 0; (unsigned)i < rap->icmp_num_addrs; i++) {
|
||||
struct in_addr ina;
|
||||
ap = (struct icmp_ra_addr *)
|
||||
ALLIGN(buf + hlen + ICMP_MINLEN +
|
||||
ALLIGN(buf + hlen + ICMP_MINLEN +
|
||||
i * rap->icmp_wpa * 4);
|
||||
ina.s_addr = ntohl(ap->addr);
|
||||
if (verbose)
|
||||
logtrace("\taddress %s, preference 0x%x\n",
|
||||
logtrace("\taddress %s, preference 0x%x\n",
|
||||
pr_name(ina),
|
||||
ntohl(ap->preference));
|
||||
if (!responder) {
|
||||
if (is_directly_connected(ina))
|
||||
record_router(ina,
|
||||
record_router(ina,
|
||||
(long)ntohl(ap->preference),
|
||||
rap->icmp_lifetime);
|
||||
}
|
||||
@ -782,7 +782,7 @@ struct sockaddr_in *from;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case ICMP_ROUTER_SOLICITATION: {
|
||||
struct sockaddr_in sin;
|
||||
|
||||
@ -818,7 +818,7 @@ struct sockaddr_in *from;
|
||||
logtrace("ICMP %s from %s: Too short %d, %d\n",
|
||||
pr_type((int)icp->icmp_type),
|
||||
pr_name(from->sin_addr),
|
||||
cc,
|
||||
cc,
|
||||
ICMP_MINLEN);
|
||||
return;
|
||||
}
|
||||
@ -827,8 +827,8 @@ struct sockaddr_in *from;
|
||||
logtrace("ICMP %s from %s\n",
|
||||
pr_type((int)icp->icmp_type),
|
||||
pr_name(from->sin_addr));
|
||||
|
||||
if (!responder)
|
||||
|
||||
if (!responder)
|
||||
break;
|
||||
|
||||
/* Check that ip_src is either a neighboor
|
||||
@ -844,8 +844,8 @@ struct sockaddr_in *from;
|
||||
else
|
||||
sin.sin_addr.s_addr = INADDR_BROADCAST;
|
||||
/* Restart the timer when we broadcast */
|
||||
left_until_advertise = min_adv_int +
|
||||
((max_adv_int - min_adv_int)
|
||||
left_until_advertise = min_adv_int +
|
||||
((max_adv_int - min_adv_int)
|
||||
* (random() % 1000)/1000);
|
||||
}
|
||||
else {
|
||||
@ -932,7 +932,7 @@ finish()
|
||||
interfaces[i].preference = IGNORE_PREFERENCE;
|
||||
ntransmitted++;
|
||||
advertise(&whereto);
|
||||
}
|
||||
}
|
||||
logtrace("\n----%s rdisc Statistics----\n", sendaddress );
|
||||
logtrace("%d packets transmitted, ", ntransmitted );
|
||||
logtrace("%d packets received, ", nreceived );
|
||||
@ -955,25 +955,25 @@ unsigned char *data;
|
||||
while (len) {
|
||||
register int i;
|
||||
char charstring[17];
|
||||
|
||||
|
||||
(void)strcpy(charstring," "); /* 16 spaces */
|
||||
for (i = 0; i < 16; i++) {
|
||||
/* output the bytes one at a time,
|
||||
* not going pas "len" bytes
|
||||
/* output the bytes one at a time,
|
||||
* not going pas "len" bytes
|
||||
*/
|
||||
if (len) {
|
||||
char ch = *data & 0x7f; /* strip parity */
|
||||
if (!isprint((u_char)ch))
|
||||
if (!isprint((u_char)ch))
|
||||
ch = ' '; /* ensure printable */
|
||||
charstring[i] = ch;
|
||||
(void) fprintf(out,"%02x ",*data++);
|
||||
len--;
|
||||
} else
|
||||
} else
|
||||
(void) fprintf(out," ");
|
||||
if (i==7)
|
||||
if (i==7)
|
||||
(void) fprintf(out," ");
|
||||
}
|
||||
|
||||
|
||||
(void) fprintf(out," *%s*\n",charstring);
|
||||
}
|
||||
}
|
||||
@ -1000,7 +1000,7 @@ sendbcast(s, packet, packetlen)
|
||||
int packetlen;
|
||||
{
|
||||
int i, cc;
|
||||
|
||||
|
||||
for (i = 0; i < num_interfaces; i++) {
|
||||
if ((interfaces[i].flags & IFF_BROADCAST) == 0)
|
||||
continue;
|
||||
@ -1023,7 +1023,7 @@ sendbcastif(s, packet, packetlen, ifp)
|
||||
struct sockaddr_in baddr;
|
||||
|
||||
baddr.sin_family = AF_INET;
|
||||
|
||||
|
||||
if ((ifp->flags & IFF_BROADCAST) == 0)
|
||||
return (packetlen);
|
||||
|
||||
@ -1049,7 +1049,7 @@ sendmcast(s, packet, packetlen, sin)
|
||||
struct sockaddr_in *sin;
|
||||
{
|
||||
int i, cc;
|
||||
|
||||
|
||||
for (i = 0; i < num_interfaces; i++) {
|
||||
if ((interfaces[i].flags & IFF_MULTICAST) == 0)
|
||||
continue;
|
||||
@ -1059,7 +1059,7 @@ sendmcast(s, packet, packetlen, sin)
|
||||
}
|
||||
}
|
||||
return (packetlen);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
sendmcastif(s, packet, packetlen, sin, ifp)
|
||||
@ -1073,7 +1073,7 @@ sendmcastif(s, packet, packetlen, sin, ifp)
|
||||
struct sockaddr_in ifaddr;
|
||||
|
||||
ifaddr.sin_family = AF_INET;
|
||||
|
||||
|
||||
if ((ifp->flags & IFF_MULTICAST) == 0)
|
||||
return (packetlen);
|
||||
|
||||
@ -1081,7 +1081,7 @@ sendmcastif(s, packet, packetlen, sin, ifp)
|
||||
if (debug)
|
||||
logdebug("Multicast to interface %s\n",
|
||||
pr_name(ifaddr.sin_addr));
|
||||
if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF,
|
||||
if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF,
|
||||
(char *)&ifaddr.sin_addr,
|
||||
sizeof(ifaddr.sin_addr)) < 0) {
|
||||
logperror("setsockopt (IP_MULTICAST_IF)");
|
||||
@ -1140,7 +1140,7 @@ initifs()
|
||||
(void) close(sock);
|
||||
return;
|
||||
}
|
||||
if (interfaces)
|
||||
if (interfaces)
|
||||
interfaces = (struct interface *)ALLIGN(realloc((char *)interfaces,
|
||||
numifs * sizeof(struct interface)));
|
||||
else
|
||||
@ -1153,7 +1153,7 @@ initifs()
|
||||
return;
|
||||
}
|
||||
interfaces_size = numifs;
|
||||
|
||||
|
||||
ifc.ifc_len = bufsize;
|
||||
ifc.ifc_buf = buf;
|
||||
if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
|
||||
@ -1169,7 +1169,7 @@ initifs()
|
||||
logperror("initifs: ioctl (get interface flags)");
|
||||
continue;
|
||||
}
|
||||
if (ifr->ifr_addr.sa_family != AF_INET)
|
||||
if (ifr->ifr_addr.sa_family != AF_INET)
|
||||
continue;
|
||||
if ((ifreq.ifr_flags & IFF_UP) == 0)
|
||||
continue;
|
||||
@ -1229,7 +1229,7 @@ initifs()
|
||||
(void) free(buf);
|
||||
}
|
||||
|
||||
static int
|
||||
static int
|
||||
join(sock, sin)
|
||||
int sock;
|
||||
struct sockaddr_in *sin;
|
||||
@ -1264,7 +1264,7 @@ int support_multicast()
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL,
|
||||
if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL,
|
||||
(char *)&ttl, sizeof(ttl)) < 0) {
|
||||
(void) close(sock);
|
||||
return (0);
|
||||
@ -1282,7 +1282,7 @@ is_directly_connected(in)
|
||||
for (i = 0; i < num_interfaces; i++) {
|
||||
/* Check that the subnetwork numbers match */
|
||||
|
||||
if ((in.s_addr & interfaces[i].netmask.s_addr ) ==
|
||||
if ((in.s_addr & interfaces[i].netmask.s_addr ) ==
|
||||
(interfaces[i].remoteaddr.s_addr & interfaces[i].netmask.s_addr))
|
||||
return (1);
|
||||
}
|
||||
@ -1342,15 +1342,15 @@ age_table(time)
|
||||
int recalculate_max = 0;
|
||||
int max = max_preference();
|
||||
|
||||
tpp = &table;
|
||||
tpp = &table;
|
||||
while (*tpp != NULL) {
|
||||
tp = *tpp;
|
||||
tp->remaining_time -= time;
|
||||
if (tp->remaining_time <= 0) {
|
||||
*tpp = tp->next;
|
||||
if (tp->in_kernel)
|
||||
if (tp->in_kernel)
|
||||
del_route(tp->router);
|
||||
if (best_preference &&
|
||||
if (best_preference &&
|
||||
tp->preference == max)
|
||||
recalculate_max++;
|
||||
free((char *)tp);
|
||||
@ -1384,9 +1384,9 @@ record_router(router, preference, ttl)
|
||||
int old_max = max_preference();
|
||||
int changed_up = 0; /* max preference could have increased */
|
||||
int changed_down = 0; /* max preference could have decreased */
|
||||
|
||||
|
||||
if (debug)
|
||||
logdebug("Recording %s, preference 0x%x\n",
|
||||
logdebug("Recording %s, preference 0x%x\n",
|
||||
pr_name(router),
|
||||
preference);
|
||||
tp = find_router(router);
|
||||
@ -1413,7 +1413,7 @@ record_router(router, preference, ttl)
|
||||
tp->next = table;
|
||||
table = tp;
|
||||
}
|
||||
if (!tp->in_kernel &&
|
||||
if (!tp->in_kernel &&
|
||||
(!best_preference || tp->preference == max_preference()) &&
|
||||
tp->preference != IGNORE_PREFERENCE) {
|
||||
add_route(tp->router);
|
||||
@ -1429,7 +1429,7 @@ record_router(router, preference, ttl)
|
||||
if (new_max != IGNORE_PREFERENCE) {
|
||||
tp = table;
|
||||
while (tp) {
|
||||
if (tp->preference == new_max &&
|
||||
if (tp->preference == new_max &&
|
||||
!tp->in_kernel) {
|
||||
add_route(tp->router);
|
||||
tp->in_kernel++;
|
||||
@ -1452,7 +1452,7 @@ record_router(router, preference, ttl)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include <net/route.h>
|
||||
|
||||
void
|
||||
@ -1487,7 +1487,7 @@ rtioctl(addr, op)
|
||||
sin = (struct sockaddr_in *)ALLIGN(&rt.rt_gateway);
|
||||
sin->sin_addr = addr;
|
||||
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
||||
|
||||
|
||||
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (sock < 0) {
|
||||
logperror("rtioctl: socket");
|
||||
@ -1501,7 +1501,7 @@ rtioctl(addr, op)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* LOGGER
|
||||
*/
|
||||
|
@ -16,4 +16,4 @@ struct ip_mreq {
|
||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||
struct in_addr imr_interface; /* local IP address of interface */
|
||||
};
|
||||
|
||||
|
||||
|
@ -207,7 +207,7 @@ skipdirs()
|
||||
}
|
||||
|
||||
/*
|
||||
* Recursively find names and inumbers of all files in subtree
|
||||
* Recursively find names and inumbers of all files in subtree
|
||||
* pname and pass them off to be processed.
|
||||
*/
|
||||
void
|
||||
@ -477,7 +477,7 @@ rst_readdir(dirp)
|
||||
|
||||
for (;;) {
|
||||
if (dirp->dd_loc == 0) {
|
||||
dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
|
||||
dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
|
||||
DIRBLKSIZ);
|
||||
if (dirp->dd_size <= 0) {
|
||||
dprintf(stderr, "error reading directory\n");
|
||||
@ -583,7 +583,7 @@ setdirmodes(flags)
|
||||
struct modeinfo node;
|
||||
struct entry *ep;
|
||||
char *cp;
|
||||
|
||||
|
||||
vprintf(stdout, "Set directory mode, owner, and times.\n");
|
||||
(void) sprintf(modefile, "%s/rstmode%d", _PATH_TMP, dumpdate);
|
||||
mf = fopen(modefile, "r");
|
||||
|
@ -130,7 +130,7 @@ deletefile(name, ino, type)
|
||||
return (descend);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* The following four routines implement the incremental
|
||||
* restore algorithm. The first removes old entries, the second
|
||||
* does renames and calculates the extraction list, the third
|
||||
@ -139,7 +139,7 @@ deletefile(name, ino, type)
|
||||
*
|
||||
* Directories cannot be immediately deleted, as they may have
|
||||
* other files in them which need to be moved out first. As
|
||||
* directories to be deleted are found, they are put on the
|
||||
* directories to be deleted are found, they are put on the
|
||||
* following deletion list. After all deletions and renames
|
||||
* are done, this list is actually deleted.
|
||||
*/
|
||||
@ -203,7 +203,7 @@ nodeupdates(name, ino, type)
|
||||
# define MODECHG 0x8 /* mode of inode changed */
|
||||
|
||||
/*
|
||||
* This routine is called once for each element in the
|
||||
* This routine is called once for each element in the
|
||||
* directory hierarchy, with a full path name.
|
||||
* The "type" value is incorrectly specified as LEAF for
|
||||
* directories that are not on the dump tape.
|
||||
@ -394,7 +394,7 @@ nodeupdates(name, ino, type)
|
||||
* that we need to rename, so we delete it from the symbol
|
||||
* table, and put it on the list to be deleted eventually.
|
||||
* Conversely if a directory is to be created, it must be
|
||||
* done immediately, rather than waiting until the
|
||||
* done immediately, rather than waiting until the
|
||||
* extraction phase.
|
||||
*/
|
||||
case ONTAPE|INOFND|MODECHG:
|
||||
@ -464,7 +464,7 @@ nodeupdates(name, ino, type)
|
||||
default:
|
||||
panic("[%s] %s: impossible state\n", keyval(key), name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (descend);
|
||||
}
|
||||
|
||||
@ -606,7 +606,7 @@ createleaves(symtabfile)
|
||||
/*
|
||||
* If we find files on the tape that have no corresponding
|
||||
* directory entries, then we must have found a file that
|
||||
* was created while the dump was in progress. Since we have
|
||||
* was created while the dump was in progress. Since we have
|
||||
* no name for it, we discard it knowing that it will be
|
||||
* on the next incremental tape.
|
||||
*/
|
||||
|
@ -366,7 +366,7 @@ removeentry(ep)
|
||||
|
||||
/*
|
||||
* Table of unused string entries, sorted by length.
|
||||
*
|
||||
*
|
||||
* Entries are allocated in STRTBLINCR sized pieces so that names
|
||||
* of similar lengths can use the same entry. The value of STRTBLINCR
|
||||
* is chosen so that every entry has at least enough space to hold
|
||||
@ -422,7 +422,7 @@ freename(name)
|
||||
char *name;
|
||||
{
|
||||
struct strhdr *tp, *np;
|
||||
|
||||
|
||||
tp = &strtblhdr[strlen(name) / STRTBLINCR];
|
||||
np = (struct strhdr *)name;
|
||||
np->next = tp->next;
|
||||
|
@ -300,7 +300,7 @@ getvol(nextvol)
|
||||
if (command == 'R' || command == 'r' || curfile.action != SKIP) {
|
||||
newvol = nextvol;
|
||||
wantnext = 1;
|
||||
} else {
|
||||
} else {
|
||||
newvol = 0;
|
||||
wantnext = 0;
|
||||
}
|
||||
@ -398,7 +398,7 @@ getvol(nextvol)
|
||||
* If coming to this volume at random, skip to the beginning
|
||||
* of the next record.
|
||||
*/
|
||||
dprintf(stdout, "read %ld recs, tape starts with %ld\n",
|
||||
dprintf(stdout, "read %ld recs, tape starts with %ld\n",
|
||||
tpblksread, tmpbuf.c_firstrec);
|
||||
if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) {
|
||||
if (!wantnext) {
|
||||
@ -477,7 +477,7 @@ setdumpnum()
|
||||
#ifdef RRESTORE
|
||||
if (host)
|
||||
rmtioctl(MTFSF, dumpnum - 1);
|
||||
else
|
||||
else
|
||||
#endif
|
||||
if (ioctl(mt, (int)MTIOCTOP, (char *)&tcom) < 0)
|
||||
fprintf(stderr, "ioctl MTFSF: %s\n", strerror(errno));
|
||||
@ -1094,7 +1094,7 @@ gethead(buf)
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* If we are restoring a filesystem with old format inodes,
|
||||
* If we are restoring a filesystem with old format inodes,
|
||||
* copy the uid/gid to the new location.
|
||||
*/
|
||||
if (oldinofmt) {
|
||||
@ -1247,11 +1247,11 @@ checksum(buf)
|
||||
} else {
|
||||
/* What happens if we want to read restore tapes
|
||||
for a 16bit int machine??? */
|
||||
do
|
||||
do
|
||||
i += swabl(*buf++);
|
||||
while (--j);
|
||||
}
|
||||
|
||||
|
||||
if (i != CHECKSUM) {
|
||||
fprintf(stderr, "Checksum error %o, inode %d file %s\n", i,
|
||||
curfile.ino, curfile.name);
|
||||
@ -1328,7 +1328,7 @@ swabst(cp, sp)
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
n = (n * 10) + (*cp++ - '0');
|
||||
continue;
|
||||
|
||||
|
||||
case 's': case 'w': case 'h':
|
||||
if (n == 0)
|
||||
n = 1;
|
||||
|
@ -329,7 +329,7 @@ dirlookup(name)
|
||||
{
|
||||
struct direct *dp;
|
||||
ino_t ino;
|
||||
|
||||
|
||||
ino = ((dp = pathsearch(name)) == NULL) ? 0 : dp->d_ino;
|
||||
|
||||
if (ino == 0 || TSTINO(ino, dumpmap) == 0)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user