int wmesh_gdbus_get_connected_peers(wmesh_service *service);
int wmesh_gdbus_create_network(wmesh_service *service, gchar *mesh_id,
- gint channel, wmeshd_security_type_e sec);
+ gint channel, wmeshd_security_type_e sec, wmeshd_pmf_type_e pmf);
int wmesh_gdbus_set_passphrase(wmesh_service *service, wmesh_scan_result_s *info,
gchar *passphrase);
int wmesh_gdbus_connect_network(wmesh_service *service, wmesh_scan_result_s *info);
int wmesh_request_get_connected_peers(wmesh_service *service);
int wmesh_request_create_mesh_network(wmesh_service *service, gchar *mesh_id,
- gint channel, wmeshd_security_type_e sec);
+ gint channel, wmeshd_security_type_e sec, wmeshd_pmf_type_e pmf);
int wmesh_request_connect_mesh_network(wmesh_service *service, gchar *mesh_id,
gint channel, wmeshd_security_type_e sec, gchar *passphrase);
int wmesh_request_disconnect_mesh_network(wmesh_service *service,
WMESHD_SECURITY_SAE, /**< SAE */
} wmeshd_security_type_e;
+/**< Internal enum for pmf(Protected Management frame), it should be matched with API side. */
+typedef enum {
+ WMESHD_PMF_NONE = 0, /**< No pmf */
+ WMESHD_PMF_OPTIONAL, /**< Optional pmf */
+ WMESHD_PMF_REQUIRED, /**< mandatory pmf */
+} wmeshd_pmf_type_e;
+
/**< Internal enum for IP Config Type */
typedef enum {
WMESHD_IP_CONFIG_TYPE_UNKNOWN = 0, /**< Unknown */
char* bssid; /**< BSSID */
int channel; /**< Channel */
wmeshd_security_type_e security; /**< Security type */
+ wmeshd_pmf_type_e pmf; /**< Pmf type */
wmeshd_connection_state_e state; /**< Connection state */
wmeshd_ip_config_type_e ipv4_type; /**< IPv4 Config Type */
char *ipv4_address; /**< IPv4 Address */
<arg type="s" name="mesh_id" direction="in"/>\r
<arg type="i" name="channel" direction="in"/>\r
<arg type="i" name="security" direction="in"/>\r
+ <arg type="i" name="pmf" direction="in"/>\r
<arg type="i" name="result" direction="out"/>\r
</method>\r
<method name="connect_mesh_network">\r
const gchar *signal_name, GVariant *parameters, gpointer user_data)
{
wmesh_service *service = (wmesh_service*)user_data;
- wmesh_network_info_s network_info = { 0, 0, 0, 0, 0, 0, 0, 0};
+ wmesh_network_info_s network_info = { 0, };
int ret = WMESHD_ERROR_NONE;
wmeshd_check_null_ret("user_data", user_data);
joined_info->security = WMESHD_SECURITY_SAE;
else
joined_info->security = WMESHD_SECURITY_NONE;
+ } else if (strcasecmp(key, "Pmf") == 0) {
+ joined_info->pmf = g_variant_get_uint16(val);
} else if (strcasecmp(key, "Frequency") == 0) {
joined_info->channel = __frequency_to_channel(g_variant_get_uint16(val));
} else if (strcasecmp(key, "IPv4") == 0) {
}
int wmesh_gdbus_create_network(wmesh_service *service, gchar *mesh_id,
- gint channel, wmeshd_security_type_e sec)
+ gint channel, wmeshd_security_type_e sec, wmeshd_pmf_type_e pmf)
{
GVariant *variant = NULL;
GError *error = NULL;
g_variant_builder_add(&builder, "v", g_variant_new_string(security));
g_variant_builder_close(&builder); /* {sv} */
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("{sv}"));
+ g_variant_builder_add(&builder, "s", "Pmf");
+ g_variant_builder_add(&builder, "v", g_variant_new_uint16(pmf));
+ g_variant_builder_close(&builder); /* {sv} */
+
g_variant_builder_close(&builder); /* a{sv} */
var_dict = g_variant_builder_end(&builder);
}
int wmesh_request_create_mesh_network(wmesh_service *service, gchar *mesh_id,
- gint channel, wmeshd_security_type_e sec)
+ gint channel, wmeshd_security_type_e sec, wmeshd_pmf_type_e pmf)
{
int ret;
WMESH_LOGD("[IPC] Create a new mesh network");
- ret = wmesh_gdbus_create_network(service, mesh_id, channel, sec);
+ ret = wmesh_gdbus_create_network(service, mesh_id, channel, sec, pmf);
if (WMESHD_ERROR_NONE != ret) {
/* LCOV_EXCL_START */
WMESH_LOGE("Failed to create mesh network");
static gboolean _wmeshd_dbus_handle_create_mesh_network(NetWmesh *object,
GDBusMethodInvocation *invocation,
- gchar *mesh_id, gint channel, gint security,
+ gchar *mesh_id, gint channel, gint security, gint pmf,
gpointer user_data)
{
int ret = WMESHD_ERROR_NONE;
wmesh_service *service = (wmesh_service *)user_data;
wmeshd_security_type_e sec = (1 == security) ? WMESHD_SECURITY_SAE : WMESHD_SECURITY_NONE;
- ret = wmesh_request_create_mesh_network(service, mesh_id, channel, sec);
+ ret = wmesh_request_create_mesh_network(service, mesh_id, channel, sec, pmf);
net_wmesh_complete_create_mesh_network(object, invocation, ret);