about summary refs log tree commit diff stats
path: root/test/src/test_misc.c
diff options
context:
space:
mode:
authorMarc <foxtrot@malloc.me>2021-11-30 22:39:26 +0000
committerMarc <foxtrot@malloc.me>2021-12-01 16:54:44 +0000
commitae6c98a48da409d040604aeffb84a38155fb5bac (patch)
treec27a8e28972209581ce3fba2130bf0c2b4f9c9c0 /test/src/test_misc.c
downloadlibwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.gz
libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.bz2
libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.zip
Initial Commit
Signed-off-by: Marc <foxtrot@malloc.me>
Diffstat (limited to 'test/src/test_misc.c')
-rw-r--r--test/src/test_misc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/src/test_misc.c b/test/src/test_misc.c new file mode 100644 index 0000000..f103455 --- /dev/null +++ b/test/src/test_misc.c
@@ -0,0 +1,30 @@
1#include <libwifi.h>
2#include <libwifi/core/core.h>
3#include <stdio.h>
4
5void gen_macs() {
6 printf("Getting 10 random MAC addresses:\n");
7 for(int i = 0; i < 10; i++) {
8 unsigned char mac[6] = {0};
9 libwifi_random_mac(mac, NULL);
10 printf(MACSTR "\n", MAC2STR(mac));
11 }
12
13 printf("Generating 10 random MAC addresses with 00:20:91 OUI:\n");
14 for(int i = 0; i < 10; i++) {
15 unsigned char mac[6] = {0};
16 libwifi_random_mac(mac, (unsigned char *) "\x00\x20\x91");
17 printf(MACSTR "\n", MAC2STR(mac));
18 }
19 printf("\n");
20}
21
22int main() {
23 libwifi_dummy();
24
25 printf("libwifi version: %s\n\n", libwifi_get_version());
26
27 gen_macs();
28
29 return 0;
30}