about summary refs log tree commit diff stats
path: root/data/maps/the_unyielding/rooms/Behind Northeast.txtpb
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-10-03 21:34:20 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2025-10-03 21:34:20 -0400
commit5d4d493b719c81406c16ccc89f28083a4e71e1d0 (patch)
treecb4a2d1abf4acbbfac239cb68299009de3a2ffa5 /data/maps/the_unyielding/rooms/Behind Northeast.txtpb
parent595e8310002f951b1a8fbccf2d57279d467a12e7 (diff)
downloadlingo2-archipelago-5d4d493b719c81406c16ccc89f28083a4e71e1d0.tar.gz
lingo2-archipelago-5d4d493b719c81406c16ccc89f28083a4e71e1d0.tar.bz2
lingo2-archipelago-5d4d493b719c81406c16ccc89f28083a4e71e1d0.zip
Bump version v7.0.2
Diffstat (limited to 'data/maps/the_unyielding/rooms/Behind Northeast.txtpb')
0 files changed, 0 insertions, 0 deletions
or: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-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.
 */

#include "../../core/frame/management/reassoc_response.h"
#include "../../core/frame/frame.h"
#include "../../core/frame/tag.h"
#include "../../core/frame/tag_iterator.h"
#include "../../core/misc/types.h"
#include "../../parse/misc/security.h"
#include "common.h"
#include "reassoc_response.h"

#include <errno.h>
#include <stdlib.h>
#include <string.h>

/**
 * libwifi_parse_reassoc_resp will parse useful information out of a Reassocation Response
 * into a struct libwifi_bss.
 *
 * ┌─────────────────────────────────────────────┐
 * │        Header (Ordered or Unordered)        │  ── Reassocation Response Header
 * ├─────────────────────────────────────────────┤
 * │               Fixed Parameters              │  ─┐
 * ├─────────────────────────────────────────────┤   ├──  Reassociation Response Body
 * │              Tagged  Parameters             │  ─┘
 * └─────────────────────────────────────────────┘
 */
int libwifi_parse_reassoc_resp(struct libwifi_bss *bss, struct libwifi_frame *frame) {
    memset(bss, 0, sizeof(struct libwifi_bss));

    if (frame->frame_control.type != TYPE_MANAGEMENT ||
        frame->frame_control.subtype != SUBTYPE_REASSOC_RESP) {
        return -EINVAL;
    }

    if (frame->frame_control.flags.ordered) {
        memcpy(bss->receiver, frame->header.mgmt_ordered.addr1, 6);
        memcpy(bss->transmitter, frame->header.mgmt_ordered.addr2, 6);
        memcpy(bss->bssid, frame->header.mgmt_ordered.addr3, 6);
    } else {
        memcpy(bss->receiver, frame->header.mgmt_unordered.addr1, 6);
        memcpy(bss->transmitter, frame->header.mgmt_unordered.addr2, 6);
        memcpy(bss->bssid, frame->header.mgmt_unordered.addr3, 6);
    }

    // Fixed Parameters must be present
    if (frame->len <= (frame->header_len + sizeof(struct libwifi_reassoc_resp_fixed_parameters))) {
        return -EINVAL;
    }

    // At least one Tagged Parameter must be present
    if (frame->len < (frame->header_len + sizeof(struct libwifi_reassoc_resp_fixed_parameters) + 2)) {
        return -EINVAL;
    }

    struct libwifi_reassoc_resp_fixed_parameters *fixed_params =
        (struct libwifi_reassoc_resp_fixed_parameters *) frame->body;
    if (libwifi_check_capabilities(fixed_params->capabilities_information, CAPABILITIES_PRIVACY)) {
        bss->encryption_info |= WEP;
    }

    bss->tags.length =
        (frame->len - (frame->header_len + sizeof(struct libwifi_reassoc_resp_fixed_parameters)));
    const unsigned char *tagged_params = frame->body + sizeof(struct libwifi_reassoc_resp_fixed_parameters);
    bss->tags.parameters = malloc(bss->tags.length);
    memcpy(bss->tags.parameters, tagged_params, bss->tags.length);

    // Iterate through common BSS tagged parameters (WPA, RSN, etc)
    struct libwifi_tag_iterator it;
    memset(&it, 0, sizeof(struct libwifi_tag_iterator));
    if (libwifi_tag_iterator_init(&it, bss->tags.parameters, bss->tags.length) != 0) {
        return -EINVAL;
    }
    if (libwifi_bss_tag_parser(bss, &it) != 0) {
        return -EINVAL;
    };

    return 0;
}