2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Paweł Dziepak, pdziepak@quarnos.org
18 #define DNS_RESOLVER_MODULE_NAME "network/dns_resolver/v1"
21 struct dns_resolver_module
{
23 status_t (*getaddrinfo
)(const char* node
, const char* service
,
24 const struct addrinfo
* hints
, struct addrinfo
** res
);
29 kgetaddrinfo(const char* node
, const char* service
,
30 const struct addrinfo
* hints
, struct addrinfo
** res
)
32 dns_resolver_module
* dns
;
33 status_t result
= get_module(DNS_RESOLVER_MODULE_NAME
,
34 reinterpret_cast<module_info
**>(&dns
));
38 result
= dns
->getaddrinfo(node
, service
, hints
, res
);
40 put_module(DNS_RESOLVER_MODULE_NAME
);
47 kfreeaddrinfo(struct addrinfo
* res
)
53 #define getaddrinfo kgetaddrinfo
54 #define freeaddrinfo kfreeaddrinfo
57 #endif // DNS_RESOLVER_H