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