]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
discon-20060714
authorJim Rees <rees@umich.edu>
Fri, 14 Jul 2006 18:48:18 +0000 (18:48 +0000)
committerJim Rees <rees@umich.edu>
Fri, 14 Jul 2006 18:48:18 +0000 (18:48 +0000)
Implement PDiscon. Right now only sets nat mode. Untested.

src/afs/afs_pioctl.c
src/afs/afs_prototypes.h

index 2c4599b4c78c471e7b48c033e2ea84dfcfeaebe7..d7a6a0b6e48e836ed51eb3b12978d758a4e4ec2c 100644 (file)
@@ -90,6 +90,7 @@ DECL_PIOCTL(PRxStatPeer);
 DECL_PIOCTL(PPrefetchFromTape);
 DECL_PIOCTL(PResidencyCmd);
 DECL_PIOCTL(PCallBackAddr);
+DECL_PIOCTL(PDiscon);
 
 /*
  * A macro that says whether we're going to need HandleClientContext().
@@ -192,6 +193,8 @@ static int (*(CpioctlSw[])) () = {
        PNewAlias,              /* 1 -- create new cell alias */
        PListAliases,           /* 2 -- list cell aliases */
        PCallBackAddr,          /* 3 -- request addr for callback rxcon */
+       PBogus,                 /* 4 */
+       PDiscon,                /* 5 -- get/set discon mode */
 };
 
 #define PSetClientContext 99   /*  Special pioctl to setup caller's creds  */
@@ -3967,3 +3970,26 @@ DECL_PIOCTL(PCallBackAddr)
 #endif /* UKERNEL */
     return 0;
 }
+
+DECL_PIOCTL(PDiscon)
+{
+#ifdef AFS_DISCON_ENV
+    static afs_int32 mode;
+
+    if (ainSize == sizeof(afs_int32)) {
+       memcpy(&mode, ain, sizeof(afs_int32));
+
+       /* 3 is magic, should be a #define. */
+       afs_SetCheckServerNATmode(mode == 3);
+    } else if (ainSize != 0) {
+       return EINVAL;
+    }
+
+    /* Return new mode */
+    memcpy(aout, &mode, sizeof(afs_int32));
+    *aoutSize = sizeof(struct VenusFid);
+    return 0;
+#else
+    return EINVAL;
+#endif
+}
index 25762d19c3155c5119bafed3b5a938e8e88fdd0e..1db40fe163365249358009e99e6f3cb0d95c4bce 100644 (file)
@@ -277,6 +277,7 @@ extern struct brequest *afs_BQueue(register short aopcode,
                                   struct AFS_UCRED *acred,
                                   afs_size_t asparm0, afs_size_t asparm1,
                                   void *apparm0);
+extern void afs_SetCheckServerNATmode(int isnat);
 extern void afs_CheckServerDaemon(void);
 extern int afs_CheckRootVolume(void);
 extern void afs_BRelease(register struct brequest *ab);