aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-09-02 13:16:50 (GMT)
committerJouni Malinen <j@w1.fi>2016-10-09 14:13:23 (GMT)
commite2991ee5807a1cc812615b354e0492c8a6453daf (patch)
tree406c45cf5474ded78db4ae0003f5abf8f41ff33c
parenta8ef83f49d94205a6b9d0e2488bb89fde40ef01b (diff)
downloadhostap-e2991ee5807a1cc812615b354e0492c8a6453daf.zip
hostap-e2991ee5807a1cc812615b354e0492c8a6453daf.tar.gz
hostap-e2991ee5807a1cc812615b354e0492c8a6453daf.tar.bz2
Move CRC-32 routine from wlantest to src/utils
This allows the CRC-32 routine to be shared for other purposes in addition to the WEP/TKIP/FCS within wlantest. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--src/utils/Makefile1
-rw-r--r--src/utils/crc32.c (renamed from wlantest/crc32.c)1
-rw-r--r--src/utils/crc32.h14
-rw-r--r--wlantest/Makefile2
-rw-r--r--wlantest/process.c1
-rw-r--r--wlantest/test_vectors.c1
-rw-r--r--wlantest/tkip.c1
-rw-r--r--wlantest/wep.c1
-rw-r--r--wlantest/wlantest.h1
9 files changed, 20 insertions, 3 deletions
diff --git a/src/utils/Makefile b/src/utils/Makefile
index 8aad813..52efc53 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -17,6 +17,7 @@ LIB_OBJS= \
base64.o \
bitfield.o \
common.o \
+ crc32.o \
ip_addr.o \
radiotap.o \
trace.o \
diff --git a/wlantest/crc32.c b/src/utils/crc32.c
index adbbda5..12d9e2a 100644
--- a/wlantest/crc32.c
+++ b/src/utils/crc32.c
@@ -9,6 +9,7 @@
#include "utils/includes.h"
#include "utils/common.h"
+#include "utils/crc32.h"
/*
* IEEE 802.11 FCS CRC32
diff --git a/src/utils/crc32.h b/src/utils/crc32.h
new file mode 100644
index 0000000..dc31399
--- /dev/null
+++ b/src/utils/crc32.h
@@ -0,0 +1,14 @@
+/*
+ * 32-bit CRC for FCS calculation
+ * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
+ *
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
+ */
+
+#ifndef CRC32_H
+#define CRC32_H
+
+u32 crc32(const u8 *frame, size_t frame_len);
+
+#endif /* CRC32_H */
diff --git a/wlantest/Makefile b/wlantest/Makefile
index 320fdbb..7466175 100644
--- a/wlantest/Makefile
+++ b/wlantest/Makefile
@@ -69,7 +69,6 @@ OBJS += rx_ip.o
OBJS += rx_tdls.o
OBJS += bss.o
OBJS += sta.o
-OBJS += crc32.o
OBJS += ccmp.o
OBJS += tkip.o
OBJS += ctrl.o
@@ -81,7 +80,6 @@ OBJS += gcmp.o
LIBS += -lpcap
TOBJS += test_vectors.o
-TOBJS += crc32.o
TOBJS += ccmp.o
TOBJS += tkip.o
TOBJS += wep.o
diff --git a/wlantest/process.c b/wlantest/process.c
index 802d0af..54ddf6b 100644
--- a/wlantest/process.c
+++ b/wlantest/process.c
@@ -9,6 +9,7 @@
#include "utils/includes.h"
#include "utils/common.h"
+#include "utils/crc32.h"
#include "utils/radiotap.h"
#include "utils/radiotap_iter.h"
#include "common/ieee802_11_defs.h"
diff --git a/wlantest/test_vectors.c b/wlantest/test_vectors.c
index b15e5b3..ab9c0a3 100644
--- a/wlantest/test_vectors.c
+++ b/wlantest/test_vectors.c
@@ -9,6 +9,7 @@
#include "utils/includes.h"
#include "utils/common.h"
+#include "utils/crc32.h"
#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
#include "wlantest.h"
diff --git a/wlantest/tkip.c b/wlantest/tkip.c
index ed3d601..63366d5 100644
--- a/wlantest/tkip.c
+++ b/wlantest/tkip.c
@@ -9,6 +9,7 @@
#include "utils/includes.h"
#include "utils/common.h"
+#include "utils/crc32.h"
#include "common/ieee802_11_defs.h"
#include "wlantest.h"
diff --git a/wlantest/wep.c b/wlantest/wep.c
index c4137f3..50e371f 100644
--- a/wlantest/wep.c
+++ b/wlantest/wep.c
@@ -9,6 +9,7 @@
#include "utils/includes.h"
#include "utils/common.h"
+#include "utils/crc32.h"
#include "common/ieee802_11_defs.h"
#include "wlantest.h"
diff --git a/wlantest/wlantest.h b/wlantest/wlantest.h
index 1ff579f..0de04c6 100644
--- a/wlantest/wlantest.h
+++ b/wlantest/wlantest.h
@@ -237,7 +237,6 @@ void wlantest_process(struct wlantest *wt, const u8 *data, size_t len);
void wlantest_process_prism(struct wlantest *wt, const u8 *data, size_t len);
void wlantest_process_80211(struct wlantest *wt, const u8 *data, size_t len);
void wlantest_process_wired(struct wlantest *wt, const u8 *data, size_t len);
-u32 crc32(const u8 *frame, size_t frame_len);
int monitor_init(struct wlantest *wt, const char *ifname);
int monitor_init_wired(struct wlantest *wt, const char *ifname);
void monitor_deinit(struct wlantest *wt);