pull-prototypes-to-head-20020821
[openafs.git] / src / afs / afs_conn.c
index 8fa1273..ee351bf 100644 (file)
@@ -42,33 +42,20 @@ RCSID("$Header$");
 #include <inet/ip.h>
 #endif
 
-/* Imported variables */
-/* these are for storing alternate interface addresses - from afs_callback.c */
-extern struct interfaceAddr afs_cb_interface;
-
-
-/* Imported functions. */
-struct rx_securityClass *rxnull_NewClientSecurityObject();
-struct rx_securityClass *rxkad_NewClientSecurityObject();
-
 /* Exported variables */
 afs_rwlock_t afs_xconn;                        /* allocation lock for new things */
 afs_rwlock_t afs_xinterface;           /* for multiple client address */
-
-/* Local variables */
-afs_int32 cryptall = 0;
+afs_int32 cryptall = 0;                        /* encrypt all communications */
 
 
 unsigned int VNOSERVERS = 0;
-struct conn *afs_Conn(afid, areq, locktype)
-    register struct VenusFid *afid;
-    register struct vrequest *areq;
-    afs_int32 locktype;
+struct conn *afs_Conn(register struct VenusFid *afid, 
+       register struct vrequest *areq, afs_int32 locktype)
 {
    u_short fsport=AFS_FSPORT;
    struct volume *tv;
-   struct conn *tconn = (struct conn *)0;
-   struct srvAddr *lowp= (struct srvAddr *)0;
+   struct conn *tconn = NULL;
+   struct srvAddr *lowp= NULL;
    struct unixuser *tu;
    int notbusy;
    int i;
@@ -81,7 +68,7 @@ struct conn *afs_Conn(afid, areq, locktype)
         afs_FinalizeReq(areq);
         areq->volumeError = 1;
       }
-      return (struct conn *) 0;
+      return NULL;
    }
 
    if (tv->serverHost[0] && tv->serverHost[0]->cell) {
@@ -148,7 +135,7 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
 
     if (!sap || ((sap->sa_flags & SRVR_ISDOWN) && !force_if_down)) {
        /* sa is known down, and we don't want to force it.  */
-       return (struct conn *)0;
+       return NULL;
     }
 
     ObtainSharedLock(&afs_xconn,15);
@@ -160,7 +147,7 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
 
     if (!tc && !create) {
        ReleaseSharedLock(&afs_xconn);
-       return (struct conn *)0;
+       return NULL;
     }
 
     if (!tc) {
@@ -262,15 +249,9 @@ struct conn *afs_ConnBySA(struct srvAddr *sap, unsigned short aport,
  * Having force... true and UTokensBad true simultaneously means that the tokens
  * went bad and we're supposed to create a new, unauthenticated, connection.
  */
-struct conn *afs_ConnByHost(aserver, aport, acell, areq, aforce, locktype)
-    struct server *aserver;
-    afs_int32 acell;
-    unsigned short aport;
-    struct vrequest *areq;
-    int aforce;
-    afs_int32 locktype;
-{ /*afs_ConnByHost*/
-
+struct conn *afs_ConnByHost(struct server *aserver, unsigned short aport, 
+       afs_int32 acell, struct vrequest *areq, int aforce, afs_int32 locktype)
+{
     struct unixuser *tu;
     struct conn *tc=0;
     struct srvAddr *sa=0;
@@ -308,12 +289,8 @@ struct conn *afs_ConnByHost(aserver, aport, acell, areq, aforce, locktype)
 } /*afs_ConnByHost*/
 
 
-struct conn *afs_ConnByMHosts(ahosts, aport, acell, areq, locktype)
-    struct server *ahosts[];
-    afs_int32 acell;
-    unsigned short aport;
-    register struct vrequest *areq;
-    afs_int32 locktype;
+struct conn *afs_ConnByMHosts(struct server *ahosts[], unsigned short aport,   
+       afs_int32 acell, register struct vrequest *areq, afs_int32 locktype)
 {
     register afs_int32 i;
     register struct conn *tconn;
@@ -322,21 +299,19 @@ struct conn *afs_ConnByMHosts(ahosts, aport, acell, areq, locktype)
     /* try to find any connection from the set */
     AFS_STATCNT(afs_ConnByMHosts);
     for (i=0;i<MAXCELLHOSTS;i++) {
-       if ((ts = ahosts[i]) == (struct server *) 0) break;
+       if ((ts = ahosts[i]) == NULL) break;
        tconn = afs_ConnByHost(ts, aport, acell, 
                               areq, 0, locktype);
        if (tconn) {
           return tconn;
        }
     }
-    return (struct conn *) 0;
+    return NULL;
 
 } /*afs_ConnByMHosts*/
 
 
-void afs_PutConn(ac, locktype)
-    register struct conn *ac;
-    afs_int32 locktype;
+void afs_PutConn(register struct conn *ac, afs_int32 locktype)
 {
     AFS_STATCNT(afs_PutConn);
     ac->refCount--;
@@ -347,8 +322,7 @@ void afs_PutConn(ac, locktype)
 client network interface going down. We need to reopen new 
 connections in this case
 */
-ForceNewConnections(sap)
-struct srvAddr *sap;
+void ForceNewConnections(struct srvAddr *sap)
 {
        struct conn *tc=0;