<busconfig>
<policy user="root">
<allow own="net.mesh"/>
+ <allow own="net.mesh.manager"/>
<allow send_destination="net.mesh"/>
+ <allow send_destination="net.mesh.manager"/>
<allow receive_sender="net.mesh"/>
</policy>
<policy context="default">
- <check send_destination="net.mesh" send_interface="net.mesh" privilege="http://tizen.org/privilege/mesh" />
+ <allow send_destination="net.mesh" send_interface="net.mesh" />
+ <allow send_destination="net.mesh.manager" send_interface="net.mesh.manager" />
+
+ <!-- Manager -->
+ <check send_destination="net.mesh.manager" send_interface="net.mesh.manager"
+ send_member="enable" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh.manager" send_interface="net.mesh.manager"
+ send_member="disable" privilege="http://tizen.org/privilege/mesh"/>
+
+ <!-- Normal methods -->
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="scan" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="specific_scan" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="cancel_scan" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="get_found_mesh_networks" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="get_connected_peers" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="enable_mesh" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="disable_mesh" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="get_joined_mesh_network" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="set_gate" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="unset_gate" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="set_softap" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="enable_softap" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="disable_softap" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="create_mesh_network" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="connect_mesh_network" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="disconnect_mesh_network" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="forget_mesh_network" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="set_interfaces" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="get_station_info" privilege="http://tizen.org/privilege/mesh"/>
+ <check send_destination="net.mesh" send_interface="net.mesh"
+ send_member="get_mpath_info" privilege="http://tizen.org/privilege/mesh"/>
+
</policy>
</busconfig>
MESH_LOGE("Failed to get external interface state !");
return MESHD_ERROR_OPERATION_FAILED;
}
+ MESH_LOGD(" Ethernet cable state [%s]",
+ (state) ? "Connected" : "Disconnected");
- if (state) {
- /* Turn STP on */
- ret = mesh_bridge_set_stp(bridge_interface, TRUE);
- if (MESHD_ERROR_NONE != ret) {
- MESH_LOGE("Failed to turn STP on !");
- return ret;
- }
-
- /* Set mesh parameters */
- ret = mesh_netlink_set_mesh_parameter(mesh_interface,
- "mesh_hwmp_rootmode", 4);
- if (MESHD_ERROR_NONE != ret)
- MESH_LOGE("Failed to set [mesh_hwmp_rootmode] : 4");
-
- ret = mesh_netlink_set_mesh_parameter(mesh_interface,
- "mesh_gate_announcements", 1);
- if (MESHD_ERROR_NONE != ret)
- MESH_LOGE("Failed to set [mesh_gate_announcements] : 1");
- } else {
- MESH_LOGE("External interface is not available !");
- return MESHD_ERROR_OPERATION_FAILED;
+ /* Turn STP on */
+ ret = mesh_bridge_set_stp(bridge_interface, TRUE);
+ if (MESHD_ERROR_NONE != ret) {
+ MESH_LOGE("Failed to turn STP on !");
+ return ret;
}
+ /* Set mesh parameters */
+ ret = mesh_netlink_set_mesh_parameter(mesh_interface,
+ "mesh_hwmp_rootmode", 4);
+ if (MESHD_ERROR_NONE != ret)
+ MESH_LOGE("Failed to set [mesh_hwmp_rootmode] : 4");
+
+ ret = mesh_netlink_set_mesh_parameter(mesh_interface,
+ "mesh_gate_announcements", 1);
+ if (MESHD_ERROR_NONE != ret)
+ MESH_LOGE("Failed to set [mesh_gate_announcements] : 1");
+
return MESHD_ERROR_NONE;
}
if (service->mesh_activated) {
/* Already activated */
- manager_complete_enable(object, invocation,
- MESHD_ERROR_OPERATION_FAILED);
- } else {
- /* Do API response first */
- manager_complete_enable(object, invocation, ret);
- service->mesh_activated = TRUE;
+ manager_complete_enable(object, invocation, MESHD_ERROR_NONE);
+ goto FINISH;
}
+ /* Do API response first */
+ manager_complete_enable(object, invocation, ret);
+ service->mesh_activated = TRUE;
+
meshd_check_null_ret_error("info", info, FALSE);
/* Register event handler first */
MESH_LOGE("Failed to mesh_interface_initialize [%d]", ret);
goto FINISH;
}
-#if 0
- ret = mesh_request_load_saved_mesh_network(&service->saved_mesh_network);
- if (MESHD_ERROR_NONE != ret) {
- MESH_LOGE("Failed to mesh_request_load_saved_mesh_network [%d]", ret);
- goto FINISH;
- }
-#endif
+
FINISH:
net_mesh_emit_mesh_enabled(meshd_dbus_get_object(), ret);