]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Move CRC-32 routine from wlantest to src/utils
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 2 Sep 2015 13:16:50 +0000 (16:16 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 9 Oct 2016 14:13:23 +0000 (17:13 +0300)
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>
src/utils/Makefile
src/utils/crc32.c [moved from wlantest/crc32.c with 99% similarity]
src/utils/crc32.h [new file with mode: 0644]
wlantest/Makefile
wlantest/process.c
wlantest/test_vectors.c
wlantest/tkip.c
wlantest/wep.c
wlantest/wlantest.h

index 8aad813cfc8580fd4e516c76c21c5135c039657e..52efc5321fca1de538cf75562f8f3afc53aae04e 100644 (file)
@@ -17,6 +17,7 @@ LIB_OBJS= \
        base64.o \
        bitfield.o \
        common.o \
+       crc32.o \
        ip_addr.o \
        radiotap.o \
        trace.o \
similarity index 99%
rename from wlantest/crc32.c
rename to src/utils/crc32.c
index adbbda5b73949bc3492986b628ca4fcbbc950dd5..12d9e2a7008ed96c4b47fffa1147533bc4a80211 100644 (file)
@@ -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 (file)
index 0000000..dc31399
--- /dev/null
@@ -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 */
index 320fdbbc2ee8aefa665ea565b436b77bde626255..746617598d07d5fa4a73e72cad01af18183f4c41 100644 (file)
@@ -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
index 802d0af8ff34ae0a0f0bed3c24666934cdf843dd..54ddf6badd616e6bae4c70e0d72fd25a99fba7f1 100644 (file)
@@ -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"
index b15e5b39927717d824116d7cb36173123c6bff67..ab9c0a39d37a02f05a5a170048736369c8f6fd04 100644 (file)
@@ -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"
index ed3d60146b5160d57cfe210fa15c48ce074a1206..63366d5e21558812c3d5f4361e207cb26858596b 100644 (file)
@@ -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"
 
index c4137f345c03255a64c619916a80e5593632bb7e..50e371fc51033f40b4acff59949caa0ea486a525 100644 (file)
@@ -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"
 
index 1ff579ffad420f1370f263bdce7a83aff21ebd5b..0de04c692cd47dfde01f615f7dba57fbc3b1e137 100644 (file)
@@ -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);