#include "cellconfig.h"
#include "keys.h"
-#ifdef AFS_DNS
-#include "DNS_AFS.h"
-#endif /* AFS_DNS */
-
static ParseHostLine();
static ParseCellLine();
static afsconf_OpenInternal();
int cnLen, ambig;
char tbuffer[64];
-#ifdef AFS_DNS
- /////////////////////////////////////////////
- //TRY A DNS QUERY FOR THAT CELL FIRST!
-
- struct afsconf_entry DNSce;
- char *DNStmpStrp; /* a temp string pointer */
- struct hostent *thp;
-
-
- DNSce.cellInfo.numServers=0;
- DNSce.next = NULL;
- DNStmpStrp = getAFSServer(acellName);
- while(DNStmpStrp != NULL) {
- strcpy(DNSce.cellInfo.hostName[DNSce.cellInfo.numServers],DNStmpStrp);
- thp = gethostbyname(DNStmpStrp);
- if (!thp)
- thp = DNSgetHostByName(DNStmpStrp);
- if (thp) {
- memcpy(&DNSce.cellInfo.hostAddr[DNSce.cellInfo.numServers].sin_addr.s_addr, thp->h_addr,
- sizeof(long));
- DNSce.cellInfo.hostAddr[DNSce.cellInfo.numServers].sin_family = AF_INET;
- /* sin_port supplied by connection code */
- }
- DNSce.cellInfo.numServers++; /* add the server to the VLDB server list */
- DNStmpStrp = getAFSServer(acellName);
- };
-
- if (DNSce.cellInfo.numServers>0) {
- strcpy(&(DNSce.cellInfo.name),acellName);
- *acellInfo = DNSce.cellInfo; /* structure assignment */
- if (aservice) {
- LOCK_GLOBAL_MUTEX
- tservice = afsconf_FindService(aservice);
- UNLOCK_GLOBAL_MUTEX
- if (tservice < 0) {
- return AFSCONF_NOTFOUND; /* service not found */
- }
- for(i=0;i<acellInfo->numServers;i++) {
- acellInfo->hostAddr[i].sin_port = tservice;
- }
- };
- return 0;
- };
- /////////////////////////////////////////////
-#endif /* AFS_DNS */
-
-
LOCK_GLOBAL_MUTEX
if (adir) afsconf_Check(adir);
if (acellName) {