AC_INIT(src/libafs/Makefile.common.in)
-AM_INIT_AUTOMAKE(openafs-libafs,1.3.71)
+AM_INIT_AUTOMAKE(openafs-libafs,1.3.72)
AC_CONFIG_HEADER(src/config/afsconfig.h)
define(OPENAFS_CONFIGURE_LIBAFS)
AC_INIT(src/config/stds.h)
-AM_INIT_AUTOMAKE(openafs,1.3.71)
+AM_INIT_AUTOMAKE(openafs,1.3.72)
AC_CONFIG_HEADER(src/config/afsconfig.h)
AC_PROG_CC
/* Intercept the standard system call. */
-extern long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
+extern asmlinkage long (*sys_setgroupsp) (int gidsetsize, gid_t * grouplist);
asmlinkage long
afs_xsetgroups(int gidsetsize, gid_t * grouplist)
{
#if defined(AFS_LINUX24_ENV)
/* Intercept the standard uid32 system call. */
-extern long (*sys_setgroups32p) (int gidsetsize, gid_t * grouplist);
+extern asmlinkage long (*sys_setgroups32p) (int gidsetsize, gid_t * grouplist);
asmlinkage long
afs_xsetgroups32(int gidsetsize, gid_t * grouplist)
{
extern int osi_InitCacheInfo(char *aname);
extern int osi_rdwr(int rw, struct osi_file *file, caddr_t addrp,
size_t asize, size_t * resid);
-extern void inline setup_uio(uio_t * uiop, struct iovec *iovecp, char *buf,
- afs_offs_t pos, int count, uio_flag_t flag,
- uio_seg_t seg);
extern int osi_file_uio_rdwr(struct osi_file *osifile, uio_t * uiop, int rw);
extern void afs_osi_SetTime(osi_timeval_t * tvp);
extern void osi_linux_free_inode_pages(void);
/* do ulimit processing; shrink resid or fail */
#if defined(AFS_SUN56_ENV)
if (auio->uio_loffset + auio->afsio_resid > auio->uio_llimit) {
- if (auio->uio_llimit >= auio->uio_llimit) {
+ if (auio->uio_loffset >= auio->uio_llimit) {
ReleaseWriteLock(&avc->lock);
afs_BozonUnlock(&avc->pvnLock, avc);
return EFBIG;
/* page hash table size - this is pretty intertwined with pHash */
#define PHSIZE (PHPAGEMASK + PHFIDMASK + 1)
/* the pHash macro */
-#define pHash(fid,page) ((((afs_int32)((fid)[0])) & PHFIDMASK) \
+#define pHash(fid,page) ((((afs_int32)((fid)->inode)) & PHFIDMASK) \
| (page & PHPAGEMASK))
#ifdef dirty
static afs_int32 timecounter;
/* Prototypes for static routines */
-static struct buffer *afs_newslot(afs_inode_t * afid, afs_int32 apage,
+static struct buffer *afs_newslot(struct fcache * afid, afs_int32 apage,
register struct buffer *lp);
static int dinit_flag = 0;
}
void *
-DRead(register afs_inode_t * fid, register int page)
+DRead(register struct fcache * fid, register int page)
{
/* Read a page from the disk. */
register struct buffer *tb, *tb2;
MObtainWriteLock(&tb->lock, 260);
MReleaseWriteLock(&afs_bufferLock);
tb->lockers++;
- tfile = afs_CFileOpen(fid[0]);
- if (page * AFS_BUFFER_PAGESIZE >= tfile->size) {
+ if (page * AFS_BUFFER_PAGESIZE >= fid->chunkBytes) {
dirp_Zap(tb->fid);
tb->lockers--;
MReleaseWriteLock(&tb->lock);
- afs_CFileClose(tfile);
return NULL;
}
+ tfile = afs_CFileOpen(fid->inode);
code =
afs_CFileRead(tfile, tb->page * AFS_BUFFER_PAGESIZE, tb->data,
AFS_BUFFER_PAGESIZE);
/* lp is pointer to a fairly-old buffer */
static struct buffer *
-afs_newslot(afs_inode_t * afid, afs_int32 apage, register struct buffer *lp)
+afs_newslot(struct fcache * afid, afs_int32 apage, register struct buffer *lp)
{
/* Find a usable buffer slot */
register afs_int32 i;
}
if (lp->dirty) {
- tfile = afs_CFileOpen(lp->fid[0]);
+ tfile = afs_CFileOpen(lp->fid->inode);
afs_CFileWrite(tfile, lp->page * AFS_BUFFER_PAGESIZE, lp->data,
AFS_BUFFER_PAGESIZE);
lp->dirty = 0;
* method of DRead...
*/
void
-DZap(afs_inode_t * fid)
+DZap(struct fcache * fid)
{
register int i;
/* Destroy all buffers pertaining to a particular fid. */
tb->lockers++;
MReleaseReadLock(&afs_bufferLock);
if (tb->dirty) {
- tfile = afs_CFileOpen(tb->fid[0]);
+ tfile = afs_CFileOpen(tb->fid->inode);
afs_CFileWrite(tfile, tb->page * AFS_BUFFER_PAGESIZE,
tb->data, AFS_BUFFER_PAGESIZE);
tb->dirty = 0; /* Clear the dirty flag */
}
void *
-DNew(register afs_inode_t * fid, register int page)
+DNew(register struct fcache * fid, register int page)
{
/* Same as read, only do *not* even try to read the page, since it probably doesn't exist. */
register struct buffer *tb;
* The following three routines provide the fid routines used by the buffer
* and directory packages.
*/
-#define dirp_Zap(afid) (*(afid) = -1)
-#define dirp_Eq(afid, bfid) (*(afid) == *(bfid))
-#define dirp_Cpy(dfid,sfid) (*(dfid) = *(sfid))
+#define dirp_Zap(afid) ((afid) = 0)
+#define dirp_Eq(afid, bfid) ((afid) == (bfid))
+#define dirp_Cpy(dfid,sfid) ((dfid) = (sfid))
/*
* activates tokens repeatedly) for that entire period.
*/
+static int afs_pag_sleepcnt = 0;
+
+static int
+afs_pag_sleep(struct AFS_UCRED **acred)
+{
+ int rv = 0;
+ if(!afs_suser(acred)) {
+ if(osi_Time() - pag_epoch < pagCounter) {
+ rv = 1;
+ }
+ }
+
+ return rv;
+}
+
+static int
+afs_pag_wait(struct AFS_UCRED **acred)
+{
+ if(afs_pag_sleep(acred)) {
+ if(!afs_pag_sleepcnt) {
+ printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n",
+ __func__, getpid(), afs_pag_sleepcnt);
+ }
+
+ afs_pag_sleepcnt++;
+
+ do {
+ /* XXX spins on EINTR */
+ afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
+ } while(afs_pag_sleep(acred));
+
+ afs_pag_sleepcnt--;
+ }
+
+ return 0;
+}
+
int
#if defined(AFS_SUN5_ENV)
afs_setpag(struct AFS_UCRED **credpp)
afs_setpag(void)
#endif
{
+
+#if defined(AFS_SUN5_ENV)
+ struct AFS_UCRED **acred = *credpp;
+#elif defined(AFS_OBSD_ENV)
+ struct AFS_UCRED **acred = p->p_ucred;
+#else
+ struct AFS_UCRED **acred = NULL;
+#endif
+
int code = 0;
#if defined(AFS_SGI53_ENV) && defined(MP)
#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
AFS_STATCNT(afs_setpag);
-#if defined(AFS_SUN5_ENV)
- if (!afs_suser(*credpp))
-#elif defined(AFS_OBSD_ENV)
- if (!afs_osi_suser(p->p_ucred))
-#else
- if (!afs_suser(NULL))
-#endif
- {
- while (osi_Time() - pag_epoch < pagCounter) {
- afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
- }
- }
+
+ afs_pag_wait(acred);
+
+
#if defined(AFS_SUN5_ENV)
code = AddPag(genpag(), credpp);
#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
#endif
afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code);
+
#if defined(KERNEL_HAVE_UERROR)
if (!getuerror())
setuerror(code);
#endif
+
#if defined(AFS_SGI53_ENV) && defined(MP)
AFS_GUNLOCK();
#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
+
return (code);
}
afs_setpag_val(int pagval)
#endif
{
+
+#if defined(AFS_SUN5_ENV)
+ struct AFS_UCRED **acred = *credp;
+#elif defined(AFS_OBSD_ENV)
+ struct AFS_UCRED **acred = p->p_ucred;
+#else
+ struct AFS_UCRED **acred = NULL;
+#endif
+
int code = 0;
#if defined(AFS_SGI53_ENV) && defined(MP)
#endif /* defined(AFS_SGI53_ENV) && defined(MP) */
AFS_STATCNT(afs_setpag);
-#ifdef AFS_SUN5_ENV
- if (!afs_suser(*credpp))
-#else
- if (!afs_suser(NULL))
-#endif
- {
- while (osi_Time() - pag_epoch < pagCounter) {
- afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
- }
- }
+
+ afs_pag_wait(acred);
+
#if defined(AFS_SUN5_ENV)
code = AddPag(pagval, credpp);
#elif defined(AFS_OSF_ENV) || defined(AFS_XBSD_ENV)
/* afs_buffer.c */
extern void DInit(int abuffers);
-extern void *DRead(register afs_inode_t * fid, register int page);
+extern void *DRead(register struct fcache * fid, register int page);
extern void DRelease(register struct buffer *bp, int flag);
extern int DVOffset(register void *ap);
-extern void DZap(afs_inode_t * fid);
+extern void DZap(struct fcache * fid);
extern void DFlush(void);
-extern void *DNew(register afs_inode_t * fid, register int page);
+extern void *DNew(register struct fcache * fid, register int page);
extern void shutdown_bufferpackage(void);
/* afs_call.c */
setkey.o: setkey.c ${INCLS} AFS_component_version_number.o
ktc.krb.o: ktc.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
- ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/ktc.c -o ktc.krb.o
+ ${CCOBJ} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/ktc.c -o ktc.krb.o
libauth.a: $(OBJS) AFS_component_version_number.o
-$(RM) -f libauth.a
if (*date_long == NEVERDATE) {
sprintf(string, "NEVER");
} else {
- ltime = localtime(date_long);
+ time_t t = *date_long;
+ ltime = localtime(&t);
/* prints date in U.S. format of mm/dd/yyyy */
strftime(string, size, "%m/%d/%Y %H:%M", ltime);
}
printf("----\n");
printDumpEntry(&dumpEntry);
} else {
+ time_t t = dumpEntry.created;
if (dbDump)
printf("Dump: id %u, created: %s\n", dumpEntry.id,
- ctime(&dumpEntry.created));
- else
+ ctime(&t));
+ else
printf("Dump: id %u, level %d, volumes %d, created: %s\n",
dumpEntry.id, dumpEntry.level, dumpEntry.nVolumes,
- ctime(&dumpEntry.created));
+ ctime(&t));
}
if (!detailFlag && (strlen(dumpEntry.tapes.tapeServer) > 0)
case BC_ABS_EXPDATE:
/* absolute expiration date. Never expires if date is 0 */
if (adump->expDate) {
- printf("expires at %.24s", cTIME(&adump->expDate));
+ time_t t = adump->expDate;
+ printf("expires at %.24s", cTIME(&t));
}
break;
afs_int32 partitionAll; /* Likewise for partition */
struct hostent *hostPtr;
long haddr;
- u_long did;
+ time_t did;
int foundtape, c;
extern statusP createStatusNode();
struct butm_tapeLabel *labelptr;
{
char tapeName[BU_MAXTAPELEN + 32];
+ time_t t;
printf("Tape label\n");
printf("----------\n");
printf("permanent tape name = %s\n", tapeName);
TAPENAME(tapeName, labelptr->AFSName, labelptr->dumpid);
printf("AFS tape name = %s\n", tapeName);
- printf("creationTime = %s", ctime(&labelptr->creationTime));
- if (labelptr->expirationDate)
- printf("expirationDate = %s", cTIME(&labelptr->expirationDate));
+ t = labelptr->creationTime;
+ printf("creationTime = %s", ctime(&t));
+ if (labelptr->expirationDate) {
+ t = labelptr->expirationDate;
+ printf("expirationDate = %s", cTIME(&t));
+ }
printf("cell = %s\n", labelptr->cell);
printf("size = %u Kbytes\n", labelptr->size);
printf("dump path = %s\n", labelptr->dumpPath);
struct butm_tapeLabel *labelptr;
{
char tapeName[BU_MAXTAPELEN + 32];
+ time_t t;
printf("Dump label\n");
printf("----------\n");
printf("permanent tape name = %s\n", tapeName);
TAPENAME(tapeName, labelptr->AFSName, labelptr->dumpid);
printf("AFS tape name = %s\n", tapeName);
- printf("creationTime = %s", ctime(&labelptr->creationTime));
- if (labelptr->expirationDate)
- printf("expirationDate = %s", cTIME(&labelptr->expirationDate));
+ t = labelptr->creationTime;
+ printf("creationTime = %s", ctime(&t));
+ if (labelptr->expirationDate) {
+ t = labelptr->expirationDate;
+ printf("expirationDate = %s", cTIME(&t));
+ }
printf("cell = %s\n", labelptr->cell);
printf("size = %u Kbytes\n", labelptr->size);
printf("dump path = %s\n", labelptr->dumpPath);
PrintVolumeHeader(volHeader)
struct volumeHeader *volHeader;
{
+ time_t t;
+
printf("-- volume --\n");
printf("volume name: %s\n", volHeader->volumeName);
printf("volume ID %d\n", volHeader->volumeID);
printf("parentID %d\n", volHeader->parentID);
printf("endTime %d\n", volHeader->endTime);
/* printf("versionflags %d\n", volHeader->versionflags); */
- printf("clonedate %s\n", ctime(&volHeader->cloneDate));
+ t = volHeader->cloneDate;
+ printf("clonedate %s\n", ctime(&t));
}
/* Ask
}
past = time(0) - label.creationTime;
if ((past < 0) || (past > 5 * 60)) {
- printf("label creation time is long ago: %s\n",
- ctime(&label.creationTime));
+ time_t t = label.creationTime;
+ printf("label creation time is long ago: %s\n", ctime(&t));
ERROR_EXIT(5);
}
if (strcmp(label.AFSName, tip->tapeName) != 0) {
--- /dev/null
+#ifndef UKERNEL
+/* This section for kernel libafs compiles only */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously amd64 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define AFS_LINUX20_ENV 1
+#define AFS_LINUX22_ENV 1
+#define AFS_LINUX24_ENV 1
+#define AFS_LINUX26_ENV 1
+#define AFS_AMD64_LINUX20_ENV 1
+#define AFS_AMD64_LINUX22_ENV 1
+#define AFS_AMD64_LINUX24_ENV 1
+#define AFS_AMD64_LINUX26_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 183
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#define AFS_64BIT_ENV 1
+#define AFS_64BIT_CLIENT 1
+#define AFS_64BITPOINTER_ENV 1 /* pointers are 64 bits */
+
+#if defined(__KERNEL__) && !defined(KDUMP_KERNEL)
+#include <linux/threads.h>
+
+#include <linux/config.h>
+#ifdef CONFIG_SMP
+#ifndef AFS_SMP
+#define AFS_SMP 1
+#endif
+#endif
+/* Using "AFS_SMP" to map to however many #define's are required to get
+ * MP to compile for Linux
+ */
+#ifdef AFS_SMP
+#ifndef CONFIG_SMP
+#define CONFIG_SMP 1
+#endif
+#ifndef __SMP__
+#define __SMP__
+#endif
+#define AFS_GLOBAL_SUNLOCK
+#endif
+
+#endif /* __KERNEL__ && !DUMP_KERNEL */
+
+#include <afs/afs_sysnames.h>
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
+
+#define AFSLITTLE_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#ifdef KERNEL
+#ifndef MIN
+#define MIN(A,B) ((A) < (B) ? (A) : (B))
+#endif
+#ifndef MAX
+#define MAX(A,B) ((A) > (B) ? (A) : (B))
+#endif
+#endif /* KERNEL */
+
+/* Machine / Operating system information */
+#define SYS_NAME "amd64_linux26"
+#define SYS_NAME_ID SYS_NAME_ID_amd64_linux26
+
+#define USE_UCONTEXT
+
+#endif /* AFS_PARAM_H */
+
+
+
+#else /* !defined(UKERNEL) */
+
+/* This section for user space compiles only */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+/* In user space the AFS_LINUX20_ENV should be sufficient. In the kernel,
+ * it's a judgment call. If something is obviously amd64 specific, use that
+ * #define instead. Note that "20" refers to the linux 2.0 kernel. The "2"
+ * in the sysname is the current version of the client. This takes into
+ * account the perferred OS user space configuration as well as the kernel.
+ */
+
+#define UKERNEL 1 /* user space kernel */
+#define AFS_ENV 1
+#define AFS_USR_LINUX20_ENV 1
+#define AFS_USR_LINUX22_ENV 1
+#define AFS_USR_LINUX24_ENV 1
+#define AFS_USR_LINUX26_ENV 1
+#define AFS_NONFSTRANS 1
+
+#define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */
+#define AFS_SYSCALL 183
+#define AFS_64BIT_IOPS_ENV 1
+#define AFS_NAMEI_ENV 1 /* User space interface to file system */
+#include <afs/afs_sysnames.h>
+
+#define AFS_USERSPACE_IP_ADDR 1
+#define RXK_LISTENER_ENV 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+
+/* Machine / Operating system information */
+#define SYS_NAME "amd64_linux26"
+#define SYS_NAME_ID SYS_NAME_ID_amd64_linux26
+#define AFSLITTLE_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS 1
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif
+
+#define USE_UCONTEXT
+
+#endif /* AFS_PARAM_H */
+
+#endif /* !defined(UKERNEL) */
des_cblock *iv; * 8 bytes of ivec *
*/
afs_int32
-des_cbc_encrypt(des_cblock * in, des_cblock * out, register afs_int32 length,
+des_cbc_encrypt(void * in, void * out, register afs_int32 length,
des_key_schedule key, des_cblock * iv, int encrypt)
{
register afs_uint32 *input = (afs_uint32 *) in;
extern int des_debug;
/* cbc_encrypt.c */
-extern afs_int32 des_cbc_encrypt(des_cblock * in, des_cblock * out,
+extern afs_int32 des_cbc_encrypt(void * in, void * out,
register afs_int32 length,
des_key_schedule key, des_cblock * iv,
int encrypt);
/* pcbc_encrypt.c */
-extern afs_int32 des_pcbc_encrypt(des_cblock * in, des_cblock * out,
+extern afs_int32 des_pcbc_encrypt(void * in, void * out,
register afs_int32 length,
des_key_schedule key, des_cblock * iv,
int encrypt);
/* des.c */
-extern afs_int32 des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+extern afs_int32 des_ecb_encrypt(void * clear, void * cipher,
register des_key_schedule schedule,
int encrypt);
des_cblock *iv; * 8 bytes of ivec *
*/
afs_int32
-des_pcbc_encrypt(des_cblock * in, des_cblock * out, register afs_int32 length,
+des_pcbc_encrypt(void * in, void * out, register afs_int32 length,
des_key_schedule key, des_cblock * iv, int encrypt)
{
register afs_uint32 *input = (afs_uint32 *) in;
${CC} ${LDFLAGS} -o kpwvalid kpwvalid.o ${LIBS} ${XLIBS}
user.krb.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
- ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/user.c -o user.krb.o
+ ${CCOBJ} ${CFLAGS} -DAFS_KERBEROS_ENV -c ${srcdir}/user.c -o user.krb.o
user.o: user.c ${INCLS} ${TOP_INCDIR}/afs/vice.h
- ${CC} ${CFLAGS} -c ${srcdir}/user.c
+ ${CCOBJ} ${CFLAGS} -c ${srcdir}/user.c
kdb: kdb.o ${INCLS} ${LIBS} libkauth.a
${CC} ${LDFLAGS} -o kdb kdb.o libkauth.a ${LIBS} ${XLIBS}
read_passwd.o
UBIKOBJS = \
+ uinit.o \
ubikclient.o \
uerrors.o \
ubik_int.cs.o \
ubikclient.o: ${UBIK}/ubikclient.c
${CCRULE}
+uinit.o: ${UBIK}/uinit.c
+ ${CCRULE}
+
uerrors.o: ${UBIK}/uerrors.c
${CCRULE}
$(OUT)\user_nt.obj
UBIKOBJS = \
+ $(OUT)\uinit.obj \
$(OUT)\ubikclient.obj \
$(OUT)\uerrors.obj \
$(OUT)\ubik_int.cs.obj \
md5.o: ${RXKAD}/md5.c
${CCRULE} ${RXKAD}/md5.c
-fcrypt.o: ${TOP_OBJDIR}/src/rxkad/fcrypt.c
- ${CCRULE} ${TOP_OBJDIR}/src/rxkad/fcrypt.c
+fcrypt.o: ${TOP_OBJDIR}/src/rxkad/domestic/fcrypt.c
+ ${CCRULE} ${TOP_OBJDIR}/src/rxkad/domestic/fcrypt.c
-crypt_conn.o: ${TOP_OBJDIR}/src/rxkad/crypt_conn.c
- ${CCRULE} ${TOP_OBJDIR}/src/rxkad/crypt_conn.c
+crypt_conn.o: ${TOP_OBJDIR}/src/rxkad/domestic/crypt_conn.c
+ ${CCRULE} ${TOP_OBJDIR}/src/rxkad/domestic/crypt_conn.c
AFS_component_version_number.o: ${TOP_OBJDIR}/src/rx/AFS_component_version_number.c
${CCRULE} ${TOP_OBJDIR}/src/rx/AFS_component_version_number.c
rx_enable_hot_thread @203 DATA
xdr_int64 @204
xdr_uint64 @205
- rx_SetMaxMTU @206
+ rx_SetMaxMTU @206
+ rx_GetConnection @207
+++ /dev/null
-# Copyright 2000, International Business Machines Corporation and others.
-# All Rights Reserved.
-#
-# This software has been released under the terms of the IBM Public
-# License. For details, see the LICENSE file in the top-level source
-# directory or online at http://www.openafs.org/dl/license10.html
-
-{
- global:
- des_cbc_init;
- des_check_key_parity;
- des_cksum_init;
- des_des_init;
- des_fixup_key_parity;
- des_init_random_number_generator;
- des_is_weak_key;
- des_key_sched;
- des_random_key;
- des_string_to_key;
- ktohl;
- life_to_time;
- rx_DestroyConnection;
- rx_EndCall;
- rx_Finalize;
- rx_GetCachedConnection;
- rx_GetCall;
- rx_GetIFInfo;
- rx_GetSpecific;
- rx_Init;
- rx_KeyCreate;
- rx_NewCall;
- rx_NewConnection;
- rx_NewService;
- rx_PrintPeerStats;
- rx_PrintStats;
- rx_PrintTheseStats;
- rx_ReadProc;
- rx_ReleaseCachedConnection;
- rx_ServerProc;
- rx_SetSpecific;
- rx_StartServer;
- rx_WriteProc;
- rxevent_Init;
- rxevent_Post;
- rxkad_GetServerInfo;
- rxkad_NewClientSecurityObject;
- rxkad_NewServerSecurityObject;
- rxkad_client_init;
- rxkad_crypt_init;
- rxnull_NewClientSecurityObject;
- rxnull_NewServerSecurityObject;
- rxs_Release;
- time_to_life;
- tkt_CheckTimes;
- tkt_DecodeTicket;
- tkt_MakeTicket;
- xdrrx_create;
- hton_syserr_conv;
- rxkad_stats;
- com_err;
- error_message;
- rx_socket;
- des_pcbc_init;
- rxevent_debugFile;
- rx_debugFile;
- rx_connDeadTime;
- rx_maxReceiveSize;
- rx_UdpBufSize;
- rx_extraQuota;
- rx_extraPackets;
- rx_tranquil;
- rx_getAllAddr;
- rx_nWaiting;
- rx_stats;
- rx_SetNoJumbo;
- rx_SetConnDeadTime;
- rx_FlushWrite;
- rx_thread_id_key;
- multi_Finalize;
- multi_Select;
- multi_Init;
- multi_Finalize_Ignore;
- add_to_error_table;
- xdr_afsUUID;
- rx_IncrementTimeAndCount;
- rx_enable_stats;
- rx_GetServerDebug;
- rx_GetServerStats;
- rx_GetServerVersion;
- rx_GetServerConnections;
- rx_stats_mutex;
- rx_GetServerPeers;
- rx_RetrieveProcessRPCStats;
- rx_RetrievePeerRPCStats;
- rx_FreeRPCStats;
- rx_queryProcessRPCStats;
- rx_queryPeerRPCStats;
- rx_enableProcessRPCStats;
- rx_enablePeerRPCStats;
- rx_disableProcessRPCStats;
- rx_disablePeerRPCStats;
- RXSTATS_ExecuteRequest;
- RXSTATS_RetrieveProcessRPCStats;
- RXSTATS_RetrievePeerRPCStats;
- RXSTATS_QueryProcessRPCStats;
- RXSTATS_QueryPeerRPCStats;
- RXSTATS_EnableProcessRPCStats;
- RXSTATS_EnablePeerRPCStats;
- RXSTATS_DisableProcessRPCStats;
- RXSTATS_DisablePeerRPCStats;
- RXSTATS_QueryRPCStatsVersion;
- RXSTATS_ClearProcessRPCStats;
- RXSTATS_ClearPeerRPCStats;
-
- local:
- *;
-};
idlist ids;
namelist names;
int i;
- afs_int32 mask, flags, ngroups, nusers;
+ afs_int32 mask, flags=0, ngroups, nusers;
if (GetNameOrId(as, &ids, &names))
return PRBADARG;
/*
* Different conf dir; force re-evaluation.
*/
+ if (tdir)
+ afsconf_Close(tdir);
tdir = (struct afsconf_dir *)0;
pruclient = (struct ubik_client *)0;
}
if (code)
scIndex = 0;
else {
- if (ttoken.kvno >= 0 && ttoken.kvno <= 255)
+ if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
/* this is a kerberos ticket, set scIndex accordingly */
scIndex = 2;
else {
scIndex = 2;
}
sc[2] =
- rxkad_NewClientSecurityObject(secLevel, &ttoken.sessionKey,
+ rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey,
ttoken.kvno, ttoken.ticketLen,
ttoken.ticket);
}
#define rx_EnableHotThread() (rx_enable_hot_thread = 1)
#define rx_DisableHotThread() (rx_enable_hot_thread = 0)
+#define rx_PutConnection(conn) rx_DestroyConnection(conn)
+
/* A connection is an authenticated communication path, allowing
limited multiple asynchronous conversations. */
#ifdef KDUMP_RX_LOCK
/* client-- to retransmit the challenge */
struct rx_service *service; /* used by servers only */
u_short serviceId; /* To stamp on requests (clients only) */
- u_short refCount; /* Reference count */
+ afs_uint32 refCount; /* Reference count */
u_char flags; /* Defined below */
u_char type; /* Type of connection, defined below */
u_char secondsUntilPing; /* how often to ping for each active call */
/* For garbage collection */
afs_uint32 idleWhen; /* When the refcountwent to zero */
- short refCount; /* Reference count for this structure */
+ afs_uint32 refCount; /* Reference count for this structure */
/* Congestion control parameters */
u_char burstSize; /* Reinitialization size for the burst parameter */
#define RX_DEBUGI_BADTYPE (-8)
#define RX_DEBUGI_VERSION_MINIMUM ('L') /* earliest real version */
-#define RX_DEBUGI_VERSION ('Q') /* Latest version */
+#define RX_DEBUGI_VERSION ('R') /* Latest version */
/* first version w/ secStats */
#define RX_DEBUGI_VERSION_W_SECSTATS ('L')
/* version M is first supporting GETALLCONN and RXSTATS type */
#define RX_DEBUGI_VERSION_W_IDLETHREADS ('O')
#define RX_DEBUGI_VERSION_W_NEWPACKETTYPES ('P')
#define RX_DEBUGI_VERSION_W_GETPEER ('Q')
+#define RX_DEBUGI_VERSION_W_WAITED ('R')
#define RX_DEBUGI_GETSTATS 1 /* get basic rx stats */
#define RX_DEBUGI_GETCONN 2 /* get connection info */
char spare1;
afs_int32 nWaiting;
afs_int32 idleThreads; /* Number of server threads that are idle */
- afs_int32 spare2[8];
+ afs_int32 nWaited;
+ afs_int32 spare2[7];
};
struct rx_debugConn_vL {
#define RX_SERVER_DEBUG_OLD_CONN 0x20
#define RX_SERVER_DEBUG_NEW_PACKETS 0x40
#define RX_SERVER_DEBUG_ALL_PEER 0x80
+#define RX_SERVER_DEBUG_WAITED_CNT 0x100
#define AFS_RX_STATS_CLEAR_ALL 0xffffffff
#define AFS_RX_STATS_CLEAR_INVOCATIONS 0x1
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
static void
-rt_xaddrs(cp, cplim, rtinfo)
- caddr_t cp, cplim;
- struct rt_addrinfo *rtinfo;
+rt_xaddrs(caddr_t cp, caddr_t cplim, struct rt_addrinfo *rtinfo)
{
struct sockaddr *sa;
int i;
*/
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
-rx_getAllAddr(buffer, maxSize)
- afs_int32 buffer[];
- int maxSize; /* sizeof of buffer in afs_int32 units */
+rx_getAllAddr(afs_int32 buffer[], int maxSize)
{
size_t needed;
int mib[6];
}
int
-rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize)
- afs_int32 addrBuffer[]; /* the network addrs in net byte order */
- afs_int32 maskBuffer[]; /* the subnet masks */
- afs_int32 mtuBuffer[]; /* the MTU sizes */
- int maxSize; /* sizeof of buffer in afs_int32 units */
+rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[],
+ afs_int32 mtuBuffer[], int maxSize)
{
int s;
}
if ((ifm->ifm_flags & IFF_UP) == 0)
continue; /* not up */
- if (ifm->ifm_flags & IFF_LOOPBACK) {
- continue; /* skip aliased loopbacks as well. */
- }
while (addrcount > 0) {
struct sockaddr_in *a;
free(buf);
return count;
}
-
-
#else
-int
-rx_getAllAddr(buffer, maxSize)
- afs_int32 buffer[];
- int maxSize; /* sizeof of buffer in afs_int32 units */
+static int
+rx_getAllAddr_internal(afs_int32 buffer[], int maxSize, int loopbacks)
{
int s;
int i, len, count = 0;
continue; /* ignore this address */
}
if (a->sin_addr.s_addr != 0) {
- if (ifr->ifr_flags & IFF_LOOPBACK) {
+ if (!loopbacks && (ifr->ifr_flags & IFF_LOOPBACK)) {
continue; /* skip aliased loopbacks as well. */
}
if (count >= maxSize) /* no more space */
return count;
}
+int
+rx_getAllAddr(afs_int32 buffer[], int maxSize)
+{
+ return rx_getAllAddr_internal(buffer, maxSize, 0);
+}
+
/* this function returns the total number of interface addresses
* the buffer has to be passed in by the caller. It also returns
* the interface mask. If AFS_USERSPACE_IP_ADDR is defined, it
* by afsi_SetServerIPRank().
*/
int
-rxi_getAllAddrMaskMtu(addrBuffer, maskBuffer, mtuBuffer, maxSize)
- afs_int32 addrBuffer[]; /* the network addrs in net byte order */
- afs_int32 maskBuffer[]; /* the subnet masks */
- afs_int32 mtuBuffer[]; /* the MTU sizes */
- int maxSize; /* sizeof of buffer in afs_int32 units */
+rxi_getAllAddrMaskMtu(afs_int32 addrBuffer[], afs_int32 maskBuffer[],
+ afs_int32 mtuBuffer[], int maxSize)
{
int s;
int i, len, count = 0;
#endif
#if !defined(AFS_USERSPACE_IP_ADDR)
- count = rx_getAllAddr(addrBuffer, 1024);
+ count = rx_getAllAddr_internal(addrBuffer, 1024, 1);
for (i = 0; i < count; i++) {
maskBuffer[i] = htonl(0xffffffff);
mtuBuffer[i] = htonl(1500);
perror("SIOCGIFFLAGS");
continue; /* ignore this address */
}
- if (ifr->ifr_flags & IFF_LOOPBACK) {
- continue; /* skip aliased loopbacks as well. */
- }
if (count >= maxSize) { /* no more space */
printf("Too many interfaces..ignoring 0x%x\n",
EXT int rx_nFreePackets INIT(0);
EXT int rxi_NeedMorePackets INIT(0);
EXT int rx_nWaiting INIT(0);
+EXT int rx_nWaited INIT(0);
EXT int rx_packetReclaims INIT(0);
/* largest packet which we can safely receive, initialized to AFS 3.2 value
register int seconds);
extern void rxi_CleanupConnection(struct rx_connection *conn);
extern void rxi_DestroyConnection(register struct rx_connection *conn);
+extern void rx_GetConnection(register struct rx_connection *conn);
extern void rx_DestroyConnection(register struct rx_connection *conn);
extern struct rx_call *rx_NewCall(register struct rx_connection *conn);
extern int rxi_HasActiveCalls(register struct rx_connection *aconn);
return;
}
cp->length = 0;
- cp->niovecs = 1; /* just the header */
+ cp->niovecs = 2; /* header + space for rxkad stuff */
call->nFree = 0;
}
$(AR) crv $@ ${OBJS} AFS_component_version_number.o
$(RANLIB) $@
-crypt_conn.o: fcrypt.h private_data.h crypt_conn.c ${INCLS}
-
rxkad_client.o: fcrypt.h private_data.h rxkad_client.c ${INCLS}
rxkad_server.o: fcrypt.h private_data.h rxkad_server.c ${INCLS}
md5.o: md5.c ${INCLS}
-fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h
- ${CCOBJ} ${CFLAGS} -c fcrypt.c
+fcrypt.o: domestic/fcrypt.c fcrypt.h sboxes.h rxkad.h rxkad_prototypes.h
+ ${CCOBJ} ${CFLAGS} -c domestic/fcrypt.c
+
+crypt_conn.o: domestic/crypt_conn.c fcrypt.h private_data.h ${INCLS}
+ ${CCOBJ} ${CFLAGS} -c domestic/crypt_conn.c
+
+tcrypt.o: domestic/tcrypt.c AFS_component_version_number.o
+ ${CCOBJ} ${CFLAGS} -c domestic/fcrypt.c
tcrypt: tcrypt.o librxkad.a
${CC} -o tcrypt tcrypt.o librxkad.a
-tcrypt.o: tcrypt.c AFS_component_version_number.o
-
fc_test: ${fc_test_OBJS} ${fc_test_LIBS}
${CC} ${CFLAGS} -o fc_test ${fc_test_OBJS} ${fc_test_LIBS} ${XLIBS}
clean:
$(RM) -f *.o *.a tcrypt core rxkad_errs.c rxkad.h \
AFS_component_version_number.c \
- crypt_conn.c fcrypt.c fcrypt.h sboxes.h \
+ fcrypt.h sboxes.h \
fc_test
test:
# These sources are kept in a separate directory so that we can use an
# ACL to comply with source export restrictions.
-crypt_conn.c: domestic/crypt_conn.c
- ${INSTALL} $? $@
-
-fcrypt.c: domestic/fcrypt.c
- ${INSTALL} $? $@
-
fcrypt.h: domestic/fcrypt.h
${INSTALL} $? $@
sboxes.h: domestic/sboxes.h
${INSTALL} $? $@
-tcrypt.c: domestic/tcrypt.c
- ${INSTALL} $? $@
-
include ../config/Makefile.version
${DESTDIR}${libdir}/librxkad.a: librxkad.a
${INSTALL} $? $@
LIBS=${TOP_LIBDIR}/libgtx.a \
${TOP_LIBDIR}/libfsprobe.a \
${TOP_LIBDIR}/libvolser.a \
+ ${TOP_LIBDIR}/libubik.a \
${TOP_LIBDIR}/libkauth.a \
${TOP_LIBDIR}/libauth.a \
${TOP_LIBDIR}/librxkad.a \
${TOP_LIBDIR}/libcmd.a \
${TOP_LIBDIR}/vlib.a ${TOP_LIBDIR}/libacl.a \
${TOP_LIBDIR}/libvldb.a \
- ${TOP_LIBDIR}/libubik.a \
${TOP_LIBDIR}/libafsint.a \
${TOP_LIBDIR}/libsys.a \
${TOP_LIBDIR}/librx.a \
read_passwd.o
UBIKOBJS = \
+ uinit.o \
ubikclient.o \
uerrors.o \
ubik_int.cs.o \
ubikclient.o: ${UBIK}/ubikclient.c
${CCRULE}
+uinit.o: ${UBIK}/uinit.c
+ ${CCRULE}
+
uerrors.o: ${UBIK}/uerrors.c
${CCRULE}
md5.o: ${RXKAD}/md5.c
${CCRULE}
-fcrypt.o: ${RXKAD}/fcrypt.c
+fcrypt.o: ${RXKAD}/domestic/fcrypt.c
${CCRULE}
-crypt_conn.o: ${RXKAD}/crypt_conn.c
+crypt_conn.o: ${RXKAD}/domestic/crypt_conn.c
${CCRULE}
AFS_component_version_number.o: ${RX}/AFS_component_version_number.c
+++ /dev/null
-# Copyright 2000, International Business Machines Corporation and others.
-# All Rights Reserved.
-#
-# This software has been released under the terms of the IBM Public
-# License. For details, see the LICENSE file in the top-level source
-# directory or online at http://www.openafs.org/dl/license10.html
-
-RELDIR=shlibafsrpc
-!include ..\config\NTMakefile.$(SYS_NAME)
-!include ..\config\NTMakefile.version
-
-RX = ..\rx
-RXSTAT = ..\rxstat
-RXKAD = ..\rxkad
-DES = ..\des
-UTIL = ..\util
-FSINT = ..\fsint
-COMERR = ..\comerr
-
-# Additional debugging flag for RX.
-AFSDEV_AUXCDEFINES = -DRXDEBUG -DAFS_PTHREAD_ENV
-
-LIBFILE = $(DESTDIR)\lib\afsrpc.dll
-
-# Object files by category.
-MULTIOBJS = $(OUT)\rx_multi.obj
-
-XDROBJS = $(OUT)\xdr.obj \
- $(OUT)\xdr_array.obj \
- $(OUT)\xdr_arrayn.obj \
- $(OUT)\xdr_float.obj \
- $(OUT)\xdr_mem.obj \
- $(OUT)\xdr_rec.obj \
- $(OUT)\xdr_refernce.obj \
- $(OUT)\xdr_rx.obj \
- $(OUT)\xdr_update.obj \
- $(OUT)\xdr_afsuuid.obj \
- $(OUT)\xdr_int64.obj
-
-RXOBJS = $(OUT)\rx_event.obj \
- $(OUT)\rx_user.obj \
- $(OUT)\rx_pthread.obj \
- $(OUT)\rx.obj \
- $(OUT)\rx_null.obj \
- $(OUT)\rx_globals.obj \
- $(OUT)\rx_getaddr.obj \
- $(OUT)\rx_misc.obj
- $(OUT)\rx_packet.obj \
- $(OUT)\rx_rdwr.obj \
- $(OUT)\rx_trace.obj \
- $(OUT)\rx_xmit_nt.obj \
- $(OUT)\rx_conncache.obj
-
-RXSTATOBJS = $(OUT)\rxstat.obj \
- $(OUT)\rxstat.ss.obj \
- $(OUT)\rxstat.xdr.obj \
- $(OUT)\rxstat.cs.obj
-
-LIBRXKAD_OBJS = $(OUT)\rxkad_client.obj \
- $(OUT)\rxkad_server.obj \
- $(OUT)\rxkad_common.obj \
- $(OUT)\ticket.obj \
- $(OUT)\ticket5.obj \
- $(OUT)\crc.obj \
- $(OUT)\md4.obj \
- $(OUT)\md5.obj \
- $(OUT)\AFS_component_version_number.obj
-
-LIBRXKAD_REGOBJS = $(OUT)\fcrypt.obj \
- $(OUT)\crypt_conn.obj
-
-DESOBJS = $(OUT)\des.obj \
- $(OUT)\cbc_encrypt.obj \
- $(OUT)\pcbc_encrypt.obj \
- $(OUT)\cksum.obj \
- $(OUT)\new_rnd_key.obj \
- $(OUT)\key_sched.obj \
- $(OUT)\debug_decl.obj \
- $(OUT)\quad_cksum.obj \
- $(OUT)\key_parity.obj \
- $(OUT)\weak_key.obj \
- $(OUT)\strng_to_key.obj \
- $(OUT)\misc.obj \
- $(OUT)\util.obj
-
-UTILOBJS = $(OUT)\casestrcpy.obj \
- $(OUT)\winsock_nt.obj
-
-COMERROBJS = $(OUT)\error_msg.obj \
- $(OUT)\et_name.obj \
- $(OUT)\com_err.obj
-
-FSINTOBJS = $(OUT)\afsint.cs.obj \
- $(OUT)\afsint.xdr.obj \
- $(OUT)\afscbint.cs.obj \
- $(OUT)\afscbint.xdr.obj \
- $(OUT)\afsaux.obj
-
-DLLOBJS = $(MULTIOBJS) $(RXOBJS) $(XDROBJS) $(RXSTATOBJS) $(LIBRXKAD_OBJS) \
- $(DESOBJS) $(LIBRXKAD_REGOBJS) $(UTILOBJS) $(COMERROBJS) \
- $(FSINTOBJS) afsrpc.res
-
-rx_multi.obj: $(RX)\rx_multi.c
- $(C2OBJ) $(RX)\rx_multi.c
-
-xdr.obj: $(RX)\xdr.c
- $(C2OBJ) $(RX)\xdr.c
-
-xdr_array.obj: $(RX)\xdr_array.c
- $(C2OBJ) $(RX)\xdr_array.c
-
-xdr_arrayn.obj: $(RX)\xdr_arrayn.c
- $(C2OBJ) $(RX)\xdr_arrayn.c
-
-xdr_float.obj: $(RX)\xdr_float.c
- $(C2OBJ) $(RX)\xdr_float.c
-
-xdr_mem.obj: $(RX)\xdr_mem.c
- $(C2OBJ) $(RX)\xdr_mem.c
-
-xdr_rec.obj: $(RX)\xdr_rec.c
- $(C2OBJ) $(RX)\xdr_rec.c
-
-xdr_refernce.obj: $(RX)\xdr_refernce.c
- $(C2OBJ) $(RX)\xdr_refernce.c
-
-xdr_rx.obj: $(RX)\xdr_rx.c
- $(C2OBJ) $(RX)\xdr_rx.c
-
-xdr_update.obj: $(RX)\xdr_update.c
- $(C2OBJ) $(RX)\xdr_update.c
-
-xdr_afsuuid.obj: $(RX)\xdr_afsuuid.c
- $(C2OBJ) $(RX)\xdr_afsuuid.c
-
-xdr_int64.obj: $(RX)\xdr_int64.c
- $(C2OBJ) $(RX)\xdr_int64.c
-
-rx_event.obj: $(RX)\rx_event.c
- $(C2OBJ) $(RX)\rx_event.c
-
-rx_user.obj: $(RX)\rx_user.c
- $(C2OBJ) $(RX)\rx_user.c
-
-rx_pthread.obj: $(RX)\rx_pthread.c
- $(C2OBJ) $(RX)\rx_pthread.c
-
-rx.obj: $(RX)\rx.c
- $(C2OBJ) $(RX)\rx.c
-
-rx_null.obj: $(RX)\rx_null.c
- $(C2OBJ) $(RX)\rx_null.c
-
-rx_globals.obj: $(RX)\rx_globals.c
- $(C2OBJ) $(RX)\rx_globals.c
-
-rx_getaddr.obj: $(RX)\rx_getaddr.c
- $(C2OBJ) $(RX)\rx_getaddr.c
-
-rx_misc.obj: $(RX)\rx_misc.c
- $(C2OBJ) $(RX)\rx_misc.c
-
-rx_packet.obj: $(RX)\rx_packet.c
- $(C2OBJ) $(RX)\rx_packet.c
-
-rx_rdwr.obj: $(RX)\rx_rdwr.c
- $(C2OBJ) $(RX)\rx_rdwr.c
-
-rx_trace.obj: $(RX)\rx_trace.c
- $(C2OBJ) $(RX)\rx_trace.c
-
-rx_xmit_nt.obj: $(RX)\rx_xmit_nt.c
- $(C2OBJ) $(RX)\rx_xmit_nt.c
-
-rx_conncache.obj: $(RX)\rx_conncache.c
- $(C2OBJ) $(RX)\rx_conncache.c
-
-rxstat.cs.obj:$(RXSTAT)\rxstat.cs.c
- $(C2OBJ) $(RXSTAT)\rxstat.cs.c
-
-rxstat.ss.obj:$(RXSTAT)\rxstat.ss.c
- $(C2OBJ) $(RXSTAT)\rxstat.ss.c
-
-rxstat.xdr.obj:$(RXSTAT)\rxstat.xdr.c
- $(C2OBJ) $(RXSTAT)\rxstat.xdr.c
-
-rxstat.obj:$(RXSTAT)\rxstat.c
- $(C2OBJ) $(RXSTAT)\rxstat.c
-
-rxkad_client.obj:$(RXKAD)\rxkad_client.c
- $(C2OBJ) $(RXKAD)\rxkad_client.c
-
-rxkad_server.obj:$(RXKAD)\rxkad_server.c
- $(C2OBJ) $(RXKAD)\rxkad_server.c
-
-rxkad_common.obj:$(RXKAD)\rxkad_common.c
- $(C2OBJ) $(RXKAD)\rxkad_common.c
-
-ticket.obj:$(RXKAD)\ticket.c
- $(C2OBJ) $(RXKAD)\ticket.c
-
-fcrypt.obj:$(RXKAD)\fcrypt.c
- $(C2OBJ) $(RXKAD)\fcrypt.c
-
-crypt_conn.obj:$(RXKAD)\crypt_conn.c
- $(C2OBJ) $(RXKAD)\crypt_conn.c
-
-AFS_component_version_number.obj:$(RXKAD)\AFS_component_version_number.c
- $(C2OBJ) $(RXKAD)\AFS_component_version_number.c
-
-fcrypt_x.obj:$(RXKAD)\fcrypt.c
- $(C2OBJ) $(RXKAD)\fcrypt.c /Fofcrypt_x.obj
-
-crypt_conn_x.obj:$(RXKAD)\crypt_conn.c
- $(C2OBJ) $(RXKAD)\crypt_conn.c /Focrypt_conn_x.obj
-
-des.obj:$(DES)\des.c
- $(C2OBJ) $(DES)\des.c
-
-cbc_encrypt.obj:$(DES)\cbc_encrypt.c
- $(C2OBJ) $(DES)\cbc_encrypt.c
-
-pcbc_encrypt.obj:$(DES)\pcbc_encrypt.c
- $(C2OBJ) $(DES)\pcbc_encrypt.c
-
-cksum.obj:$(DES)\cksum.c
- $(C2OBJ) $(DES)\cksum.c
-
-new_rnd_key.obj:$(DES)\new_rnd_key.c
- $(C2OBJ) $(DES)\new_rnd_key.c
-
-key_sched.obj:$(DES)\key_sched.c
- $(C2OBJ) $(DES)\key_sched.c
-
-debug_decl.obj:$(DES)\debug_decl.c
- $(C2OBJ) $(DES)\debug_decl.c
-
-quad_cksum.obj:$(DES)\quad_cksum.c
- $(C2OBJ) $(DES)\quad_cksum.c
-
-key_parity.obj:$(DES)\key_parity.c
- $(C2OBJ) $(DES)\key_parity.c
-
-weak_key.obj:$(DES)\weak_key.c
- $(C2OBJ) $(DES)\weak_key.c
-
-strng_to_key.obj:$(DES)\strng_to_key.c
- $(C2OBJ) $(DES)\strng_to_key.c
-
-misc.obj:$(DES)\misc.c
- $(C2OBJ) -DDONT_INCL_MAIN $(DES)\misc.c
-
-util.obj:$(DES)\util.c
- $(C2OBJ) $(DES)\util.c
-
-des_x.obj:$(DES)\des.c
- $(C2OBJ) $(DES)\des.c /Fodes_x.obj
-
-cbc_crypt_x.obj:$(DES)\cbc_encrypt.c
- $(C2OBJ) $(DES)\cbc_encrypt.c /Focbc_crypt_x.obj
-
-pcbc_crypt_x.obj:$(DES)\pcbc_encrypt.c
- $(C2OBJ) $(DES)\pcbc_encrypt.c /Fopcbc_crypt_x.obj
-
-cksum_x.obj:$(DES)\cksum.c
- $(C2OBJ) $(DES)\cksum.c /Focksum_x.obj
-
-nrnd_key_x.obj:$(DES)\new_rnd_key.c
- $(C2OBJ) $(DES)\new_rnd_key.c /Fonrnd_key_x.obj
-
-error_msg.obj:$(COMERR)\error_msg.c
- $(C2OBJ) $(COMERR)\error_msg.c
-
-et_name.obj:$(COMERR)\et_name.c
- $(C2OBJ) $(COMERR)\et_name.c
-
-com_err.obj:$(COMERR)\com_err.c
- $(C2OBJ) $(COMERR)\com_err.c
-
-casestrcpy.obj:$(UTIL)\casestrcpy.c
- $(C2OBJ) $(UTIL)\casestrcpy.c
-
-winsock_nt.obj:$(UTIL)\winsock_nt.c
- $(C2OBJ) $(UTIL)\winsock_nt.c
-
-afsint.cs.obj:$(FSINT)\afsint.cs.c
- $(C2OBJ) $(FSINT)\afsint.cs.c
-
-afsint.xdr.obj:$(FSINT)\afsint.xdr.c
- $(C2OBJ) $(FSINT)\afsint.xdr.c
-
-afscbint.cs.obj:$(FSINT)\afscbint.cs.c
- $(C2OBJ) $(FSINT)\afscbint.cs.c
-
-afscbint.xdr.obj:$(FSINT)\afscbint.xdr.c
- $(C2OBJ) $(FSINT)\afscbint.xdr.c
-
-afsaux.obj:$(FSINT)\afsaux.c
- $(C2OBJ) $(FSINT)\afsaux.c
-
-NTMAKE = nmake /nologo /f ntmakefile
-
-
-DLLLIBS =\
-!IF (("$(SYS_NAME)"=="i386_win95" ) || ("$(SYS_NAME)"=="I386_WIN95" ))
- $(DESTDIR)\lib\win95\afspthread.lib \
-!ELSE
- $(DESTDIR)\lib\afspthread.lib \
-!ENDIF
- $(DESTDIR)\lib\afs\afsutil.lib \
- $(DESTDIR)\lib\afs\afsreg.lib
-
-$(DESTDIR)\lib\afsrpc.dll: $(DLLOBJS) $(DLLLIBS)
- $(DLLCONLINK) /DEF:afsrpc.def
- $(DLLPREP)
-
-# Definitions for generating versioninfo resources
-afsrpc.res: afsrpc.rc AFS_component_version_number.h
- $(RC) $*.rc
-
-
-install:
-! IF (EXIST(..\..\src\des\NTMakefile))
- $(NTMAKE) $(LIBFILE)
-! else
- $(NTMAKE) libstub
-! endif
-
-install9x: install
-
-!IF (EXIST(..\..\src\des\NTMakefile))
-!ELSE IF (EXIST(..\..\DESLIB))
-DESPAR = ..\..\DESLIB\dest
-!ELSE IF (EXIST(..\..\..\DESLIB))
-DESPAR = ..\..\..\DESLIB\dest
-!ELSE
-!ERROR Must create DESLIB link in the same directory as PARENT link.
-!ENDIF
-
-libstub:
- $(COPY) $(DESPAR)\lib\afsrpc.dll \
- $(DESTDIR)\lib\afsrpc.dll
- $(COPY) $(DESPAR)\lib\afsrpc.lib \
- $(DESTDIR)\lib\afsrpc.lib
- $(COPY) $(DESPAR)\lib\afsrpc.exp \
- $(DESTDIR)\lib\afsrpc.exp
-
-clean::
- $(DEL) $(DESTDIR)\lib\afsrpc.dll $(DESTDIR)\lib\afsrpc.lib $(DESTDIR)\lib\afsrpc.exp
\ No newline at end of file
+++ /dev/null
-EXPORTS
- des_check_key_parity @2
- des_fixup_key_parity @5
- des_init_random_number_generator @6
- des_is_weak_key @7
- des_key_sched @8
- des_random_key @9
- des_string_to_key @10
- ktohl @11
- life_to_time @12
- rx_DestroyConnection @13
- rx_EndCall @14
- rx_Finalize @15
- rx_GetCachedConnection @16
- rx_GetCall @17
- rx_GetIFInfo @18
- rx_Init @19
- rx_NewCall @20
- rx_NewConnection @21
- rx_NewService @22
- rx_PrintPeerStats @23
- rx_PrintStats @24
- rx_PrintTheseStats @25
- rx_ReadProc @26
- rx_ReleaseCachedConnection @27
- rx_ServerProc @28
- rx_StartServer @29
- rx_WriteProc @30
- rxevent_Init @31
- rxevent_Post @32
- rxkad_GetServerInfo @33
- rxkad_NewClientSecurityObject @34
- rxkad_NewServerSecurityObject @35
- rxnull_NewClientSecurityObject @38
- rxnull_NewServerSecurityObject @39
- rxs_Release @40
- time_to_life @41
- tkt_CheckTimes @42
- tkt_DecodeTicket @43
- tkt_MakeTicket @44
- xdr_array @45
- xdr_bool @46
- xdr_bytes @47
- xdr_char @48
- xdr_double @49
- xdr_enum @50
- xdr_float @51
- xdr_int @52
- xdr_long @53
- xdr_opaque @54
- xdr_pointer @55
- xdr_reference @56
- xdr_short @57
- xdr_string @58
- xdr_u_char @59
- xdr_u_int @60
- xdr_u_long @61
- xdr_u_short @62
- xdr_union @63
- xdr_vector @64
- xdr_void @65
- xdr_wrapstring @66
- xdrmem_create @67
- xdrrec_create @68
- xdrrec_endofrecord @69
- xdrrec_eof @70
- xdrrec_skiprecord @71
- xdrrx_create @72
- hton_syserr_conv @73
- rxkad_stats @74 DATA
- com_err @75
- error_message @76
- rx_socket @77 DATA
- AssertionFailed @79
- afs_winsockInit @80
- rxevent_debugFile @81 DATA
- rx_debugFile @82 DATA
- rx_connDeadTime @83 DATA
- rx_maxReceiveSize @84 DATA
- rx_UdpBufSize @85 DATA
- rx_extraQuota @86 DATA
- rx_extraPackets @87 DATA
- rx_tranquil @88 DATA
- rx_getAllAddr @89
- rx_nWaiting @90 DATA
- rx_stats @91 DATA
- rx_SetNoJumbo @92
- rx_SetConnDeadTime @93
- rx_FlushWrite @94
- rx_thread_id_key @95 DATA
- multi_Finalize @96
- multi_Select @97
- multi_Init @98
- multi_Finalize_Ignore @99
- add_to_error_table @100
- xdr_afsUUID @101
- rx_GetSpecific @102
- rx_SetSpecific @103
- rx_KeyCreate @104
- rx_BusyError @105 DATA
- rx_BusyThreshold @106 DATA
- rx_IncrementTimeAndCount @107
- rx_enable_stats @108 DATA
- rx_GetServerDebug @109
- rx_GetServerStats @110
- rx_GetServerVersion @111
- rx_GetServerConnections @112
- rx_stats_mutex @113 DATA
- rx_GetServerPeers @114
- rx_RetrieveProcessRPCStats @115
- rx_RetrievePeerRPCStats @116
- rx_FreeRPCStats @117
- rx_queryProcessRPCStats @118
- rx_queryPeerRPCStats @119
- rx_enableProcessRPCStats @120
- rx_enablePeerRPCStats @121
- rx_disableProcessRPCStats @122
- rx_disablePeerRPCStats @123
- RXSTATS_ExecuteRequest @124
- RXSTATS_RetrieveProcessRPCStats @125
- RXSTATS_RetrievePeerRPCStats @126
- RXSTATS_QueryProcessRPCStats @127
- RXSTATS_QueryPeerRPCStats @128
- RXSTATS_EnableProcessRPCStats @129
- RXSTATS_EnablePeerRPCStats @130
- RXSTATS_DisableProcessRPCStats @131
- RXSTATS_DisablePeerRPCStats @132
- RXSTATS_QueryRPCStatsVersion @133
- RXSTATS_ClearProcessRPCStats @134
- RXSTATS_ClearPeerRPCStats @135
-
-
- rxi_connAbortThreshhold @138 DATA
- rxi_connAbortDelay @139 DATA
- rxi_callAbortThreshhold @140 DATA
- rxi_callAbortDelay @141 DATA
- RXSTATS_function_names @142 DATA
- RXAFSCB_function_names @143 DATA
- RXAFSCB_CallBack @144
- StartRXAFSCB_CallBack @145
- EndRXAFSCB_CallBack @146
- RXAFSCB_InitCallBackState @147
- RXAFSCB_Probe @148
- StartRXAFSCB_Probe @149
- EndRXAFSCB_Probe @150
- RXAFSCB_GetLock @151
- RXAFSCB_GetCE @152
- RXAFSCB_XStatsVersion @153
- RXAFSCB_GetXStats @154
- RXAFSCB_InitCallBackState2 @155
- RXAFSCB_WhoAreYou @156
- RXAFSCB_InitCallBackState3 @157
- RXAFSCB_ProbeUuid @158
- StartRXAFSCB_ProbeUuid @159
- EndRXAFSCB_ProbeUuid @160
- RXAFSCB_GetServerPrefs @161
- RXAFSCB_GetCellServDB @162
- RXAFSCB_GetLocalCell @163
- RXAFSCB_GetCacheConfig @164
- StartRXAFS_FetchData @165
- EndRXAFS_FetchData @166
- RXAFS_FetchACL @167
- RXAFS_FetchStatus @168
- StartRXAFS_StoreData @169
- EndRXAFS_StoreData @170
- RXAFS_StoreACL @171
- RXAFS_StoreStatus @172
- RXAFS_RemoveFile @173
- RXAFS_CreateFile @174
- RXAFS_Rename @175
- RXAFS_Symlink @176
- RXAFS_Link @177
- RXAFS_MakeDir @178
- RXAFS_RemoveDir @179
- RXAFS_OldSetLock @180
- RXAFS_OldExtendLock @181
- RXAFS_OldReleaseLock @182
- RXAFS_GetStatistics @183
- RXAFS_GiveUpCallBacks @184
- RXAFS_GetVolumeInfo @185
- RXAFS_GetVolumeStatus @186
- RXAFS_SetVolumeStatus @187
- RXAFS_GetRootVolume @188
- RXAFS_CheckToken @189
- RXAFS_GetTime @190
- RXAFS_NGetVolumeInfo @191
- RXAFS_BulkStatus @192
- RXAFS_SetLock @193
- RXAFS_ExtendLock @194
- RXAFS_ReleaseLock @195
- RXAFS_XStatsVersion @196
- RXAFS_GetXStats @197
- RXAFS_Lookup @198
- RXAFS_FlushCPS @199
- RXAFS_DFSSymlink @200
- rx_SetRxStatUserOk @201
- rx_RxStatUserOk @202
- rx_enable_hot_thread @203 DATA
- xdr_int64 @204
- xdr_uint64 @205
+++ /dev/null
-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-
-/* Define VERSIONINFO resource */
-
-#define AFS_VERINFO_FILE_DESCRIPTION "AFS Rx RPC DLL"
-#define AFS_VERINFO_DLL
-#define AFS_VERINFO_NAME "afsrpc"
-#define AFS_VERINFO_FILENAME "afsrpc.dll"
-
-#include "AFS_component_version_number.h"
-#include "..\config\NTVersioninfo.rc"
LIBOBJS=disk.o remote.o beacon.o recovery.o ubik.o vote.o lock.o phys.o \
ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
- ubikclient.o uerrors.o
+ ubikclient.o uerrors.o uinit.o
INCLS=${TOP_INCDIR}/lwp.h ${TOP_INCDIR}/lock.h \
${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
$(RANLIB) $@
disk.o: disk.c ${INCLS}
+uinit.o: uinit.c ${INCLS}
remote.o: remote.c ${INCLS}
beacon.o: beacon.c ${INCLS}
lock.o: lock.c ${INCLS}
$(OUT)\beacon.obj \
$(OUT)\recovery.obj \
$(OUT)\ubik.obj \
+ $(OUT)\uinit.obj \
$(OUT)\vote.obj \
$(OUT)\lock.obj \
$(OUT)\phys.obj \
register afs_int32 i, j, code;
short port;
int int32p;
- afs_int32 now, diff, newtime;
+ time_t now, diff, newtime;
struct hostent *th;
struct rx_connection *tconn;
struct rx_securityClass *sc;
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#include <afsconfig.h>
+#include <afs/param.h>
+
+RCSID
+ ("$Header$");
+
+#include <afs/stds.h>
+#ifdef AFS_NT40_ENV
+#include <fcntl.h>
+#include <winsock2.h>
+#else
+#include <sys/types.h>
+#include <sys/file.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#endif /* AFS_NT40_ENV */
+#include <sys/stat.h>
+#ifdef AFS_AIX_ENV
+#include <sys/statfs.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
+#include <afs/dirpath.h>
+#include <errno.h>
+#include <lock.h>
+#include <rx/xdr.h>
+#include <rx/rx.h>
+#include <rx/rx_globals.h>
+#include <afs/auth.h>
+#include <afs/cellconfig.h>
+#include <afs/keys.h>
+#include <ubik.h>
+#include <afs/afsint.h>
+#include <afs/cmd.h>
+#include <rx/rxkad.h>
+
+/*
+ Get the appropriate type of ubik client structure out from the system.
+*/
+afs_int32
+ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth,
+ struct ubik_client **uclientp, int (*secproc) (),
+ char *funcName, afs_int32 gen_rxkad_level,
+ afs_int32 maxservers, afs_int32 serviceid, afs_int32 deadtime,
+ afs_uint32 server, afs_uint32 port, afs_int32 usrvid)
+{
+ afs_int32 code, scIndex, i;
+ struct afsconf_cell info;
+ struct afsconf_dir *tdir;
+ struct ktc_principal sname;
+ struct ktc_token ttoken;
+ struct rx_securityClass *sc;
+ /* This must change if VLDB_MAXSERVERS becomes larger than MAXSERVERS */
+ static struct rx_connection *serverconns[MAXSERVERS];
+ char cellstr[64];
+
+ code = rx_Init(0);
+ if (code) {
+ fprintf(stderr, "%s: could not initialize rx.\n", funcName);
+ return code;
+ }
+ rx_SetRxDeadTime(deadtime);
+
+ if (sauth) { /* -localauth */
+ tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+ if (!tdir) {
+ fprintf(stderr,
+ "%s: Could not process files in configuration directory (%s).\n",
+ funcName, AFSDIR_SERVER_ETC_DIRPATH);
+ return -1;
+ }
+ code = afsconf_ClientAuth(tdir, &sc, &scIndex); /* sets sc,scIndex */
+ if (code) {
+ fprintf(stderr,
+ "%s: Could not get security object for -localAuth\n",
+ funcName);
+ return -1;
+ }
+ code =
+ afsconf_GetCellInfo(tdir, tdir->cellName, serviceid,
+ &info);
+ if (code) {
+ fprintf(stderr,
+ "%s: can't find cell %s's hosts in %s/%s\n",
+ funcName, cellName, AFSDIR_SERVER_ETC_DIRPATH,
+ AFSDIR_CELLSERVDB_FILE);
+ exit(1);
+ }
+ } else { /* not -localauth */
+ tdir = afsconf_Open(confDir);
+ if (!tdir) {
+ fprintf(stderr,
+ "%s: Could not process files in configuration directory (%s).\n",
+ funcName, confDir);
+ return -1;
+ }
+
+ if (!cellName) {
+ code = afsconf_GetLocalCell(tdir, cellstr, sizeof(cellstr));
+ if (code) {
+ fprintf(stderr,
+ "%s: can't get local cellname, check %s/%s\n",
+ funcName, confDir, AFSDIR_THISCELL_FILE);
+ exit(1);
+ }
+ cellName = cellstr;
+ }
+
+ code =
+ afsconf_GetCellInfo(tdir, cellName, serviceid, &info);
+ if (code) {
+ fprintf(stderr,
+ "%s: can't find cell %s's hosts in %s/%s\n",
+ funcName, cellName, confDir, AFSDIR_CELLSERVDB_FILE);
+ exit(1);
+ }
+ if (noAuthFlag) /* -noauth */
+ scIndex = 0;
+ else { /* not -noauth */
+ strcpy(sname.cell, info.name);
+ sname.instance[0] = 0;
+ strcpy(sname.name, "afs");
+ code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
+ if (code) { /* did not get ticket */
+ fprintf(stderr,
+ "%s: Could not get afs tokens, running unauthenticated.\n",
+ funcName);
+ scIndex = 0;
+ } else { /* got a ticket */
+ scIndex = 2;
+ if ((ttoken.kvno < 0) || (ttoken.kvno > 256)) {
+ fprintf(stderr,
+ "%s: funny kvno (%d) in ticket, proceeding\n",
+ funcName, ttoken.kvno);
+ }
+ }
+ }
+
+ switch (scIndex) {
+ case 0:
+ sc = rxnull_NewClientSecurityObject();
+ break;
+ case 2:
+ sc = rxkad_NewClientSecurityObject(gen_rxkad_level,
+ &ttoken.sessionKey,
+ ttoken.kvno, ttoken.ticketLen,
+ ttoken.ticket);
+ break;
+ default:
+ fprintf(stderr, "%s: unsupported security index %d\n",
+ funcName, scIndex);
+ exit(1);
+ break;
+ }
+ }
+
+ afsconf_Close(tdir);
+
+ if (secproc) /* tell UV module about default authentication */
+ (*secproc) (sc, scIndex);
+ if (server) {
+ serverconns[0] = rx_NewConnection(server, port,
+ usrvid, sc, scIndex);
+ } else {
+ if (info.numServers > maxservers) {
+ fprintf(stderr,
+ "%s: info.numServers=%d (> maxservers=%d)\n",
+ funcName, info.numServers, maxservers);
+ exit(1);
+ }
+ for (i = 0; i < info.numServers; i++) {
+ serverconns[i] =
+ rx_NewConnection(info.hostAddr[i].sin_addr.s_addr,
+ info.hostAddr[i].sin_port, usrvid,
+ sc, scIndex);
+ }
+ }
+ /* Are we just setting up connections, or is this really ubik stuff? */
+ if (uclientp) {
+ *uclientp = 0;
+ code = ubik_ClientInit(serverconns, uclientp);
+ if (code) {
+ fprintf(stderr, "%s: ubik client init failed.\n", funcName);
+ return code;
+ }
+ }
+ return 0;
+}
+
+
$(RANLIB) util.a
assert.o: ${srcdir}/assert.c ${includes}
- ${CC} ${CFLAGS} -c ${srcdir}/assert.c
+ ${CCOBJ} ${CFLAGS} -c ${srcdir}/assert.c
casestrcpy.o: ${srcdir}/casestrcpy.c ${includes}
- ${CC} ${CFLAGS} -c ${srcdir}/casestrcpy.c
+ ${CCOBJ} ${CFLAGS} -c ${srcdir}/casestrcpy.c
hputil.o: ${srcdir}/hputil.c ${includes}
${CC} ${CFLAGS} -c ${srcdir}/hputil.c
${CC} ${CFLAGS} -c ${srcdir}/serverLog.c
dirpath.o: ${srcdir}/dirpath.c ${includes}
- ${CC} ${CFLAGS} -c ${srcdir}/dirpath.c
+ ${CCOBJ} ${CFLAGS} -c ${srcdir}/dirpath.c
fileutil.o: ${srcdir}/fileutil.c ${includes}
- ${CC} ${CFLAGS} -c ${srcdir}/fileutil.c
+ ${CCOBJ} ${CFLAGS} -c ${srcdir}/fileutil.c
netutils.o: ${srcdir}/netutils.c ${includes}
${CC} ${CFLAGS} -c ${srcdir}/netutils.c
{
static char tbuffer[30];
register char *tp;
- tp = ctime((time_t *) & atime);
+ time_t t = atime;
+ tp = ctime(&t);
if (tp) {
strcpy(tbuffer, tp);
tbuffer[24] = 0; /* get rid of new line */
#define MAX_NETFILE_LINE 2048 /* length of a line in the netrestrict file */
#define MAXIPADDRS 1024 /* from afsd.c */
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK (afs_uint32)0x7f000001
+#endif
+
/*
* The line parameter is a pointer to a buffer containing a string of
* bytes of the form
break;
}
}
+
+ /* Always mask loopback address */
+ if (found && addr1[i] == INADDR_LOOPBACK)
+ found = 0;
+
if (found) {
taddr[count] = addr1[i];
tmask[count] = mask1[i];
#endif
if (mrafsStyleLogs) {
+ time_t t = Start.tv_sec;
TM_GetTimeOfDay(&Start, 0);
- TimeFields = localtime(&Start.tv_sec);
+ TimeFields = localtime(&t);
if (fileName) {
if (strncmp(fileName, (char *)&ourName, strlen(fileName)))
strcpy((char *)&ourName, (char *)fileName);
}
static int
-SetACLCmd(struct cmd_syndesc *as)
+SetACLCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
static int
-CopyACLCmd(struct cmd_syndesc *as)
+CopyACLCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
/* clean up an acl to not have bogus entries */
static int
-CleanACLCmd(struct cmd_syndesc *as)
+CleanACLCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct Acl *ta = 0;
}
static int
-ListACLCmd(struct cmd_syndesc *as)
+ListACLCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct Acl *ta;
}
static int
-FlushVolumeCmd(struct cmd_syndesc *as)
+FlushVolumeCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-FlushCmd(struct cmd_syndesc *as)
+FlushCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
/* all this command does is repackage its args and call SetVolCmd */
static int
-SetQuotaCmd(struct cmd_syndesc *as)
+SetQuotaCmd(struct cmd_syndesc *as, char *arock)
{
struct cmd_syndesc ts;
}
static int
-SetVolCmd(struct cmd_syndesc *as)
+SetVolCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
};
static int
-ExamineCmd(struct cmd_syndesc *as)
+ExamineCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-ListQuotaCmd(struct cmd_syndesc *as)
+ListQuotaCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-WhereIsCmd(struct cmd_syndesc *as)
+WhereIsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
static int
-DiskFreeCmd(struct cmd_syndesc *as)
+DiskFreeCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-QuotaCmd(struct cmd_syndesc *as)
+QuotaCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-ListMountCmd(struct cmd_syndesc *as)
+ListMountCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static
-MakeMountCmd(struct cmd_syndesc *as)
+MakeMountCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
char *cellName, *volName, *tmpName;
* tp: Set to point to the actual name of the mount point to nuke.
*/
static int
-RemoveMountCmd(struct cmd_syndesc *as)
+RemoveMountCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code = 0;
struct ViceIoctl blob;
*/
static int
-CheckServersCmd(struct cmd_syndesc *as)
+CheckServersCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-MessagesCmd(struct cmd_syndesc *as)
+MessagesCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code = 0;
struct ViceIoctl blob;
}
static int
-CheckVolumesCmd(struct cmd_syndesc *as)
+CheckVolumesCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-SetCacheSizeCmd(struct cmd_syndesc *as)
+SetCacheSizeCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
#define MAXGCSIZE 16
static int
-GetCacheParmsCmd(struct cmd_syndesc *as)
+GetCacheParmsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-ListCellsCmd(struct cmd_syndesc *as)
+ListCellsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
afs_int32 i, j;
}
static int
-ListAliasesCmd(struct cmd_syndesc *as)
+ListAliasesCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code, i;
char *tp, *aliasName, *realName;
}
static int
-CallBackRxConnCmd(struct cmd_syndesc *as)
+CallBackRxConnCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-NewCellCmd(struct cmd_syndesc *as)
+NewCellCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code, linkedstate = 0, size = 0, *lp;
struct ViceIoctl blob;
}
static int
-NewAliasCmd(struct cmd_syndesc *as)
+NewAliasCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-WhichCellCmd(struct cmd_syndesc *as)
+WhichCellCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct cmd_item *ti;
}
static int
-WSCellCmd(struct cmd_syndesc *as)
+WSCellCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
*/
static int
-MonitorCmd(struct cmd_syndesc *as)
+MonitorCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-SysNameCmd(struct cmd_syndesc *as)
+SysNameCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
static char *exported_types[] = { "null", "nfs", "" };
static int
-ExportAfsCmd(struct cmd_syndesc *as)
+ExportAfsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
static int
-GetCellCmd(struct cmd_syndesc *as)
+GetCellCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-SetCellCmd(struct cmd_syndesc *as)
+SetCellCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
VLDBInit(int noAuthFlag, struct afsconf_cell *info)
{
afs_int32 code;
- struct ktc_principal sname;
- struct ktc_token ttoken;
- afs_int32 scIndex;
- struct rx_securityClass *sc;
- struct rx_connection *serverconns[VLDB_MAXSERVERS];
- afs_int32 i;
-
- code = rx_Init(0);
- if (code) {
- fprintf(stderr, "%s: could not initialize rx.\n", pn);
- return code;
- }
- rxInitDone = 1;
- rx_SetRxDeadTime(50);
- if (!noAuthFlag) { /* we don't need tickets for null */
- strcpy(sname.cell, info->name);
- sname.instance[0] = 0;
- strcpy(sname.name, "afs");
- code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
- if (code) {
- fprintf(stderr,
- "%s: Could not get afs tokens, running unauthenticated.\n",
- pn);
- scIndex = 0;
- } else {
- /* got a ticket */
- if (ttoken.kvno >= 0 && ttoken.kvno <= 255)
- scIndex = 2; /* kerberos */
- else {
- fprintf(stderr, "%s: funny kvno (%d) in ticket, proceeding\n",
- pn, ttoken.kvno);
- scIndex = 2;
- }
- }
- } else
- scIndex = 0; /* don't authenticate */
- switch (scIndex) {
- case 0:
- sc = rxnull_NewClientSecurityObject();
- break;
- case 1:
- break;
- case 2:
- sc = (struct rx_securityClass *)
- rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey,
- ttoken.kvno, ttoken.ticketLen,
- ttoken.ticket);
- break;
- }
- if (info->numServers > VLDB_MAXSERVERS) {
- fprintf(stderr, "%s: info.numServers=%d (> VLDB_MAXSERVERS=%d)\n", pn,
- info->numServers, VLDB_MAXSERVERS);
- exit(1);
- }
- memset(serverconns, 0, sizeof(serverconns));
- for (i = 0; i < info->numServers; i++)
- serverconns[i] =
- rx_NewConnection(info->hostAddr[i].sin_addr.s_addr,
- info->hostAddr[i].sin_port, USER_SERVICE_ID, sc,
- scIndex);
-
- code = ubik_ClientInit(serverconns, &uclient);
-
- if (code) {
- fprintf(stderr, "%s: ubik client init failed.\n", pn);
- return code;
- }
- return 0;
+ code = ugen_ClientInit(noAuthFlag, AFSDIR_CLIENT_ETC_DIRPATH,
+ info->name, 0, &uclient,
+ NULL, pn, rxkad_clear,
+ VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 50,
+ 0, 0, USER_SERVICE_ID);
+ rxInitDone = 1;
+ return code;
}
static struct ViceIoctl gblob;
static int
-SetPrefCmd(struct cmd_syndesc *as)
+SetPrefCmd(struct cmd_syndesc *as, char *arock)
{
FILE *infd;
afs_int32 code;
static int
-GetPrefCmd(struct cmd_syndesc *as)
+GetPrefCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct cmd_item *ti;
}
static int
-StoreBehindCmd(struct cmd_syndesc *as)
+StoreBehindCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code = 0;
struct ViceIoctl blob;
static afs_int32
-SetCryptCmd(struct cmd_syndesc *as)
+SetCryptCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code = 0, flag;
struct ViceIoctl blob;
static afs_int32
-GetCryptCmd(struct cmd_syndesc *as)
+GetCryptCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code = 0, flag;
struct ViceIoctl blob;
/* get clients interface addresses */
static int
-GetClientAddrsCmd(struct cmd_syndesc *as)
+GetClientAddrsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct cmd_item *ti;
}
static int
-SetClientAddrsCmd(struct cmd_syndesc *as)
+SetClientAddrsCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code, addr;
struct cmd_item *ti;
}
static int
-FlushMountCmd(struct cmd_syndesc *as)
+FlushMountCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
struct ViceIoctl blob;
}
static int
-RxStatProcCmd(struct cmd_syndesc *as)
+RxStatProcCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
afs_int32 flags = 0;
}
static int
-RxStatPeerCmd(struct cmd_syndesc *as)
+RxStatPeerCmd(struct cmd_syndesc *as, char *arock)
{
afs_int32 code;
afs_int32 flags = 0;
if (!thishost || (thishost->hostFlags & HOSTDELETED)) {
continue;
}
+ rx_GetConnection(thishost->callback_rxcon);
conns[j++] = thishost->callback_rxcon;
#ifdef ADAPT_MTU
}
H_LOCK;
- h_Lock_r(hp);
+ h_Lock_r(hp);
hp->hostFlags |= VENUSDOWN;
/**
* We always go into AddCallBack1_r with the host locked
*/
AddCallBack1_r(hp, afidp->AFSCBFids_val, itot(idx),
CB_DELAYED, 1);
- h_Unlock_r(hp);
+ h_Unlock_r(hp);
H_UNLOCK;
}
}
for (i = 0; i < ncbas; i++) {
struct host *hp;
hp = cba[i].hp;
- if (hp && xhost != hp)
+ if (hp && xhost != hp) {
+ rx_PutConnection(hp->callback_rxcon);
h_Release_r(hp);
+ }
}
return;
*hp = th->next;
h_DeleteList_r(host);
FreeHT(host);
+ free(th);
break;
}
}
struct rlimit rlim; /* max number of open file descriptors */
#endif
int curLimit;
+ time_t t;
#ifdef AFS_AIX32_ENV
struct sigaction nsa;
TM_GetTimeOfDay(&tp, 0);
#ifndef AFS_QUIETFS_ENV
- if (console != NULL) {
+ if (console != NULL) {
+ time_t t = tp.tv_sec;
fprintf(console, "File server has started at %s\r",
- afs_ctime(&tp.tv_sec, tbuffer, sizeof(tbuffer)));
+ afs_ctime(&t, tbuffer, sizeof(tbuffer)));
}
#endif
(void)signal(SIGQUIT, ShutDown_Signal);
#endif
+ t = tp.tv_sec;
ViceLog(0,
("File Server started %s",
- afs_ctime(&tp.tv_sec, tbuffer, sizeof(tbuffer))));
+ afs_ctime(&t, tbuffer, sizeof(tbuffer))));
#if FS_STATS_DETAILED
afs_FullPerfStats.det.epoch.tv_sec = StartTime = tp.tv_sec;
#endif
/* Almost identical's to pr_Initialize in vlserver/pruser.c */
afs_int32
-vl_Initialize(auth, confDir, server, cellp)
- int auth, server;
- char *confDir, *cellp;
+vl_Initialize(int auth, char *confDir, int server, char *cellp)
{
- afs_int32 code;
- struct afsconf_dir *tdir;
- struct ktc_principal sname;
- struct ktc_token ttoken;
- afs_int32 scIndex = 0;
- struct rx_securityClass *sc;
- struct afsconf_cell info;
- afs_int32 i;
-
- code = rx_Init(0);
- if (code) {
- fprintf(stderr, "vl_Initialize: Could not initialize rx.\n");
- return code;
- }
-
- rx_SetRxDeadTime(50);
- if (!server) {
- tdir = afsconf_Open(confDir);
- if (!tdir) {
- fprintf(stderr, "Could not open configuration directory (%s).\n",
- confDir);
- return -1;
- }
- }
- if (auth) { /* we don't need tickets for null */
- if (!server) {
- code = afsconf_GetLocalCell(tdir, sname.cell, sizeof(sname.cell));
- if (code) {
- fprintf(stderr,
- "vl_Initialize: Could not get local cell name.\n");
- return code;
- }
- } else
- strncpy(sname.cell, cellp, sizeof(sname.cell));
- sname.instance[0] = 0;
- strcpy(sname.name, "afs");
- code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
- if (code) {
- fprintf(stderr,
- "vl_Initialize: Could not get afs tokens, running unauthenticated.\n");
- scIndex = 0;
- } else if (ttoken.kvno <= 255)
- scIndex = 2;
- else { /* bcrypt */
- fprintf(stderr,
- "vl_Initialize: funny kvno (%d) in ticket, proceeding\n",
- ttoken.kvno);
- scIndex = 2;
- }
- }
- switch (scIndex) {
- case 0:
- sc = rxnull_NewClientSecurityObject();
- break;
- case 1:
- return -1;
- case 2:
- sc = rxkad_NewClientSecurityObject(rxkad_clear, &ttoken.sessionKey,
- ttoken.kvno, ttoken.ticketLen,
- ttoken.ticket);
- }
- if (!server) {
- code = afsconf_GetCellInfo(tdir, NULL, AFSCONF_VLDBSERVICE, &info);
- if (info.numServers > MAXSERVERS) {
- fprintf(stderr,
- "vl_Initialize: info.numServers=%d (> MAXSERVERS=%d)\n",
- info.numServers, MAXSERVERS);
- exit(1);
- }
- for (i = 0; i < info.numServers; i++)
- serverconns[i] =
- rx_NewConnection(info.hostAddr[i].sin_addr.s_addr,
- info.hostAddr[i].sin_port, USER_SERVICE_ID,
- sc, scIndex);
- } else {
- serverconns[0] =
- rx_NewConnection(server, htons(AFSCONF_VLDBPORT), USER_SERVICE_ID,
- sc, scIndex);
- }
- code = ubik_ClientInit(serverconns, &cstruct);
-
- if (code) {
- fprintf(stderr, "vl_Initialize: ubik client init failed.\n");
- return code;
- }
- return 0;
+ return ugen_ClientInit(auth?0:1, confDir, cellp, 0,
+ &cstruct, NULL, "vl_Initialize", rxkad_clear,
+ MAXSERVERS, AFSCONF_VLDBSERVICE, 50, server,
+ htons(AFSCONF_VLDBPORT), USER_SERVICE_ID);
}
/* return host address in network byte order */
afs_int32
-GetServer(aname)
- char *aname;
+GetServer(char *aname)
{
register struct hostent *th;
afs_int32 addr;
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
- char *wpath)
+ char *wpath, void *rock)
{
Log("ListViceInodes not implemented for this platform!\n");
return -1;
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
- char *wpath)
+ char *wpath, void *rock)
{
FILE *inodeFile = NULL;
char dev[50], rdev[51];
info.u.param[2] = p->di_vicep3;
info.u.param[3] = p->di_vicep4;
- if (judgeInode && (*judgeInode) (&info, judgeParam) == 0)
+ if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
continue;
if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
int
efs_ListViceInodes(char *devname, char *mountedOn, char *resultFile,
int (*judgeInode) (), int judgeParam, int *forcep,
- int forceR, char *wpath)
+ int forceR, char *wpath, void *rock)
{
FILE *inodeFile = NULL;
char dev[50], rdev[51];
p->di_nlink, info.u.param[0], info.u.param[1], info.u.param[2],
info.u.param[3]);
#endif
- if (judgeInode && (*judgeInode) (&info, judgeParam) == 0)
+ if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
continue;
if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
int
xfs_ListViceInodes(char *devname, char *mountedOn, char *resultFile,
int (*judgeInode) (), int judgeParam, int *forcep,
- int forceR, char *wpath)
+ int forceR, char *wpath, void *rock)
{
FILE *inodeFile = NULL;
i_list_inode_t info;
goto err1_exit;
}
- if (judgeInode && (*judgeInode) (&info.ili_info, judgeParam) == 0)
+ if (judgeInode && (*judgeInode) (&info.ili_info, judgeParam, rock) == 0)
continue;
rename = 0;
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
- char *wpath)
+ char *wpath, void *rock)
{
FILE *inodeFile = NULL;
char dev[50], rdev[51];
#ifdef AFS_SGI_XFS_IOPS_ENV
if (!strcmp("xfs", root_inode.st_fstype)) {
return xfs_ListViceInodes(devname, mountedOn, resultFile, judgeInode,
- judgeParam, forcep, forceR, wpath);
+ judgeParam, forcep, forceR, wpath, rock);
} else
#endif
#ifdef AFS_SGI_EFS_IOPS_ENV
if (root_inode.st_ino == EFS_ROOTINO) {
return efs_ListViceInodes(devname, mountedOn, resultFile, judgeInode,
- judgeParam, forcep, forceR, wpath);
+ judgeParam, forcep, forceR, wpath, rock);
} else
#endif
{
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
- char *wpath)
+ char *wpath, void *rock)
{
union {
#ifdef AFS_AIX_ENV
info.u.param[1] = auxp->aux_param2;
info.u.param[2] = auxp->aux_param3;
info.u.param[3] = auxp->aux_param4;
- if (judgeInode && (*judgeInode) (&info, judgeParam) == 0)
+ if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
continue;
if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
Log("Error writing inode file for partition %s\n", partition);
info.inodeNumber = i;
info.byteCount = p->di_size;
info.linkCount = p->di_nlink;
- if (judgeInode && (*judgeInode) (&info, judgeParam) == 0)
+ if (judgeInode && (*judgeInode) (&info, judgeParam, rock) == 0)
continue;
if (fwrite(&info, sizeof info, 1, inodeFile) != 1) {
Log("Error writing inode file for partition %s\n",
struct ViceInodeInfo * info,
char *dir, char *file), FILE * fp,
int (*judge_fun) (struct ViceInodeInfo * info,
- int vid), int singleVolumeNumber);
+ int vid, void *rock),
+ int singleVolumeNumber, void *rock);
int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid),
+ int (*judgeInode) (struct ViceInodeInfo * info, int vid,
+ void *rock),
int singleVolumeNumber, int *forcep, int forceR,
- char *wpath);
+ char *wpath, void *rock);
#define NAMEI_LCOMP_LEN 32
int (*write_fun) (FILE *, struct ViceInodeInfo *,
char *, char *), FILE * fp,
int (*judgeFun) (struct ViceInodeInfo *,
- int vid),
- int singleVolumeNumber);
+ int vid, void *rock),
+ int singleVolumeNumber, void *rock);
/* WriteInodeInfo
*/
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid),
- int singleVolumeNumber, int *forcep, int forceR, char *wpath)
+ int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
+ int singleVolumeNumber, int *forcep, int forceR, char *wpath,
+ void *rock)
{
FILE *fp = (FILE *) - 1;
int ninodes;
}
ninodes =
nt_ListAFSFiles(wpath, WriteInodeInfo, fp, judgeInode,
- singleVolumeNumber);
+ singleVolumeNumber, rock);
if (!resultFile)
return ninodes;
nt_ListAFSFiles(char *dev,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int),
- int singleVolumeNumber)
+ int (*judgeFun) (struct ViceInodeInfo *, int, void *),
+ int singleVolumeNumber, void *rock)
{
IHandle_t h;
char name[MAX_PATH];
if (!nt_HandleToVolDir(name, &h))
return -1;
ninodes =
- nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, singleVolumeNumber);
+ nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, singleVolumeNumber, rock);
if (ninodes < 0)
return ninodes;
} else {
return -1;
while (dp = readdir(dirp)) {
if (!DecodeVolumeName(dp->d_name, &h.ih_vid)) {
- ninodes += nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, 0);
+ ninodes += nt_ListAFSSubDirs(&h, writeFun, fp, judgeFun, 0, rock);
}
}
}
nt_ListAFSSubDirs(IHandle_t * dirIH,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int),
- int singleVolumeNumber)
+ int (*judgeFun) (struct ViceInodeInfo *, int, void *),
+ int singleVolumeNumber, void *rock)
{
int i;
IHandle_t myIH = *dirIH;
info.u.param[2] = data.ftCreationTime.dwHighDateTime;
info.u.param[3] = data.ftCreationTime.dwLowDateTime;
}
- if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber))
+ if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber, rock))
goto next_file;
if ((*writeFun) (fp, &info, path, data.cFileName) < 0) {
nt_close(linkHandle.fd_fd);
int nt_ListAFSFiles(char *dev,
int (*write_fun) (FILE * fp, struct ViceInodeInfo *,
char *dir, char *file), FILE * fp,
- int (*judge_fun) (struct ViceInodeInfo *, int vid),
- int singleVolumeNumber);
+ int (*judge_fun) (struct ViceInodeInfo *, int vid, void *rock),
+ int singleVolumeNumber, void *rock);
int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid),
+ int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
int singleVolumeNumber, int *forcep, int forceR,
- char *wpath);
+ char *wpath, void *rock);
int nt_HandleToName(char *name, IHandle_t * h);
}
-static
+static afs_int32
MyBeforeProc(struct rx_call *acall)
{
VTRANS_LOCK;
return 0;
}
-static
+static afs_int32
MyAfterProc(struct rx_call *acall, afs_int32 code)
{
VTRANS_LOCK;
/* Called every GCWAKEUP seconds to try to unlock all our partitions,
* if we're idle and there are no active transactions
*/
-static
+static void
TryUnlock()
{
/* if there are no running calls, and there are no active transactions, then
}
/* background daemon for timing out transactions */
-static
+static void
BKGLoop()
{
struct timeval tv;
/* Background daemon for sleeping so the volserver does not become I/O bound */
afs_int32 TTsleep, TTrun;
-static
+static void
BKGSleep()
{
struct volser_trans *tt;
#ifndef AFS_NT40_ENV
int
-volser_syscall(a3, a4, a5)
- afs_uint32 a3, a4;
- void *a5;
+volser_syscall(afs_uint32 a3, afs_uint32 a4, void *a5)
{
afs_uint32 rcode;
void (*old) ();
/* check whether caller is authorized to manage RX statistics */
int
-vol_rxstat_userok(call)
- struct rx_call *call;
+vol_rxstat_userok(struct rx_call *call)
{
return afsconf_SuperUser(tdir, call, NULL);
}
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc, char **argv)
{
register afs_int32 code;
struct rx_securityClass *(securityObjects[3]);
if (error) {
Log("1 Volser: CreateVolume: Unable to create the volume; aborted, error code %u\n", error);
LogError(error);
- DeleteTrans(tt);
+ DeleteTrans(tt, 1);
return EIO;
}
V_uniquifier(vp) = 1;
if (error) {
Log("1 Volser: create UpdateVolume failed, code %d\n", error);
LogError(error);
- DeleteTrans(tt);
+ DeleteTrans(tt, 1);
VDetachVolume(&junk, vp); /* rather return the real error code */
return error;
}
error = VOLSERTRELE_ERROR;
goto fail;
}
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
return 0;
fail:
TRELE(tt);
}
if (ttc)
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
return error;
}
goto fail;
}
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
{
struct DiskPartition *tpartp = originalvp->partition;
TRELE(tt);
}
if (ttc)
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
return error;
}
/* give up */
if (tv)
VDetachVolume(&code, tv);
- DeleteTrans(tt);
+ DeleteTrans(tt, 1);
return error;
}
tt->volume = tv;
return ENOENT;
}
*rcode = tt->returnCode;
- DeleteTrans(tt); /* this does an implicit TRELE */
+ DeleteTrans(tt, 1); /* this does an implicit TRELE */
return 0;
}
td->maxquota = astatus->maxquota;
if (astatus->dayUse != -1)
td->dayUse = astatus->dayUse;
- if (astatus->creationDate != -1)
- td->creationDate = astatus->creationDate;
- if (astatus->updateDate != -1)
- td->updateDate = astatus->updateDate;
VUpdateVolume(&error, tv);
tt->rxCallPtr = (struct rx_call *)0;
if (TRELE(tt))
tv = (Volume *) 0;
}
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
tv = (Volume *) 0;
}
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
drop:
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
pntr++;
tv = (Volume *) 0;
}
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
closedir(dirp);
tv = (Volume *) 0;
}
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
GetNextVol(dirp, volname, &volid);
}
closedir(dirp);
if (ttc)
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
return 0;
}
* Drop the transaction we have for this volume.
*/
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
tv = (Volume *) 0;
}
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
closedir(dirp);
tv = (Volume *) 0;
}
if (ttc) {
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
ttc = (struct volser_trans *)0;
}
GetNextVol(dirp, volname, &volid);
*/
closedir(dirp);
if (ttc)
- DeleteTrans(ttc);
+ DeleteTrans(ttc, 1);
return (0);
} /*SAFSVolXListVolumes */
/* create a new transaction, returning ptr to same with high ref count */
struct volser_trans *
-NewTrans(avol, apart)
- afs_int32 avol;
- afs_int32 apart;
+NewTrans(afs_int32 avol, afs_int32 apart)
{
/* set volid, next, partition */
register struct volser_trans *tt;
/* find a trans, again returning with high ref count */
struct volser_trans *
-FindTrans(atrans)
- register afs_int32 atrans;
+FindTrans(register afs_int32 atrans)
{
register struct volser_trans *tt;
VTRANS_LOCK;
}
/* delete transaction if refcount == 1, otherwise queue delete for later. Does implicit TRELE */
-DeleteTrans(atrans)
- register struct volser_trans *atrans;
+afs_int32
+DeleteTrans(register struct volser_trans *atrans, afs_int32 lock)
{
register struct volser_trans *tt, **lt;
afs_int32 error;
}
/* otherwise we zap it ourselves */
- VTRANS_LOCK;
+ if (lock) VTRANS_LOCK;
lt = &allTrans;
for (tt = *lt; tt; lt = &tt->next, tt = *lt) {
if (tt == atrans) {
tt->volume = NULL;
*lt = tt->next;
free(tt);
- VTRANS_UNLOCK;
+ if (lock) VTRANS_UNLOCK;
return 0;
}
}
- VTRANS_UNLOCK;
+ if (lock) VTRANS_UNLOCK;
return -1; /* failed to find the transaction in the generic list */
}
/* THOLD is a macro defined in volser.h */
/* put a transaction back */
-TRELE(at)
- register struct volser_trans *at;
+afs_int32
+TRELE(register struct volser_trans *at)
{
if (at->refCount == 0) {
Log("TRELE: bad refcount\n");
at->time = FT_ApproxTime(); /* we're still using it */
if (at->refCount == 1 && (at->tflags & TTDeleted)) {
- DeleteTrans(at);
+ DeleteTrans(at, 1);
return 0;
}
/* otherwise simply drop refcount */
#define OLDTRANSTIME 600 /* seconds */
#define OLDTRANSWARN 300 /* seconds */
static int GCDeletes = 0;
+afs_int32
GCTrans()
{
register struct volser_trans *tt, *nt;
if (tt->time + OLDTRANSTIME < now) {
Log("trans %u on volume %u has timed out\n", tt->tid, tt->volid);
tt->refCount++; /* we're using it now */
- DeleteTrans(tt); /* drops refCount or deletes it */
+ DeleteTrans(tt, 0); /* drops refCount or deletes it */
GCDeletes++;
}
}
static struct rx_connection *serverconns[VLDB_MAXSERVERS];
char cellstr[64];
-
- code = rx_Init(0);
- if (code) {
- fprintf(STDERR, "vsu_ClientInit: could not initialize rx.\n");
- return code;
- }
- rx_SetRxDeadTime(90);
-
- if (sauth) { /* -localauth */
- tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
- if (!tdir) {
- fprintf(STDERR,
- "vsu_ClientInit: Could not process files in configuration directory (%s).\n",
- AFSDIR_SERVER_ETC_DIRPATH);
- return -1;
- }
- code = afsconf_ClientAuth(tdir, &sc, &scIndex); /* sets sc,scIndex */
- if (code) {
- fprintf(STDERR,
- "vsu_ClientInit: Could not get security object for -localAuth\n");
- return -1;
- }
- code =
- afsconf_GetCellInfo(tdir, tdir->cellName, AFSCONF_VLDBSERVICE,
- &info);
- if (code) {
- fprintf(STDERR,
- "vsu_ClientInit: can't find cell %s's hosts in %s/%s\n",
- cellName, AFSDIR_SERVER_ETC_DIRPATH,
- AFSDIR_CELLSERVDB_FILE);
- exit(1);
- }
- } else { /* not -localauth */
- tdir = afsconf_Open(confDir);
- if (!tdir) {
- fprintf(STDERR,
- "vsu_ClientInit: Could not process files in configuration directory (%s).\n",
- confDir);
- return -1;
- }
-
- if (!cellName) {
- code = afsconf_GetLocalCell(tdir, cellstr, sizeof(cellstr));
- if (code) {
- fprintf(STDERR,
- "vsu_ClientInit: can't get local cellname, check %s/%s\n",
- confDir, AFSDIR_THISCELL_FILE);
- exit(1);
- }
- cellName = cellstr;
- }
-
- code =
- afsconf_GetCellInfo(tdir, cellName, AFSCONF_VLDBSERVICE, &info);
- if (code) {
- fprintf(STDERR,
- "vsu_ClientInit: can't find cell %s's hosts in %s/%s\n",
- cellName, confDir, AFSDIR_CELLSERVDB_FILE);
- exit(1);
- }
- if (noAuthFlag) /* -noauth */
- scIndex = 0;
- else { /* not -noauth */
- strcpy(sname.cell, info.name);
- sname.instance[0] = 0;
- strcpy(sname.name, "afs");
- code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
- if (code) { /* did not get ticket */
- fprintf(STDERR,
- "vsu_ClientInit: Could not get afs tokens, running unauthenticated.\n");
- scIndex = 0;
- } else { /* got a ticket */
- scIndex = 2;
- if ((ttoken.kvno < 0) || (ttoken.kvno > 255)) {
- fprintf(STDERR,
- "vsu_ClientInit: funny kvno (%d) in ticket, proceeding\n",
- ttoken.kvno);
- }
- }
- }
-
- switch (scIndex) {
- case 0:
- sc = rxnull_NewClientSecurityObject();
- break;
- case 2:
- sc = rxkad_NewClientSecurityObject(vsu_rxkad_level,
- &ttoken.sessionKey,
- ttoken.kvno, ttoken.ticketLen,
- ttoken.ticket);
- break;
- default:
- fprintf(STDERR, "vsu_ClientInit: unsupported security index %d\n",
- scIndex);
- exit(1);
- break;
- }
- }
-
- afsconf_Close(tdir);
-
- if (secproc) /* tell UV module about default authentication */
- (*secproc) (sc, scIndex);
- if (info.numServers > VLDB_MAXSERVERS) {
- fprintf(STDERR,
- "vsu_ClientInit: info.numServers=%d (> VLDB_MAXSERVERS=%d)\n",
- info.numServers, VLDB_MAXSERVERS);
- exit(1);
- }
- for (i = 0; i < info.numServers; i++) {
- serverconns[i] =
- rx_NewConnection(info.hostAddr[i].sin_addr.s_addr,
- info.hostAddr[i].sin_port, USER_SERVICE_ID, sc,
- scIndex);
- }
- *uclientp = 0;
- code = ubik_ClientInit(serverconns, uclientp);
- if (code) {
- fprintf(STDERR, "vsu_ClientInit: ubik client init failed.\n");
- return code;
- }
- return 0;
+ return ugen_ClientInit(noAuthFlag, confDir, cellName, sauth, uclientp,
+ secproc, "vsu_ClientInit", vsu_rxkad_level,
+ VLDB_MAXSERVERS, AFSCONF_VLDBSERVICE, 90,
+ 0, 0, USER_SERVICE_ID);
}