*
* Implements:
*/
-#include "../afs/param.h" /* Should be always first */
-#include "../afs/stds.h"
-#include "../afs/sysincludes.h" /* Standard vendor system headers */
+#include <afsconfig.h>
+#include "afs/param.h"
+
+RCSID("$Header$");
+
+#include "afs/stds.h"
+#include "afs/sysincludes.h" /* Standard vendor system headers */
#if !defined(UKERNEL)
#include <net/if.h>
#include <netinet/in.h>
#ifdef AFS_SGI62_ENV
-#include "../h/hashing.h"
+#include "h/hashing.h"
#endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
#include <netinet/in_var.h>
#endif /* ! AFS_HPUX110_ENV */
#endif /* !defined(UKERNEL) */
-#include "../afs/afsincludes.h" /* Afs-based standard headers */
-#include "../afs/afs_stats.h" /* afs statistics */
+#include "afsincludes.h" /* Afs-based standard headers */
+#include "afs/afs_stats.h" /* afs statistics */
#if defined(AFS_SUN56_ENV)
#include <inet/led.h>
#include <inet/common.h>
+#if defined(AFS_SUN58_ENV)
+#include <netinet/ip6.h>
+#endif
#include <inet/ip.h>
#endif
#include <sys/fp_io.h>
#endif
-extern struct volume *afs_volumes[NVOLS];
-
+#ifndef afs_cv2string
char *afs_cv2string(char *ttp, afs_uint32 aval)
{
register char *tp = ttp;
return tp;
} /*afs_cv2string*/
+#endif
+
+#ifndef afs_strcasecmp
+int afs_strcasecmp(char *s1, char *s2)
+{
+ while (*s1 && *s2) {
+ char c1, c2;
+
+ c1 = *s1++;
+ c2 = *s2++;
+ if (c1 >= 'A' && c1 <= 'Z') c1 += 0x20;
+ if (c2 >= 'A' && c2 <= 'Z') c2 += 0x20;
+ if (c1 != c2)
+ return c1-c2;
+ }
+
+ return *s1 - *s2;
+}
+#endif
+
+#ifndef afs_strcat
+char *afs_strcat(char *s1, char *s2)
+{
+ char *os1;
+
+ os1 = s1;
+ while (*s1++)
+ ;
+ --s1;
+ while ((*s1++ = *s2++))
+ ;
+ return (os1);
+}
+#endif
+
+#ifndef afs_strchr
+char *afs_strchr(char *s, int c)
+{
+ char *p;
+
+ for (p = s; *p; p++)
+ if (*p == c)
+ return p;
+ return NULL;
+}
+#endif
+
+char *afs_strdup(char *s)
+{
+ char *n;
+ int cc;
+
+ cc = strlen(s) + 1;
+ n = (char *) afs_osi_Alloc(cc);
+ if (n)
+ memcpy(n, s, cc);
+
+ return n;
+}
void print_internet_address(char *preamble, struct srvAddr *sa,
char *postamble, int flag)
* this code badly needs to be cleaned up... too many ugly ifdefs.
* XXX
*/
-extern afs_int32 afs_showflags;
-
-afs_warn(a,b,c,d,e,f,g,h,i,j)
+#if 0
+void afs_warn(char *a, long b, long c, long d, long e, long f,
+ long g, long h, long i, long j)
+#else
+void afs_warn(a,b,c,d,e,f,g,h,i,j)
char *a;
+#if defined( AFS_USE_VOID_PTR)
+void *b, *c, *d, *e, *f, *g, *h, *i, *j;
+#else
long b,c,d,e,f,g,h,i,j;
+#endif
+#endif
{
AFS_STATCNT(afs_warn);
}
}
-afs_warnuser(a,b,c,d,e,f,g,h,i,j)
+#if 0
+void afs_warnuser(char *a, long b, long c, long d, long e, long f,
+ long g, long h, long i, long j)
+#else
+void afs_warnuser(a,b,c,d,e,f,g,h,i,j)
char *a;
long b,c,d,e,f,g,h,i,j;
+#endif
{
AFS_STATCNT(afs_warnuser);
if (afs_showflags & GAGUSER)
/* run everywhere, checking locks */
-void afs_CheckLocks()
-
+void afs_CheckLocks(void)
{
- extern afs_rwlock_t afs_xconn, afs_xvolume, afs_xuser, afs_xcell;
- extern afs_rwlock_t afs_xserver;
- extern struct server *afs_servers[NSERVERS];
- extern struct unixuser *afs_users[NUSERS];
- extern unsigned char *afs_indexFlags;
register int i;
afs_warn("Looking for locked data structures.\n");
for(i=0;i<VCSIZE;i++) {
for(tvc = afs_vhashT[i]; tvc; tvc=tvc->hnext) {
#ifdef AFS_OSF_ENV
- if (tvc->vrefCount > 1)
+ if (VREFCOUNT(tvc) > 1)
#else /* AFS_OSF_ENV */
- if (tvc->vrefCount)
+ if (VREFCOUNT(tvc))
#endif
afs_warn("Stat cache entry at %x is held\n", tvc);
if (CheckLock(&tvc->lock))
}
-int afs_noop() {
+int afs_noop(void)
+{
AFS_STATCNT(afs_noop);
#ifdef AFS_OSF30_ENV
return (EOPNOTSUPP);
#endif
}
-int afs_badop() {
+int afs_badop(void)
+{
AFS_STATCNT(afs_badop);
osi_Panic("afs bad vnode op");
- return 0; /* make SGI C compiler happy */
+ return 0;
}
/*
* larger than an afs_int32.
*/
-afs_int32
-afs_data_pointer_to_int32(const void *p)
+afs_int32 afs_data_pointer_to_int32(const void *p)
{
union {
afs_int32 i32[sizeof(void *)/sizeof(afs_int32)];