summaryrefslogtreecommitdiff
path: root/include/libHX/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libHX/socket.h')
-rw-r--r--include/libHX/socket.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/libHX/socket.h b/include/libHX/socket.h
new file mode 100644
index 0000000..e9db77f
--- /dev/null
+++ b/include/libHX/socket.h
@@ -0,0 +1,23 @@
+#ifndef _LIBHX_SOCKET_H
+#define _LIBHX_SOCKET_H 1
+
+#ifdef _WIN32
+# include <ws2tcpip.h>
+#else
+# include <netdb.h>
+# include <sys/socket.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int HX_socket_from_env(const struct addrinfo *, const char *intf);
+extern int HX_sockaddr_is_local(const struct sockaddr *, socklen_t, unsigned int flags);
+extern int HX_ipaddr_is_local(const char *, unsigned int flags);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _LIBHX_SOCKET_H */