blob: f19cc34d74efe3d226fae1d68522caa11691980e [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.wlan.policy;
using fuchsia.wlan.ieee80211 as ieee80211;
// Basic definitions for wlan APIs.
/// High level protection type for the network. This does not convey all details needed
/// for the mechanism of the connection, but is primarily used to map the target network
/// to proper scan results.
type SecurityType = strict enum {
NONE = 1;
WEP = 2;
WPA = 3;
WPA2 = 4;
WPA3 = 5;
};
/// Primary means of distinguishing between available networks - the combination of
/// the (mostly) human recognizable name and the security type. The security type is used
/// to distinguish between different network protection (or lack thereof) types.
type NetworkIdentifier = struct {
/// Network name, often used by users to choose between networks in the UI.
ssid ieee80211.Ssid;
/// Protection type (or not) for the network.
type SecurityType;
};
/// Network information used to establish a connection.
type NetworkConfig = table {
/// Identifier used to represent a specific network. No guarantee for uniqueness.
1: id NetworkIdentifier;
/// Information needed to join a network.
2: credential Credential;
};
/// Information used to verify access to a target network.
type Credential = flexible union {
/// The network does not use credentials (open networks).
1: none Empty;
/// Plaintext password (handled as binary data).
2: password vector<uint8>:MAX;
/// Hash representation of the network passphrase (handled as binary data).
3: psk vector<uint8>:MAX;
};
/// Operating band for wlan control request and status updates.
type OperatingBand = strict enum {
/// Allows for band switching depending on device operating mode and environment.
ANY = 1;
/// Restricted to 2.4 GHz bands only.
ONLY_2_4GHZ = 2;
/// Restricted to 5 GHz bands only.
ONLY_5GHZ = 3;
};
/// Empty struct used in place of optional values.
// TODO: https://fxbug.dev/42159332
type Empty = struct {};