extern afs_int32 afs_mariner, afs_marinerHost;
extern struct srvAddr *afs_srvAddrs[NSERVERS];
extern int afs_resourceinit_flag;
+extern afs_int32 cryptall;
static int PBogus(), PSetAcl(), PGetAcl(), PSetTokens(), PGetVolumeStatus();
static int PSetVolumeStatus(), PFlush(), PNewStatMount(), PGetTokens(), PUnlog();
static int PSetSPrefs33(), PStoreBehind(), PGCPAGs();
static int PGetCPrefs(), PSetCPrefs(); /* client network addresses */
static int PGetInitParams(), PFlushMount(), PRxStatProc(), PRxStatPeer();
+static int PGetRxkcrypt(), PSetRxkcrypt();
int PExportAfs();
static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCRED **acred, struct AFS_UCRED *credp);
PFlushMount, /* 52 - flush mount symlink data */
PRxStatProc, /* 53 - control process RX statistics */
PRxStatPeer, /* 54 - control peer RX statistics */
+ PGetRxkcrypt, /* 55 -- Get rxkad encryption flag */
+ PSetRxkcrypt, /* 56 -- Set rxkad encryption flag */
+ PNoop, /* 57 -- arla: set file prio */
+ PNoop, /* 58 -- arla: fallback getfh */
+ PNoop, /* 59 -- arla: fallback fhopen */
+ PNoop, /* 60 -- arla: controls xfsdebug */
+ PNoop, /* 61 -- arla: controls arla debug */
+ PNoop, /* 62 -- arla: debug interface */
+ PNoop, /* 63 -- arla: print xfs status */
+ PNoop, /* 64 -- arla: force cache check */
+ PNoop, /* 65 -- arla: break callback */
};
#define PSetClientContext 99 /* Special pioctl to setup caller's creds */
return cr;
}
#endif
+
+static int
+PGetRxkcrypt(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
+struct vcache *avc;
+int afun;
+struct vrequest *areq;
+char *ain, *aout;
+afs_int32 ainSize;
+afs_int32 *aoutSize;
+struct AFS_UCRED *acred;
+{
+ bcopy((char *)&cryptall, aout, sizeof(afs_int32));
+ *aoutSize=sizeof(afs_int32);
+ return 0;
+}
+
+static int
+PSetRxkcrypt(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
+struct vcache *avc;
+int afun;
+struct vrequest *areq;
+char *ain, *aout;
+afs_int32 ainSize;
+afs_int32 *aoutSize;
+struct AFS_UCRED *acred;
+{
+ afs_int32 tmpval;
+
+ if (!afs_osi_suser(acred))
+ return EPERM;
+ if (ainSize != sizeof(afs_int32) || ain == NULL)
+ return EINVAL;
+ bcopy(ain, (char *)&tmpval, sizeof(afs_int32));
+ /* if new mappings added later this will need to be changed */
+ if (tmpval != 0 && tmpval != 1)
+ return EINVAL;
+ cryptall = tmpval;
+ return 0;
+}
+
/*
* Create new credentials to correspond to a remote user with given
* <hostaddr, uid, g0, g1>. This allows a server running as root to
#else
osi_GetTime(&tv);
#endif
- /* *Slightly* random start time for the cid. This is just to help
- * out with the hashing function at the peer */
- rx_port = port;
+ if (port) {
+ rx_port = port;
+ } else {
+#if defined(KERNEL) && !defined(UKERNEL)
+ /* Really, this should never happen in a real kernel */
+ rx_port = 0;
+#else
+ struct sockaddr_in addr;
+ int addrlen = sizeof(addr);
+ if (getsockname(rx_socket, (struct sockaddr *) &addr, &addrlen)) {
+ rx_Finalize();
+ return -1;
+ }
+ rx_port = addr.sin_port;
+#endif
+ }
rx_stats.minRtt.sec = 9999999;
#ifdef KERNEL
rx_SetEpoch (tv.tv_sec | 0x80000000);
MUTEX_ENTER(&rx_stats_mutex);
rxi_dataQuota += rx_extraQuota; /* + extra pkts caller asked to rsrv */
MUTEX_EXIT(&rx_stats_mutex);
+ /* *Slightly* random start time for the cid. This is just to help
+ * out with the hashing function at the peer */
rx_nextCid = ((tv.tv_sec ^ tv.tv_usec) << RX_CIDSHIFT);
rx_connHashTable = (struct rx_connection **) htable;
rx_peerHashTable = (struct rx_peer **) ptable;