MESH_SECURITY_SAE, /**< Simultaneous Authentication of Equals */
} wifi_mesh_security_type_e;
+/**
+ * @brief Enumeration for the pmf(Protected management Frames) type of the Wi-Fi Mesh network.
+ * @since_tizen 5.0
+ */
+typedef enum {
+ MESH_PMF_NONE = 0, /**< PMF in not available */
+ MESH_PMF_OPTIONAL, /**< PMF is optional */
+ MESH_PMF_REQUIRED, /**< PMF is mandatory */
+} wifi_mesh_pmf_type_e;
+
/**
* @brief Enumeration for the connection state of the Wi-Fi Mesh network.
* @since_tizen 5.0
* @param[in] rssi The Received Signal Strength Indicator
* @param[in] security The security type for network
* @param[in] passphrase The passphrase for network connection
+ * @param[in] pmf The pmf type for network connection
*
* @return 0 on success, otherwise a negative error value.
* @retval #WIFI_MESH_ERROR_NONE Successful
*/
int wifi_mesh_network_new_with(wifi_mesh_network_h* network, const char *meshid,
const char *bssid, int channel, int rssi, wifi_mesh_security_type_e security,
- const char *passphrase);
+ const char *passphrase, wifi_mesh_pmf_type_e pmf);
/**
* @brief Destroys network handle.
int wifi_mesh_network_set_security(wifi_mesh_network_h network,
wifi_mesh_security_type_e security);
+/**
+ * @brief Gets the pmf type.
+ * @details This function is to get the pmf type.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] network The Wi-Fi mesh network information handle.
+ * @param[out] pmf The pmf type for network.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #WIFI_MESH_ERROR_NONE Successful
+ * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see wifi_mesh_network_set_pmf()
+ *
+ */
+int wifi_mesh_network_get_pmf(wifi_mesh_network_h network,
+ wifi_mesh_pmf_type_e *pmf);
+
+/**
+ * @brief Sets the pmf type.
+ * @details This function is to set the pmf type.
+ *
+ * @since_tizen 5.0
+ *
+ * @param[in] network The Wi-Fi mesh network information handle.
+ * @param[in] pmf The pmf type for network.
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #WIFI_MESH_ERROR_NONE Successful
+ * @retval #WIFI_MESH_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see wifi_mesh_network_get_pmf()
+ *
+ */
+int wifi_mesh_network_set_pmf(wifi_mesh_network_h network,
+ wifi_mesh_pmf_type_e pmf);
+
/**
* @brief Sets the passphrase for network connection.
* @details This function is to set the passphrase.
int rssi; /**< RSSI */
int data_rate; /**< Data rate */
wifi_mesh_security_type_e security; /**< Security type */
+ wifi_mesh_pmf_type_e pmf; /**< Pmf type */
char passphrase[MAX_PASSPHRASE_LEN]; /**< Passphrase */
wifi_mesh_connection_state_e state; /**< Connection state */
wifi_mesh_ip_config_type_e ipv4_type; /**< IPv4 Config Type */
}
variant = g_dbus_proxy_call_sync(_gproxy_mesh_service, "create_mesh_network",
- g_variant_new("(sii)", n->meshid, n->channel, n->security),
+ g_variant_new("(siii)", n->meshid, n->channel, n->security, n->pmf),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL, &error);
net->rssi = _src->rssi;
net->data_rate = _src->data_rate;
net->security = _src->security;
+ net->pmf = _src->pmf;
if (strlen(_src->passphrase) > 0)
snprintf(net->passphrase, MAX_PASSPHRASE_LEN, "%s", _src->passphrase);
EXPORT_API int wifi_mesh_network_new_with(wifi_mesh_network_h* network, const char *meshid,
const char *bssid, int channel, int rssi, wifi_mesh_security_type_e security,
- const char *passphrase)
+ const char *passphrase, wifi_mesh_pmf_type_e pmf)
{
struct mesh_network_s *net;
net->channel = channel;
net->rssi = rssi;
net->security = security;
+ net->pmf = pmf;
if (passphrase)
snprintf(net->passphrase, MAX_PASSPHRASE_LEN, "%s", passphrase);
return WIFI_MESH_ERROR_NONE;
}
+EXPORT_API int wifi_mesh_network_get_pmf(wifi_mesh_network_h network, wifi_mesh_pmf_type_e *pmf)
+{
+ struct mesh_network_s *net = (struct mesh_network_s *)network;
+
+ CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+ if (NULL == network || NULL == pmf) {
+ /* LCOV_EXCL_START */
+ LOGE("Invalid parameter");
+ return WIFI_MESH_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+
+ *pmf = net->pmf;
+
+ return WIFI_MESH_ERROR_NONE;
+}
+
+EXPORT_API int wifi_mesh_network_set_pmf(wifi_mesh_network_h network, wifi_mesh_pmf_type_e pmf)
+{
+ struct mesh_network_s *net = (struct mesh_network_s *)network;
+
+ CHECK_FEATURE_SUPPORTED(MESH_FEATURE);
+
+ if (NULL == network) {
+ /* LCOV_EXCL_START */
+ LOGE("Invalid parameter");
+ return WIFI_MESH_ERROR_INVALID_PARAMETER;
+ /* LCOV_EXCL_STOP */
+ }
+
+ net->pmf = pmf;
+
+ return WIFI_MESH_ERROR_NONE;
+}
+
EXPORT_API int wifi_mesh_network_set_passphrase(wifi_mesh_network_h network, const char* passphrase)
{
struct mesh_network_s *net = (struct mesh_network_s *)network;
static char meshid[MENU_DATA_SIZE + 1] = "meshnet";
static char mesh_channel[MENU_DATA_SIZE + 1] = "161";
static char mesh_security[MENU_DATA_SIZE + 1] = "0";
+static char mesh_pmf[MENU_DATA_SIZE + 1] = "0";
static char mesh_passphrase[MENU_DATA_SIZE + 1] = "";
static char network_idx[MENU_DATA_SIZE + 1] = "1";
int ret;
int _mesh_channel = 1;
wifi_mesh_security_type_e security = MESH_SECURITY_NONE;
+ wifi_mesh_pmf_type_e pmf = MESH_PMF_NONE;
wifi_mesh_network_h net = NULL;
msg("Create a new Mesh Network");
security = ((1 == ret) ? MESH_SECURITY_SAE : MESH_SECURITY_NONE);
}
+ if (strlen(mesh_pmf)) {
+ ret = (unsigned short)strtol(mesh_pmf, NULL, 10);
+ pmf = ((2 < ret) ? MESH_PMF_NONE : ret);
+ }
+
wifi_mesh_network_new_with(&net, meshid, NULL, _mesh_channel, 0,
- security, security == MESH_SECURITY_SAE ? mesh_passphrase : NULL);
+ security, security == MESH_SECURITY_SAE ? mesh_passphrase : NULL, pmf);
ret = wifi_mesh_create_network(mesh, net);
wifi_mesh_network_destroy(net);
if (WIFI_MESH_ERROR_NONE != ret) {
{ "1", "Mesh ID", NULL, NULL, meshid },
{ "2", "Channel", NULL, NULL, mesh_channel },
{ "3", "Security (0=None,1=SAE)", NULL, NULL, mesh_security },
- { "4", "Passphrase", NULL, NULL, mesh_passphrase },
- { "5", "Run", NULL, run_create_network, NULL },
+ { "4", "PMF (0=None,1=OPTIONAL,2=REQUIRED)", NULL, NULL, mesh_pmf },
+ { "5", "Passphrase", NULL, NULL, mesh_passphrase },
+ { "6", "Run", NULL, run_create_network, NULL },
{ NULL, NULL, },
};