about summary refs log tree commit diff stats
path: root/data/maps/the_tenacious/rooms/Main Area.txtpb
blob: 18356e7538169248f6eac1fb214f295cfbfa989e (plain) (blame)
1
2
3
4
5
6
name: "Main Area"
keyholders {
  name: "K"
  path: "Components/KeyHolders/keyHolderK"
  key: "k"
}
d-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* Copyright 2021 The libwifi Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef LIBWIFI_GEN_DEAUTH_H
#define LIBWIFI_GEN_DEAUTH_H

#include <stdint.h>

#include "../../core/frame/management/deauthentication.h"

/**
 * Calculate the length of a given libwifi_deauth
 *
 * @param deauth A libwifi_deauth
 * @return       The length of the given deauth
 */
size_t libwifi_get_deauth_length(struct libwifi_deauth *deauth);

/**
 * Generate a populated libwifi deauth.
 *
 * A generated libwifi deauth can be "dumped" into a buffer for packet injection
 * via the libwifi_dump_deauth.
 *
 * @param deauth      A libwifi_deauth
 * @param receiver    The receiver MAC address, aka address 1
 * @param transmitter The source MAC address, aka address 2
 * @param address3    The address 3 frame field value, typically the BSSID
 * @param reason_code The deauth reason code
 * @return            Zero on success, or negative error
 */
int libwifi_create_deauth(struct libwifi_deauth *deauth,
                          const unsigned char receiver[6],
                          const unsigned char transmitter[6],
                          const unsigned char address3[6],
                          uint16_t reason_code);

/**
 * Dump a libwifi_deauth into a raw format for packet injection.
 *
 * @param deauth  A libwifi_deauth
 * @param buf     The output buffer for the frame data
 * @param buf_len The length of the output buffer
 * @return        The length of the dumped deauth, or negative error
 */
size_t libwifi_dump_deauth(struct libwifi_deauth *deauth, unsigned char *buf, size_t buf_len);

/**
 * Free any memory claimed by a libwifi_deauth back to the system.
 *
 * @param deauth A libwifi_deauth
 */
void libwifi_free_deauth(struct libwifi_deauth *deauth);

#endif /* LIBWIFI_GEN_DEAUTH_H */
span class="n">frame_control.type = TYPE_MANAGEMENT; assoc_req->frame_header.frame_control.subtype = SUBTYPE_ASSOC_REQ; memcpy(&assoc_req->frame_header.addr1, receiver, 6); memcpy(&assoc_req->frame_header.addr2, transmitter, 6); memcpy(&assoc_req->frame_header.addr3, address3, 6); assoc_req->fixed_parameters.capabilities_information = BYTESWAP16(LIBWIFI_DEFAULT_AP_CAPABS); assoc_req->fixed_parameters.listen_interval = BYTESWAP16(LIBWIFI_DEFAULT_LISTEN_INTERVAL); int ret = libwifi_quick_add_tag(&assoc_req->tags, TAG_SSID, (const unsigned char *) ssid, strlen(ssid)); if (ret != 0) { return ret; } ret = libwifi_quick_add_tag(&assoc_req->tags, TAG_DS_PARAMETER, (const unsigned char *) &channel, 1); if (ret != 0) { return ret; } return 0; } /** * Copy a libwifi_assoc_req into a regular unsigned char buffer. This is useful when injecting generated * libwifi frames. */ size_t libwifi_dump_assoc_req(struct libwifi_assoc_req *assoc_req, unsigned char *buf, size_t buf_len) { size_t assoc_req_len = libwifi_get_assoc_req_length(assoc_req); if (assoc_req_len > buf_len) { return -EINVAL; } size_t offset = 0; memcpy(buf + offset, &assoc_req->frame_header, sizeof(struct libwifi_mgmt_unordered_frame_header)); offset += sizeof(struct libwifi_mgmt_unordered_frame_header); memcpy(buf + offset, &assoc_req->fixed_parameters, sizeof(struct libwifi_assoc_req_fixed_parameters)); offset += sizeof(struct libwifi_assoc_req_fixed_parameters); memcpy(buf + offset, assoc_req->tags.parameters, assoc_req->tags.length); offset += assoc_req->tags.length; return assoc_req_len; } /** * Because the tagged parameters memory is managed inside of the library, the library must * be the one to free it, too. */ void libwifi_free_assoc_req(struct libwifi_assoc_req *assoc_req) { free(assoc_req->tags.parameters); }