wlan_common/ie/wsc/
fields.rs

1// Copyright 2020 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use zerocopy::{FromBytes, Immutable, IntoBytes, KnownLayout, Unaligned};
6
7/// WSC Technical Specification v2.0.7, Section 8.2.5, Table 7 and Section 12, Table 28
8#[derive(Eq, PartialEq, Hash, Clone, Debug)]
9pub struct ProbeRespWsc {
10    pub version: u8,
11    pub wps_state: WpsState,
12    pub ap_setup_locked: bool,
13    pub selected_reg: bool,
14    pub selected_reg_config_methods: Option<[u8; 2]>,
15    pub response_type: u8,
16    pub uuid_e: [u8; 16],
17    pub manufacturer: Vec<u8>,
18    pub model_name: Vec<u8>,
19    pub model_number: Vec<u8>,
20    pub serial_number: Vec<u8>,
21    pub primary_device_type: [u8; 8],
22    pub device_name: Vec<u8>,
23    pub config_methods: [u8; 2],
24    pub rf_bands: Option<u8>,
25    pub vendor_ext: Vec<u8>,
26    // there may be other non-specific permitted attributes at the end, but we don't process them
27}
28
29#[repr(C, packed)]
30#[derive(
31    Eq, PartialEq, Hash, IntoBytes, KnownLayout, FromBytes, Immutable, Unaligned, Copy, Clone, Debug,
32)]
33pub struct WpsState(pub u8);
34
35impl WpsState {
36    pub const NOT_CONFIGURED: Self = Self(0x01);
37    pub const CONFIGURED: Self = Self(0x02);
38}