1/* $FreeBSD: head/lib/libc/net/getaddrinfo.c 78012 2001-06-10 20:25:24Z ume $ */ |
2/* $KAME: getaddrinfo.c,v 1.15 2000/07/09 04:37:24 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 64 unchanged lines hidden (view full) --- 74 * This would result in a bit of code duplicate with _dns_ghbyname() and 75 * friends. 76 */ 77/* 78 * diffs with other KAME platforms: 79 * - other KAME platforms already nuked FAITH ($GAI), but as FreeBSD 80 * 4.0-RELEASE supplies it, we still have the code here. 81 * - AI_ADDRCONFIG support is supplied |
82 * - some of FreeBSD style (#define tabify and others) 83 * - classful IPv4 numeric (127.1) is allowed. 84 */ 85 86#include "namespace.h" 87#include <sys/types.h> 88#include <sys/param.h> 89#include <sys/socket.h> --- 5 unchanged lines hidden (view full) --- 95#include <resolv.h> 96#include <string.h> 97#include <stdlib.h> 98#include <stddef.h> 99#include <ctype.h> 100#include <unistd.h> 101#include <stdio.h> 102#include <errno.h> |
103#ifdef DEBUG 104#include <syslog.h> 105#endif |
106 107#include <syslog.h> 108#include <stdarg.h> 109#include <nsswitch.h> 110#include "un-namespace.h" 111 112#if defined(__KAME__) && defined(INET6) 113# define FAITH --- 1601 unchanged lines hidden (view full) --- 1715 anslen = t->anslen; 1716#ifdef DEBUG 1717 if (_res.options & RES_DEBUG) 1718 printf(";; res_query(%s, %d, %d)\n", name, class, type); 1719#endif 1720 1721 n = res_mkquery(QUERY, name, class, type, NULL, 0, NULL, 1722 buf, sizeof(buf)); |
1723 if (n > 0 && (_res.options & RES_USE_EDNS0) != 0) 1724 n = res_opt(n, buf, sizeof(buf), anslen); |
1725 if (n <= 0) { 1726#ifdef DEBUG 1727 if (_res.options & RES_DEBUG) 1728 printf(";; res_query: mkquery failed\n"); 1729#endif 1730 h_errno = NO_RECOVERY; 1731 return (n); 1732 } --- 239 unchanged lines hidden --- |