2015-05-01 16:19:52 +08:00
|
|
|
/*
|
2021-03-08 18:19:04 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2015-05-01 16:19:52 +08:00
|
|
|
*
|
2018-10-15 01:23:33 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2015-05-01 16:19:52 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2015-02-17 Bernard First version
|
2018-07-17 20:29:33 +08:00
|
|
|
* 2108-05-24 ChenYong Add socket abstraction layer
|
2015-05-01 16:19:52 +08:00
|
|
|
*/
|
|
|
|
|
2021-09-11 11:07:51 +08:00
|
|
|
#include <stddef.h>
|
2018-07-17 20:29:33 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
#include <netdb.h>
|
2015-05-01 16:19:52 +08:00
|
|
|
|
|
|
|
struct hostent *gethostbyname(const char *name)
|
|
|
|
{
|
2018-07-17 20:29:33 +08:00
|
|
|
return sal_gethostbyname(name);
|
2015-05-01 16:19:52 +08:00
|
|
|
}
|
2015-10-11 15:38:35 +08:00
|
|
|
RTM_EXPORT(gethostbyname);
|
2015-05-01 16:19:52 +08:00
|
|
|
|
|
|
|
int gethostbyname_r(const char *name, struct hostent *ret, char *buf,
|
|
|
|
size_t buflen, struct hostent **result, int *h_errnop)
|
|
|
|
{
|
2018-07-17 20:29:33 +08:00
|
|
|
return sal_gethostbyname_r(name, ret, buf, buflen, result, h_errnop);
|
2015-05-01 16:19:52 +08:00
|
|
|
}
|
2018-08-24 20:39:10 +08:00
|
|
|
RTM_EXPORT(gethostbyname_r);
|
2015-05-01 16:19:52 +08:00
|
|
|
|
|
|
|
void freeaddrinfo(struct addrinfo *ai)
|
|
|
|
{
|
2018-07-17 20:29:33 +08:00
|
|
|
sal_freeaddrinfo(ai);
|
2015-05-01 16:19:52 +08:00
|
|
|
}
|
2015-10-11 15:38:35 +08:00
|
|
|
RTM_EXPORT(freeaddrinfo);
|
2015-05-01 16:19:52 +08:00
|
|
|
|
|
|
|
int getaddrinfo(const char *nodename,
|
|
|
|
const char *servname,
|
|
|
|
const struct addrinfo *hints,
|
|
|
|
struct addrinfo **res)
|
|
|
|
{
|
2018-07-17 20:29:33 +08:00
|
|
|
return sal_getaddrinfo(nodename, servname, hints, res);
|
2015-05-01 16:19:52 +08:00
|
|
|
}
|
2015-10-11 15:38:35 +08:00
|
|
|
RTM_EXPORT(getaddrinfo);
|