35 lines
799 B
C
35 lines
799 B
C
// POSIX name-resolution declarations supported by nt-lite.
|
|
|
|
#pragma once
|
|
|
|
#include <sys/socket.h>
|
|
#include <ntlite_posix_api.h>
|
|
|
|
struct hostent {
|
|
char* h_name;
|
|
char** h_aliases;
|
|
int h_addrtype;
|
|
int h_length;
|
|
char** h_addr_list;
|
|
};
|
|
|
|
#define h_addr h_addr_list[0]
|
|
|
|
struct addrinfo {
|
|
int ai_flags;
|
|
int ai_family;
|
|
int ai_socktype;
|
|
int ai_protocol;
|
|
socklen_t ai_addrlen;
|
|
struct sockaddr* ai_addr;
|
|
char* ai_canonname;
|
|
struct addrinfo* ai_next;
|
|
};
|
|
|
|
#define AI_PASSIVE 0x0001
|
|
|
|
NTL_POSIX_API struct hostent* gethostbyname(const char* name);
|
|
NTL_POSIX_API int getaddrinfo(const char* node, const char* service,
|
|
const struct addrinfo* hints, struct addrinfo** result);
|
|
NTL_POSIX_API void freeaddrinfo(struct addrinfo* result);
|