diff options
-rw-r--r-- | test/src/action_tests.c | 4 | ||||
-rw-r--r-- | test/src/assoc_req_tests.c | 4 | ||||
-rw-r--r-- | test/src/assoc_resp_tests.c | 4 | ||||
-rw-r--r-- | test/src/auth_tests.c | 4 | ||||
-rw-r--r-- | test/src/deauth_tests.c | 4 | ||||
-rw-r--r-- | test/src/disassoc_tests.c | 4 | ||||
-rw-r--r-- | test/src/probe_resp_tests.c | 4 | ||||
-rw-r--r-- | test/src/reassoc_req_tests.c | 10 | ||||
-rw-r--r-- | test/src/reassoc_resp_tests.c | 6 | ||||
-rw-r--r-- | test/src/timing_ad_tests.c | 2 |
10 files changed, 25 insertions, 21 deletions
diff --git a/test/src/action_tests.c b/test/src/action_tests.c index 997095d..c8377b5 100644 --- a/test/src/action_tests.c +++ b/test/src/action_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_action_gen_full() { | 12 | int test_action_gen_full() { |
13 | struct libwifi_action action = {0}; | 13 | struct libwifi_action action = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_action(&action, bcast, to, ACTION_HT); | 15 | int ret = libwifi_create_action(&action, bcast, to, to, ACTION_HT); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create action: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create action: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_action_gen_full() { | |||
42 | int test_action_add_detail() { | 42 | int test_action_add_detail() { |
43 | struct libwifi_action action = {0}; | 43 | struct libwifi_action action = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_action(&action, bcast, to, ACTION_HT); | 45 | int ret = libwifi_create_action(&action, bcast, to, to, ACTION_HT); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create action: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create action: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/assoc_req_tests.c b/test/src/assoc_req_tests.c index fc6379f..32d199e 100644 --- a/test/src/assoc_req_tests.c +++ b/test/src/assoc_req_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_assoc_req_gen_full() { | 12 | int test_assoc_req_gen_full() { |
13 | struct libwifi_assoc_req assoc_req = {0}; | 13 | struct libwifi_assoc_req assoc_req = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, "Some SSID", 11); | 15 | int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, to, "Some SSID", 11); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create assoc_req: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create assoc_req: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_assoc_req_gen_full() { | |||
42 | int test_assoc_req_add_tag() { | 42 | int test_assoc_req_add_tag() { |
43 | struct libwifi_assoc_req assoc_req = {0}; | 43 | struct libwifi_assoc_req assoc_req = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, "Some SSID", 11); | 45 | int ret = libwifi_create_assoc_req(&assoc_req, bcast, to, to, "Some SSID", 11); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create assoc_req: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create assoc_req: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/assoc_resp_tests.c b/test/src/assoc_resp_tests.c index 3a261ed..717a3cd 100644 --- a/test/src/assoc_resp_tests.c +++ b/test/src/assoc_resp_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_assoc_resp_gen_full() { | 12 | int test_assoc_resp_gen_full() { |
13 | struct libwifi_assoc_resp assoc_resp = {0}; | 13 | struct libwifi_assoc_resp assoc_resp = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, 11); | 15 | int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, to, 11); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create assoc_resp: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create assoc_resp: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_assoc_resp_gen_full() { | |||
42 | int test_assoc_resp_add_tag() { | 42 | int test_assoc_resp_add_tag() { |
43 | struct libwifi_assoc_resp assoc_resp = {0}; | 43 | struct libwifi_assoc_resp assoc_resp = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, 11); | 45 | int ret = libwifi_create_assoc_resp(&assoc_resp, bcast, to, to, 11); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create assoc_resp: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create assoc_resp: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/auth_tests.c b/test/src/auth_tests.c index f78aeed..41dcefe 100644 --- a/test/src/auth_tests.c +++ b/test/src/auth_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_auth_gen_full() { | 12 | int test_auth_gen_full() { |
13 | struct libwifi_auth auth = {0}; | 13 | struct libwifi_auth auth = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_auth(&auth, bcast, to, 0, 100, STATUS_SUCCESS); | 15 | int ret = libwifi_create_auth(&auth, bcast, to, to, 0, 100, STATUS_SUCCESS); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create auth: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create auth: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_auth_gen_full() { | |||
42 | int test_auth_add_tag() { | 42 | int test_auth_add_tag() { |
43 | struct libwifi_auth auth = {0}; | 43 | struct libwifi_auth auth = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_auth(&auth, bcast, to, 0, 100, STATUS_SUCCESS); | 45 | int ret = libwifi_create_auth(&auth, bcast, to, to, 0, 100, STATUS_SUCCESS); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create auth: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create auth: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/deauth_tests.c b/test/src/deauth_tests.c index 9033574..99df9f6 100644 --- a/test/src/deauth_tests.c +++ b/test/src/deauth_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_deauth_gen_full() { | 12 | int test_deauth_gen_full() { |
13 | struct libwifi_deauth deauth = {0}; | 13 | struct libwifi_deauth deauth = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_deauth(&deauth, bcast, to, REASON_STA_LEAVING); | 15 | int ret = libwifi_create_deauth(&deauth, bcast, to, to, REASON_STA_LEAVING); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create deauth: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create deauth: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_deauth_gen_full() { | |||
42 | int test_deauth_add_tag() { | 42 | int test_deauth_add_tag() { |
43 | struct libwifi_deauth deauth = {0}; | 43 | struct libwifi_deauth deauth = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_deauth(&deauth, bcast, to, REASON_STA_LEAVING); | 45 | int ret = libwifi_create_deauth(&deauth, bcast, to, to, REASON_STA_LEAVING); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create deauth: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create deauth: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/disassoc_tests.c b/test/src/disassoc_tests.c index c5e27de..2e3da77 100644 --- a/test/src/disassoc_tests.c +++ b/test/src/disassoc_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_disassoc_gen_full() { | 12 | int test_disassoc_gen_full() { |
13 | struct libwifi_disassoc disassoc = {0}; | 13 | struct libwifi_disassoc disassoc = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_disassoc(&disassoc, bcast, to, REASON_STA_LEAVING); | 15 | int ret = libwifi_create_disassoc(&disassoc, bcast, to, to, REASON_STA_LEAVING); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create disassoc: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create disassoc: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_disassoc_gen_full() { | |||
42 | int test_disassoc_add_tag() { | 42 | int test_disassoc_add_tag() { |
43 | struct libwifi_disassoc disassoc = {0}; | 43 | struct libwifi_disassoc disassoc = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_disassoc(&disassoc, bcast, to, REASON_STA_LEAVING); | 45 | int ret = libwifi_create_disassoc(&disassoc, bcast, to, to, REASON_STA_LEAVING); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create disassoc: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create disassoc: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/probe_resp_tests.c b/test/src/probe_resp_tests.c index 463a90a..4f4f650 100644 --- a/test/src/probe_resp_tests.c +++ b/test/src/probe_resp_tests.c | |||
@@ -12,7 +12,7 @@ const unsigned char bcast[] = BCAST_MAC; | |||
12 | int test_probe_resp_gen_full() { | 12 | int test_probe_resp_gen_full() { |
13 | struct libwifi_probe_resp probe_resp = {0}; | 13 | struct libwifi_probe_resp probe_resp = {0}; |
14 | 14 | ||
15 | int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, "Some SSID", 11); | 15 | int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, to, "Some SSID", 11); |
16 | if (ret != 0) { | 16 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create probe_resp: %s\n", strerror(ret)); | 17 | fprintf(stderr, "Failed to create probe_resp: %s\n", strerror(ret)); |
18 | return ret; | 18 | return ret; |
@@ -42,7 +42,7 @@ int test_probe_resp_gen_full() { | |||
42 | int test_probe_resp_add_tag() { | 42 | int test_probe_resp_add_tag() { |
43 | struct libwifi_probe_resp probe_resp = {0}; | 43 | struct libwifi_probe_resp probe_resp = {0}; |
44 | 44 | ||
45 | int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, "Some SSID", 11); | 45 | int ret = libwifi_create_probe_resp(&probe_resp, bcast, to, to, "Some SSID", 11); |
46 | if (ret != 0) { | 46 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create probe_resp: %s\n", strerror(ret)); | 47 | fprintf(stderr, "Failed to create probe_resp: %s\n", strerror(ret)); |
48 | return ret; | 48 | return ret; |
diff --git a/test/src/reassoc_req_tests.c b/test/src/reassoc_req_tests.c index 00e2b53..53cf6b9 100644 --- a/test/src/reassoc_req_tests.c +++ b/test/src/reassoc_req_tests.c | |||
@@ -4,15 +4,17 @@ | |||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <string.h> | 5 | #include <string.h> |
6 | 6 | ||
7 | #define BCAST_MAC "\xff\xff\xff\xff\xff\xff" | 7 | #define BCAST_MAC "\xff\xff\xff\xff\xff\xff" |
8 | #define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" | 8 | #define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" |
9 | #define CURRENT_AP "\x00\x20\x91\x00\x11\x22" | ||
9 | const unsigned char to[] = TO_MAC; | 10 | const unsigned char to[] = TO_MAC; |
10 | const unsigned char bcast[] = BCAST_MAC; | 11 | const unsigned char bcast[] = BCAST_MAC; |
12 | const unsigned char current_ap[] = CURRENT_AP; | ||
11 | 13 | ||
12 | int test_reassoc_req_gen_full() { | 14 | int test_reassoc_req_gen_full() { |
13 | struct libwifi_reassoc_req reassoc_req = {0}; | 15 | struct libwifi_reassoc_req reassoc_req = {0}; |
14 | 16 | ||
15 | int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, "Some SSID", 11); | 17 | int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, current_ap, "Some SSID", 11); |
16 | if (ret != 0) { | 18 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create reassoc_req: %s\n", strerror(ret)); | 19 | fprintf(stderr, "Failed to create reassoc_req: %s\n", strerror(ret)); |
18 | return ret; | 20 | return ret; |
@@ -42,7 +44,7 @@ int test_reassoc_req_gen_full() { | |||
42 | int test_reassoc_req_add_tag() { | 44 | int test_reassoc_req_add_tag() { |
43 | struct libwifi_reassoc_req reassoc_req = {0}; | 45 | struct libwifi_reassoc_req reassoc_req = {0}; |
44 | 46 | ||
45 | int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, "Some SSID", 11); | 47 | int ret = libwifi_create_reassoc_req(&reassoc_req, bcast, to, to, current_ap, "Some SSID", 11); |
46 | if (ret != 0) { | 48 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create reassoc_req: %s\n", strerror(ret)); | 49 | fprintf(stderr, "Failed to create reassoc_req: %s\n", strerror(ret)); |
48 | return ret; | 50 | return ret; |
diff --git a/test/src/reassoc_resp_tests.c b/test/src/reassoc_resp_tests.c index 8167916..fbfd448 100644 --- a/test/src/reassoc_resp_tests.c +++ b/test/src/reassoc_resp_tests.c | |||
@@ -6,13 +6,15 @@ | |||
6 | 6 | ||
7 | #define BCAST_MAC "\xff\xff\xff\xff\xff\xff" | 7 | #define BCAST_MAC "\xff\xff\xff\xff\xff\xff" |
8 | #define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" | 8 | #define TO_MAC "\x00\x20\x91\xAA\xBB\xCC" |
9 | #define CURRENT_AP "\x00\x20\x91\x00\x11\x22" | ||
9 | const unsigned char to[] = TO_MAC; | 10 | const unsigned char to[] = TO_MAC; |
10 | const unsigned char bcast[] = BCAST_MAC; | 11 | const unsigned char bcast[] = BCAST_MAC; |
12 | const unsigned char current_ap[] = CURRENT_AP; | ||
11 | 13 | ||
12 | int test_reassoc_resp_gen_full() { | 14 | int test_reassoc_resp_gen_full() { |
13 | struct libwifi_reassoc_resp reassoc_resp = {0}; | 15 | struct libwifi_reassoc_resp reassoc_resp = {0}; |
14 | 16 | ||
15 | int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, 11); | 17 | int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, current_ap, 11); |
16 | if (ret != 0) { | 18 | if (ret != 0) { |
17 | fprintf(stderr, "Failed to create reassoc_resp: %s\n", strerror(ret)); | 19 | fprintf(stderr, "Failed to create reassoc_resp: %s\n", strerror(ret)); |
18 | return ret; | 20 | return ret; |
@@ -42,7 +44,7 @@ int test_reassoc_resp_gen_full() { | |||
42 | int test_reassoc_resp_add_tag() { | 44 | int test_reassoc_resp_add_tag() { |
43 | struct libwifi_reassoc_resp reassoc_resp = {0}; | 45 | struct libwifi_reassoc_resp reassoc_resp = {0}; |
44 | 46 | ||
45 | int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, 11); | 47 | int ret = libwifi_create_reassoc_resp(&reassoc_resp, bcast, to, current_ap, 11); |
46 | if (ret != 0) { | 48 | if (ret != 0) { |
47 | fprintf(stderr, "Failed to create reassoc_resp: %s\n", strerror(ret)); | 49 | fprintf(stderr, "Failed to create reassoc_resp: %s\n", strerror(ret)); |
48 | return ret; | 50 | return ret; |
diff --git a/test/src/timing_ad_tests.c b/test/src/timing_ad_tests.c index 59d20eb..2e2e5ba 100644 --- a/test/src/timing_ad_tests.c +++ b/test/src/timing_ad_tests.c | |||
@@ -19,7 +19,7 @@ int test_timing_ad_gen_full() { | |||
19 | memcpy(ad_fields.time_value, | 19 | memcpy(ad_fields.time_value, |
20 | "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA", 10); | 20 | "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA", 10); |
21 | 21 | ||
22 | int ret = libwifi_create_timing_advert(&time_ad, to, to, &ad_fields, "GB", -56, -56, -30, -20); | 22 | int ret = libwifi_create_timing_advert(&time_ad, bcast, to, to, &ad_fields, "GB", -56, -56, -30, -20); |
23 | if (ret != 0) { | 23 | if (ret != 0) { |
24 | fprintf(stderr, "Failed to create timing advert\n"); | 24 | fprintf(stderr, "Failed to create timing advert\n"); |
25 | return ret; | 25 | return ret; |