SCCS-vsn: lib/libc/net/SCCS/hosttable/gethostnamadr.c 4.10
SCCS-vsn: lib/libc/net/gethostnamadr.c 4.10
SCCS-vsn: lib/libc/net/res_init.c 4.3
SCCS-vsn: lib/libc/net/res_mkquery.c 4.4
SCCS-vsn: lib/libc/net/res_send.c 4.3
-/* gethostnamadr.c 4.9 85/03/25 */
+/* gethostnamadr.c 4.10 85/03/28 */
#include <stdio.h>
#include <netdb.h>
#include <stdio.h>
#include <netdb.h>
-/* gethostnamadr.c 4.9 85/03/25 */
+/* gethostnamadr.c 4.10 85/03/28 */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/socket.h>
char *eom, *bp, **ap;
int type, class, ancount, buflen;
char *eom, *bp, **ap;
int type, class, ancount, buflen;
- n = sendquery(msg, msglen, answer, sizeof(answer));
+ n = res_send(msg, msglen, answer, sizeof(answer));
if (n < 0) {
if (_res.options & RES_DEBUG)
if (n < 0) {
if (_res.options & RES_DEBUG)
- printf("sendquery failed\n");
+ printf("res_send failed\n");
return (NULL);
}
eom = answer + n;
return (NULL);
}
eom = answer + n;
- n = mkquery(QUERY, name, C_ANY, T_A, NULL, 0, NULL, hostbuf, sizeof(hostbuf));
+ n = res_mkquery(QUERY, name, C_ANY, T_A, NULL, 0, NULL,
+ hostbuf, sizeof(hostbuf));
if (n < 0) {
if (_res.options & RES_DEBUG)
if (n < 0) {
if (_res.options & RES_DEBUG)
- printf("mkquery failed\n");
+ printf("res_mkquery failed\n");
return (NULL);
}
return (getanswer(hostbuf, n, 0));
return (NULL);
}
return (getanswer(hostbuf, n, 0));
if (type != AF_INET)
return (NULL);
if (type != AF_INET)
return (NULL);
- n = mkquery(IQUERY, NULL, C_IN, T_A, addr, len, NULL, hostbuf, sizeof(hostbuf));
+ n = res_mkquery(IQUERY, NULL, C_IN, T_A, addr, len, NULL,
+ hostbuf, sizeof(hostbuf));
if (n < 0) {
if (_res.options & RES_DEBUG)
if (n < 0) {
if (_res.options & RES_DEBUG)
- printf("mkquery failed\n");
+ printf("res_mkquery failed\n");
return (NULL);
}
return (getanswer(hostbuf, n, 1));
return (NULL);
}
return (getanswer(hostbuf, n, 1));
-static char sccsid[] = "@(#)res_init.c 4.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_init.c 4.3 (Berkeley) %G%";
#endif
#include <sys/types.h>
#endif
#include <sys/types.h>
/* Allow user to override the local domain definition */
if ((cp = getenv("LOCALDOMAIN")) != NULL)
strncpy(_res.defdname, cp, sizeof(_res.defdname));
/* Allow user to override the local domain definition */
if ((cp = getenv("LOCALDOMAIN")) != NULL)
strncpy(_res.defdname, cp, sizeof(_res.defdname));
-/* res_mkquery.c 4.3 85/03/27 */
+/* res_mkquery.c 4.4 85/03/28 */
#include <stdio.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/types.h>
* Form all types of queries.
* Returns the size of the result or -1.
*/
* Form all types of queries.
* Returns the size of the result or -1.
*/
-mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
+res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
int op; /* opcode of query */
char *dname; /* domain name */
int class, type; /* class and type of query */
int op; /* opcode of query */
char *dname; /* domain name */
int class, type; /* class and type of query */
extern char *index();
if (_res.options & RES_DEBUG)
extern char *index();
if (_res.options & RES_DEBUG)
- printf("mkquery(%d, %s, %d, %d)\n", op, dname, class, type);
+ printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type);
/*
* Initialize header fields.
*/
/*
* Initialize header fields.
*/
-static char sccsid[] = "@(#)res_send.c 4.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_send.c 4.3 (Berkeley) %G%";
-sendquery(buf, buflen, answer, anslen)
+res_send(buf, buflen, answer, anslen)
char *buf;
int buflen;
char *answer;
char *buf;
int buflen;
char *answer;
HEADER *anhp = (HEADER *) answer;
if (_res.options & RES_DEBUG) {
HEADER *anhp = (HEADER *) answer;
if (_res.options & RES_DEBUG) {
- printf("sendquery()\n");
+ printf("res_send()\n");
- if (!(_res.options & RES_INIT)) {
- if (!res_init())
- return (-1);
- }
+ if (!(_res.options & RES_INIT))
+ res_init();
s = -1;
v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
id = hp->id;
s = -1;
v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;
id = hp->id;