+
+#ifdef BOMBPROOFING
+static
+struct hostent *
+_oldgethostbyname(name)
+ register char *name;
+{
+ register struct hostent *hp;
+ register char **cp;
+ datum key;
+
+ if ((_host_db == (DBM *)NULL)
+ && ((_host_db = dbm_open(_host_file, O_RDONLY)) == (DBM *)NULL)) {
+ sethostent(_host_stayopen);
+ while (hp = gethostent()) {
+ if (strcmp(hp->h_name, nam) == 0)
+ break;
+ for (cp = hp->h_aliases; cp != 0 && *cp != 0; cp++)
+ if (strcmp(*cp, nam) == 0)
+ goto found;
+ }
+ found:
+ if (!_host_stayopen)
+ endhostent();
+ return (hp);
+ }
+ key.dptr = nam;
+ key.dsize = strlen(nam);
+ hp = fetchhost(key);
+ if (!_host_stayopen) {
+ dbm_close(_host_db);
+ _host_db = (DBM *)NULL;
+ }
+ return (hp);
+}
+
+
+static
+struct hostent *
+_oldgethostbyaddr(addr, len, type)
+ char *addr;
+ register int len, type;
+{
+
+ register struct hostent *hp;
+ datum key;
+
+ if ((_host_db == (DBM *)NULL)
+ && ((_host_db = dbm_open(_host_file, O_RDONLY)) == (DBM *)NULL)) {
+ sethostent(_host_stayopen);
+ while (hp = gethostent()) {
+ if (hp->h_addrtype == type && hp->h_length == length
+ && bcmp(hp->h_addr, addr, length) == 0)
+ break;
+ }
+ if (!_host_stayopen)
+ endhostent();
+ return (hp);
+ }
+ key.dptr = addr;
+ key.dsize = length;
+ hp = fetchhost(key);
+ if (!_host_stayopen) {
+ dbm_close(_host_db);
+ _host_db = (DBM *)NULL;
+ }
+ return (hp);
+}
+#endif BOMBPROOFING
+