aboutsummaryrefslogtreecommitdiff
path: root/benchtests/inet_ntop_ipv6-source.c
diff options
context:
space:
mode:
Diffstat (limited to 'benchtests/inet_ntop_ipv6-source.c')
-rw-r--r--benchtests/inet_ntop_ipv6-source.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/benchtests/inet_ntop_ipv6-source.c b/benchtests/inet_ntop_ipv6-source.c
new file mode 100644
index 0000000..f255c27
--- /dev/null
+++ b/benchtests/inet_ntop_ipv6-source.c
@@ -0,0 +1,10 @@
+#include <arpa/inet.h>
+#include <stdint.h>
+
+static void
+inet_ntop_ipv6 (uint32_t addr1, uint32_t addr2, uint32_t addr3, uint32_t addr4)
+{
+ struct in6_addr saddr = { .s6_addr32 = { addr1, addr2, addr3, addr4 } };
+ char dst[INET6_ADDRSTRLEN];
+ inet_ntop (AF_INET6, &saddr, dst, sizeof dst);
+}