Remove support for Solaris pre-8
[openafs.git] / src / afs / afs_analyze.c
index 1834e6d..220311e 100644 (file)
 #include "afs/afs_util.h"
 #include "afs/unified_afs.h"
 
-#if    defined(AFS_SUN56_ENV)
+#if    defined(AFS_SUN5_ENV)
 #include <inet/led.h>
 #include <inet/common.h>
-#if     defined(AFS_SUN58_ENV)
 #include <netinet/ip6.h>
-#endif
 #include <inet/ip.h>
 #endif
 
-
 /* shouldn't do it this way, but for now will do */
 #ifndef ERROR_TABLE_BASE_U
 #define ERROR_TABLE_BASE_U     (5376L)
@@ -103,6 +100,7 @@ VLDB_Same(struct VenusFid *afid, struct vrequest *areq)
     char *bp, tbuf[CVBS];      /* biggest volume id is 2^32, ~ 4*10^9 */
     unsigned int changed;
     struct server *(oldhosts[NMAXNSERVERS]);
+    struct rx_connection *rxconn;
 
     AFS_STATCNT(CheckVLDB);
     afs_FinalizeReq(areq);
@@ -110,51 +108,52 @@ VLDB_Same(struct VenusFid *afid, struct vrequest *areq)
     if ((i = afs_InitReq(&treq, afs_osi_credp)))
        return DUNNO;
     v = afs_osi_Alloc(sizeof(*v));
+    osi_Assert(v != NULL);
     tcell = afs_GetCell(afid->Cell, READ_LOCK);
     bp = afs_cv2string(&tbuf[CVBS], afid->Fid.Volume);
     do {
        VSleep(2);              /* Better safe than sorry. */
        tconn =
            afs_ConnByMHosts(tcell->cellHosts, tcell->vlport, tcell->cellNum,
-                            &treq, SHARED_LOCK);
+                            &treq, SHARED_LOCK, &rxconn);
        if (tconn) {
-           if (tconn->srvr->server->flags & SNO_LHOSTS) {
+           if ( tconn->parent->srvr->server->flags & SNO_LHOSTS) {
                type = 0;
                RX_AFS_GUNLOCK();
-               i = VL_GetEntryByNameO(tconn->id, bp, &v->tve);
+               i = VL_GetEntryByNameO(rxconn, bp, &v->tve);
                RX_AFS_GLOCK();
-           } else if (tconn->srvr->server->flags & SYES_LHOSTS) {
+           } else if (tconn->parent->srvr->server->flags & SYES_LHOSTS) {
                type = 1;
                RX_AFS_GUNLOCK();
-               i = VL_GetEntryByNameN(tconn->id, bp, &v->ntve);
+               i = VL_GetEntryByNameN(rxconn, bp, &v->ntve);
                RX_AFS_GLOCK();
            } else {
                type = 2;
                RX_AFS_GUNLOCK();
-               i = VL_GetEntryByNameU(tconn->id, bp, &v->utve);
+               i = VL_GetEntryByNameU(rxconn, bp, &v->utve);
                RX_AFS_GLOCK();
-               if (!(tconn->srvr->server->flags & SVLSRV_UUID)) {
+               if (!(tconn->parent->srvr->server->flags & SVLSRV_UUID)) {
                    if (i == RXGEN_OPCODE) {
                        type = 1;
                        RX_AFS_GUNLOCK();
-                       i = VL_GetEntryByNameN(tconn->id, bp, &v->ntve);
+                       i = VL_GetEntryByNameN(rxconn, bp, &v->ntve);
                        RX_AFS_GLOCK();
                        if (i == RXGEN_OPCODE) {
                            type = 0;
-                           tconn->srvr->server->flags |= SNO_LHOSTS;
+                           tconn->parent->srvr->server->flags |= SNO_LHOSTS;
                            RX_AFS_GUNLOCK();
-                           i = VL_GetEntryByNameO(tconn->id, bp, &v->tve);
+                           i = VL_GetEntryByNameO(rxconn, bp, &v->tve);
                            RX_AFS_GLOCK();
                        } else if (!i)
-                           tconn->srvr->server->flags |= SYES_LHOSTS;
+                           tconn->parent->srvr->server->flags |= SYES_LHOSTS;
                    } else if (!i)
-                       tconn->srvr->server->flags |= SVLSRV_UUID;
+                       tconn->parent->srvr->server->flags |= SVLSRV_UUID;
                }
                lastcode = i;
            }
        } else
            i = -1;
-    } while (afs_Analyze(tconn, i, NULL, &treq, -1,    /* no op code for this */
+    } while (afs_Analyze(tconn, rxconn, i, NULL, &treq, -1,    /* no op code for this */
                         SHARED_LOCK, tcell));
 
     afs_PutCell(tcell, READ_LOCK);
@@ -305,9 +304,9 @@ afs_BlackListOnce(struct vrequest *areq, struct VenusFid *afid,
  *     if this is a temporary or permanent error.
  *------------------------------------------------------------------------*/
 int
-afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
-           struct VenusFid *afid, struct vrequest *areq, int op,
-           afs_int32 locktype, struct cell *cellp)
+afs_Analyze(struct afs_conn *aconn, struct rx_connection *rxconn,
+            afs_int32 acode, struct VenusFid *afid, struct vrequest *areq,
+            int op, afs_int32 locktype, struct cell *cellp)
 {
     afs_int32 i;
     struct srvAddr *sa;
@@ -328,7 +327,7 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
        if (aconn) {
            /* SXW - I suspect that this will _never_ happen - we shouldn't
             *       get a connection because we're disconnected !!!*/
-           afs_PutConn(aconn, locktype);
+           afs_PutConn(aconn, rxconn, locktype);
        }
        return 0;
     }
@@ -382,7 +381,7 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
        return shouldRetry;     /* should retry */
     }
 
-    if (!aconn || !aconn->srvr) {
+    if (!aconn || !aconn->parent->srvr) {
        if (!areq->volumeError) {
            if (aerrP)
                (aerrP->err_Network)++;
@@ -424,7 +423,7 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
     }
 
     /* Find server associated with this connection. */
-    sa = aconn->srvr;
+    sa = aconn->parent->srvr;
     tsp = sa->server;
     address = ntohl(sa->sa_ip);
 
@@ -447,7 +446,7 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
            }
        }
 
-       afs_PutConn(aconn, locktype);
+       afs_PutConn(aconn, rxconn, locktype);
        return 0;
     }
 
@@ -541,11 +540,11 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
                aconn->forceConnectFS = 1;
            } else if (acode == RXKADEXPIRED) {
                aconn->forceConnectFS = 0;      /* don't check until new tokens set */
-               aconn->user->states |= UTokensBad;
+               aconn->parent->user->states |= UTokensBad;
                afs_NotifyUser(tu, UTokensDropped);
                afs_warnuser
                    ("afs: Tokens for user of AFS id %d for cell %s have expired (server %d.%d.%d.%d)\n",
-                    tu->vid, aconn->srvr->server->cell->cellName,
+                    tu->viceId, aconn->parent->srvr->server->cell->cellName,
                     (address >> 24), (address >> 16) & 0xff,
                     (address >> 8) & 0xff, (address) & 0xff);
            } else {
@@ -555,18 +554,18 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
                if (serversleft) {
                    afs_warnuser
                        ("afs: Tokens for user of AFS id %d for cell %s: rxkad error=%d (server %d.%d.%d.%d)\n",
-                        tu->vid, aconn->srvr->server->cell->cellName, acode,
+                        tu->viceId, aconn->parent->srvr->server->cell->cellName, acode,
                         (address >> 24), (address >> 16) & 0xff,
                         (address >> 8) & 0xff, (address) & 0xff);
                    shouldRetry = 1;
                } else {
                    areq->tokenError = 0;
                    aconn->forceConnectFS = 0;  /* don't check until new tokens set */
-                   aconn->user->states |= UTokensBad;
+                   aconn->parent->user->states |= UTokensBad;
                    afs_NotifyUser(tu, UTokensDropped);
                    afs_warnuser
                        ("afs: Tokens for user of AFS id %d for cell %s are discarded (rxkad error=%d, server %d.%d.%d.%d)\n",
-                        tu->vid, aconn->srvr->server->cell->cellName, acode,
+                        tu->viceId, aconn->parent->srvr->server->cell->cellName, acode,
                         (address >> 24), (address >> 16) & 0xff,
                         (address >> 8) & 0xff, (address) & 0xff);
                }
@@ -578,20 +577,21 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
                aconn->forceConnectFS = 1;
            } else if (acode == RXKADEXPIRED) {
                aconn->forceConnectFS = 0;      /* don't check until new tokens set */
-               aconn->user->states |= UTokensBad;
+               aconn->parent->user->states |= UTokensBad;
                afs_NotifyUser(tu, UTokensDropped);
                afs_warnuser
                    ("afs: Tokens for user %d for cell %s have expired (server %d.%d.%d.%d)\n",
-                    areq->uid, aconn->srvr->server->cell->cellName,
+                    areq->uid, aconn->parent->srvr->server->cell->cellName,
                     (address >> 24), (address >> 16) & 0xff,
                     (address >> 8) & 0xff, (address) & 0xff);
            } else {
                aconn->forceConnectFS = 0;      /* don't check until new tokens set */
-               aconn->user->states |= UTokensBad;
+               aconn->parent->user->states |= UTokensBad;
                afs_NotifyUser(tu, UTokensDropped);
                afs_warnuser
                    ("afs: Tokens for user %d for cell %s are discarded (rxkad error = %d, server %d.%d.%d.%d)\n",
-                    areq->uid, aconn->srvr->server->cell->cellName, acode,
+                    areq->uid, aconn->parent->srvr->server->cell->cellName,
+                     acode,
                     (address >> 24), (address >> 16) & 0xff,
                     (address >> 8) & 0xff, (address) & 0xff);
 
@@ -679,6 +679,6 @@ afs_Analyze(struct afs_conn *aconn, afs_int32 acode,
     }
 out:
     /* now unlock the connection and return */
-    afs_PutConn(aconn, locktype);
+    afs_PutConn(aconn, rxconn, locktype);
     return (shouldRetry);
 }                              /*afs_Analyze */