2021-03-09 22:24:35 +00:00
|
|
|
#pragma once
|
2018-07-30 04:38:14 +00:00
|
|
|
#if defined(_WIN32) || defined(__MINGW32__)
|
2018-07-25 00:39:52 +00:00
|
|
|
#include <winsock2.h>
|
2023-10-24 13:18:03 +00:00
|
|
|
|
2018-07-25 00:39:52 +00:00
|
|
|
#include <ws2tcpip.h>
|
2018-11-19 07:55:19 +00:00
|
|
|
#include <wspiapi.h>
|
|
|
|
// because this shit is not defined for Windows NT reeeee
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
#if _WIN32_WINNT < 0x600
|
|
|
|
const char*
|
|
|
|
inet_ntop(int af, const void* src, char* dst, size_t size);
|
|
|
|
int
|
|
|
|
inet_pton(int af, const char* src, void* dst);
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2018-07-30 04:38:14 +00:00
|
|
|
typedef unsigned short in_port_t;
|
|
|
|
typedef unsigned int in_addr_t;
|
2018-07-25 00:39:52 +00:00
|
|
|
#else
|
2018-05-22 15:54:19 +00:00
|
|
|
#include <arpa/inet.h>
|
2018-01-08 13:49:05 +00:00
|
|
|
#include <netinet/in.h>
|
2018-07-25 00:42:14 +00:00
|
|
|
#include <sys/socket.h>
|
2018-07-25 00:39:52 +00:00
|
|
|
#endif
|
2019-07-30 23:42:13 +00:00
|
|
|
|
2019-08-26 13:44:01 +00:00
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdbool.h>
|
|
|
|
#endif
|
|
|
|
|
2018-01-29 14:27:24 +00:00
|
|
|
#include <sys/types.h>
|
2018-01-08 13:49:05 +00:00
|
|
|
|
2018-05-22 15:54:19 +00:00
|
|
|
bool
|
|
|
|
llarp_getifaddr(const char* ifname, int af, struct sockaddr* addr);
|