about summary refs log tree commit diff stats
path: root/src/libwifi/gen/management/assoc_response.h
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 /src/libwifi/gen/management/assoc_response.h
downloadlibwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.gz
libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.tar.bz2
libwifi-ae6c98a48da409d040604aeffb84a38155fb5bac.zip
Initial Commit
Signed-off-by: Marc <foxtrot@malloc.me>
Diffstat (limited to 'src/libwifi/gen/management/assoc_response.h')
-rw-r--r--src/libwifi/gen/management/assoc_response.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/libwifi/gen/management/assoc_response.h b/src/libwifi/gen/management/assoc_response.h new file mode 100644 index 0000000..9162d1c --- /dev/null +++ b/src/libwifi/gen/management/assoc_response.h
@@ -0,0 +1,69 @@
1/* Copyright 2021 The libwifi Authors
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef LIBWIFI_GEN_ASSOCRESP_H
17#define LIBWIFI_GEN_ASSOCRESP_H
18
19#include "../../core/frame/management/assoc_response.h"
20
21/**
22 * Set the channel of a libwifi_assoc_resp.
23 *
24 * @param assoc_resp A libwifi_assoc_resp
25 * @param channel The new channel
26 */
27void libwifi_set_assoc_resp_channel(struct libwifi_assoc_resp *assoc_resp, uint8_t channel);
28
29/**
30 * Calculate the length of a given libwifi_assoc_resp
31 *
32 * @param assoc_resp A libwifi_assoc_resp
33 * @return The length of the given assoc_resp
34 */
35size_t libwifi_get_assoc_resp_length(struct libwifi_assoc_resp *assoc_resp);
36
37/**
38 * Generate a populated libwifi assoc_resp.
39 *
40 * A generated libwifi assoc_resp can be "dumped" into a buffer for packet injection
41 * via the libwifi_dump_assoc_resp.
42 *
43 * @param assoc_resp A libwifi_assoc_resp
44 * @param receiver The receiver MAC address, aka address 1
45 * @param transmitter The source MAC address, aka address 2
46 * @param channel The desired channel of the assoc_resp
47 *
48 */
49void libwifi_create_assoc_resp(struct libwifi_assoc_resp *assoc_resp, const unsigned char receiver[6],
50 const unsigned char transmitter[6], uint8_t channel);
51
52/**
53 * Dump a libwifi_assoc_resp into a raw format for packet injection.
54 *
55 * @param assoc_resp A libwifi_assoc_resp
56 * @param buf The output buffer for the frame data
57 * @param buf_len The length of the output buffer
58 * @return The length of the dumped assoc_resp
59 */
60size_t libwifi_dump_assoc_resp(struct libwifi_assoc_resp *assoc_resp, unsigned char *buf, size_t buf_len);
61
62/**
63 * Free any memory claimed by a libwifi_assoc_resp back to the system.
64 *
65 * @param assoc_resp A libwifi_assoc_resp
66 */
67void libwifi_free_assoc_resp(struct libwifi_assoc_resp *assoc_resp);
68
69#endif /* LIBWIFI_GEN_ASSOCRESP_H */