supplicant(interface): Add interface for WPS

Add the methods/callbacks required for WPS functionality through
wpa_supplicant.

Bug: 34198758
Test: Compiles
Change-Id: Iff1450621a4b039307ad6098f98326c35e53d4c6
This commit is contained in:
Roshan Pius
2017-01-10 14:10:19 -08:00
parent 0bb0ba5f79
commit 08e6bbacf2
3 changed files with 171 additions and 0 deletions

View File

@@ -537,4 +537,57 @@ interface ISupplicantP2pIface extends ISupplicantIface {
*/
setMiracastMode(MiracastMode mode)
generates (SupplicantStatus status);
/**
* Initiate WPS Push Button setup.
* The PBC operation requires that a button is also pressed at the
* AP/Registrar at about the same time (2 minute window).
*
* @param groupIfName Group interface name to use.
* @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
startWpsPbc(string groupIfName, Bssid bssid)
generates (SupplicantStatus status);
/**
* Initiate WPS Pin Keypad setup.
*
* @param groupIfName Group interface name to use.
* @param pin 8 digit pin to be used.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
startWpsPinKeypad(string groupIfName, string pin)
generates (SupplicantStatus status);
/**
* Initiate WPS Pin Display setup.
*
* @param groupIfName Group interface name to use.
* @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
* @return generatedPin 8 digit pin generated.
*/
startWpsPinDisplay(string groupIfName, Bssid bssid)
generates (SupplicantStatus status, string generatedPin);
/**
* Cancel any ongoing WPS operations.
*
* @param groupIfName Group interface name to use.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
cancelWps(string groupIfName) generates (SupplicantStatus status);
};

View File

@@ -319,4 +319,64 @@ interface ISupplicantStaIface extends ISupplicantIface {
*/
setCountryCode(int8_t[2] code)
generates (SupplicantStatus status);
/**
* Initiate WPS setup in registrar role to learn the current AP configuration.
*
* @param bssid BSSID of the AP.
* @param pin Pin of the AP.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
startWpsRegistrar(Bssid bssid, string pin)
generates (SupplicantStatus status);
/**
* Initiate WPS Push Button setup.
* The PBC operation requires that a button is also pressed at the
* AP/Registrar at about the same time (2 minute window).
*
* @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
startWpsPbc(Bssid bssid) generates (SupplicantStatus status);
/**
* Initiate WPS Pin Keypad setup.
*
* @param pin 8 digit pin to be used.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
startWpsPinKeypad(string pin) generates (SupplicantStatus status);
/**
* Initiate WPS Pin Display setup.
*
* @param bssid BSSID of the AP. Use zero'ed bssid to indicate wildcard.
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
* @return generatedPin 8 digit pin generated.
*/
startWpsPinDisplay(Bssid bssid)
generates (SupplicantStatus status, string generatedPin);
/**
* Cancel any ongoing WPS operations.
*
* @return status Status of the operation.
* Possible status codes:
* |SupplicantStatusCode.SUCCESS|,
* |SupplicantStatusCode.FAILURE_UNKNOWN|
*/
cancelWps() generates (SupplicantStatus status);
};

View File

@@ -138,6 +138,43 @@ interface ISupplicantStaIfaceCallback {
vec<uint8_t> osuProvidersList;
};
/**
* WPS Configuration Error.
*/
enum WpsConfigError : uint16_t {
NO_ERROR = 0,
OOB_IFACE_READ_ERROR = 1,
DECRYPTION_CRC_FAILURE = 2,
CHAN_24_NOT_SUPPORTED = 3,
CHAN_50_NOT_SUPPORTED = 4,
SIGNAL_TOO_WEAK = 5,
NETWORK_AUTH_FAILURE = 6,
NETWORK_ASSOC_FAILURE = 7,
NO_DHCP_RESPONSE = 8,
FAILED_DHCP_CONFIG = 9,
IP_ADDR_CONFLICT = 10,
NO_CONN_TO_REGISTRAR = 11,
MULTIPLE_PBC_DETECTED = 12,
ROGUE_SUSPECTED = 13,
DEVICE_BUSY = 14,
SETUP_LOCKED = 15,
MSG_TIMEOUT = 16,
REG_SESS_TIMEOUT = 17,
DEV_PASSWORD_AUTH_FAILURE = 18,
CHAN_60G_NOT_SUPPORTED = 19,
PUBLIC_KEY_HASH_MISMATCH = 20
};
/**
* Vendor specific Error Indication for WPS event messages.
*/
enum WpsErrorIndication : uint16_t {
NO_ERROR = 0,
SECURITY_TKIP_ONLY_PROHIBITED = 1,
SECURITY_WEP_PROHIBITED = 2,
AUTH_FAILURE = 3
};
/**
* Used to indicate that a new network has been added.
*
@@ -242,4 +279,25 @@ interface ISupplicantStaIfaceCallback {
* Refer to section 8.4.1.9 of IEEE 802.11 spec.
*/
oneway onAssociationRejected(Bssid bssid, uint32_t statusCode);
/**
* Used to indicate the success of a WPS connection attempt.
*/
oneway onWpsEventSuccess();
/**
* Used to indicate the failure of a WPS connection attempt.
*
* @param bssid BSSID of the AP to which we initiated WPS
* connection.
* @param configError Configuration error code.
* @param errorInd Error indication code.
*/
oneway onWpsEventFail(
Bssid bssid, WpsConfigError configError, WpsErrorIndication errorInd);
/**
* Used to indicate the overlap of a WPS PBC connection attempt.
*/
oneway onWpsEventPbcOverlap();
};