summaryrefslogtreecommitdiff
path: root/src/headers/ip46-header
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-03-13 22:43:45 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-03-13 22:43:45 +0000
commit33dfbbeaec4a49e110f51f5d088015f1a8fb9075 (patch)
tree7f2e2359d05b63b1b0b59b61ae3fc154050fc486 /src/headers/ip46-header
parente450f6efc39e55e32264d2daded6c757af0f7527 (diff)
downloadskalibs-33dfbbeaec4a49e110f51f5d088015f1a8fb9075.tar.xz
More superflous headers cleanup and tiny fixes
Diffstat (limited to 'src/headers/ip46-header')
-rw-r--r--src/headers/ip46-header8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/headers/ip46-header b/src/headers/ip46-header
index 91d0c86..3f872be 100644
--- a/src/headers/ip46-header
+++ b/src/headers/ip46-header
@@ -3,12 +3,10 @@
#ifndef IP46_H
#define IP46_H
-#include <sys/types.h>
+#include <string.h>
#include <stdint.h>
#include <errno.h>
-#include <skalibs/bytestr.h>
#include <skalibs/fmtscan.h>
-#include <skalibs/tai.h>
#include <skalibs/socket.h>
#define IP46_FMT IP6_FMT
@@ -30,6 +28,6 @@ struct ip46full_s
#define ip46full_fmt(s, i) ((i)->is6 ? ip6_fmt(s, (i)->ip) : ip4_fmt(s, (i)->ip))
extern size_t ip46full_scan (char const *, ip46full_t *) ;
extern size_t ip46full_scanlist (ip46full_t *, size_t, char const *, size_t *) ;
-#define ip46full_from_ip4(i, ip4) (byte_copy((i)->ip, 4, ip4), byte_zero((i)->ip + 4, 12), (i)->is6 = 0)
-#define ip46full_from_ip6(i, ip6) (byte_copy((i)->ip, 16, ip6), (i)->is6 = 1)
+#define ip46full_from_ip4(i, ip4) (memcpy((i)->ip, ip4, 4), memset((i)->ip + 4, 0, 12), (i)->is6 = 0)
+#define ip46full_from_ip6(i, ip6) (memcpy((i)->ip, ip6, 16), (i)->is6 = 1)