mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-29 11:05:43 +00:00
04e620ebf2
msys2 grabs its reactos sdk headers straight out of git most cross-compilers use the versioned releases (v6 as of last week) huh. for once setting the windows version macros doesn't break anything.
35 lines
713 B
C
35 lines
713 B
C
#ifndef LLARP_NET_H
|
|
#define LLARP_NET_H
|
|
#if defined(_WIN32) || defined(__MINGW32__)
|
|
#include <winsock2.h>
|
|
#include <ws2tcpip.h>
|
|
#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
|
|
typedef unsigned short in_port_t;
|
|
typedef unsigned int in_addr_t;
|
|
#else
|
|
#include <arpa/inet.h>
|
|
#include <netinet/in.h>
|
|
#include <sys/socket.h>
|
|
#endif
|
|
#include <stdbool.h>
|
|
#include <sys/types.h>
|
|
|
|
bool
|
|
llarp_getifaddr(const char* ifname, int af, struct sockaddr* addr);
|
|
|
|
#endif
|