summaryrefslogtreecommitdiff
path: root/src/headers/ip46-with
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-09-18 18:55:44 +0000
commit3534b428629be185e096be99e3bd5fdfe32d5544 (patch)
tree210ef3198ed66bc7f7b7bf6a85e4579f455e5a36 /src/headers/ip46-with
downloadskalibs-3534b428629be185e096be99e3bd5fdfe32d5544.tar.xz
initial commit with rc for skalibs-2.0.0.0
Diffstat (limited to 'src/headers/ip46-with')
-rw-r--r--src/headers/ip46-with24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/headers/ip46-with b/src/headers/ip46-with
new file mode 100644
index 0000000..0cd3d19
--- /dev/null
+++ b/src/headers/ip46-with
@@ -0,0 +1,24 @@
+typedef ip46full_t ip46_t, *ip46_t_ref ;
+#define IP46_ZERO IP46FULL_ZERO
+
+#define SKALIBS_IPV6_ENABLED
+#define SKALIBS_IP_SIZE 16
+#define ip46_is6(i) ip46full_is6(i)
+#define ip46_fmt(s, i) ip46full_fmt(s, i)
+#define ip46_scan(s, i) ip46full_scan(s, i)
+#define ip46_scanlist(out, max, s, num) ip46full_scanlist(out, max, s, num)
+#define ip46_from_ip4(i, ip4) (ip46full_from_ip4(i, ip4), 1)
+#define ip46_from_ip6(i, ip6) (ip46full_from_ip6(i, ip6), 1)
+
+#define socket_connect46(s, i, port) ((i)->is6 ? socket_connect6(s, (i)->ip, port) : socket_connect4(s, (i)->ip, port))
+#define socket_bind46(s, i, port) ((i)->is6 ? socket_bind6(s, (i)->ip, port) : socket_bind4(s, (i)->ip, port))
+#define socket_bind46_reuse(s, i, port) ((i)->is6 ? socket_bind6_reuse(s, (i)->ip, port) : socket_bind4_reuse(s, (i)->ip, port))
+#define socket_tcp46(h) ((h) ? socket_tcp6() : socket_tcp4())
+#define socket_udp46(h) ((h) ? socket_udp6() : socket_udp4())
+#define socket_recv46(fd, s, len, i, port) ((i)->is6 ? socket_recv6(fd, s, len, (i)->ip, port) : socket_recv4(fd, s, len, (i)->ip, port))
+#define socket_send46(fd, s, len, i, port) ((i)->is6 ? socket_send6(fd, s, len, (i)->ip, port) : socket_send4(fd, s, len, (i)->ip, port))
+extern int socket_local46 (int, ip46_t_ref, uint16 *) ;
+extern int socket_remote46 (int, ip46_t_ref, uint16 *) ;
+
+#define socket_recvnb46(fd, buf, len, i, port, deadline, stamp) ((i)->is6 ? socket_recvnb6(fd, buf, len, (i)->ip, port, deadline, stamp) : socket_recvnb4(fd, buf, len, (i)->ip, port, deadline, stamp))
+#define socket_sendnb46(fd, buf, len, i, port, deadline, stamp) ((i)->is6 ? socket_sendnb6(fd, buf, len, (i)->ip, port, deadline, stamp) : socket_sendnb4(fd, buf, len, (i)->ip, port, deadline, stamp))