<arg type="as" name="resource_types" direction="in"/>
<arg type="i" name="ifaces" direction="in"/>
<arg type="i" name="properties" direction="in"/>
+ <arg type="b" name="is_lite" direction="in"/>
<arg type="x" name="signal_number" direction="out"/>
<arg type="x" name="resource" direction="out"/>
</method>
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/common/ic-dbus.c
PROPERTIES GENERATED TRUE)
-pkg_check_modules(daemon_pkgs REQUIRED gio-2.0 dlog gio-unix-2.0 capi-system-info
- capi-system-system-settings iotivity)
+SET(PKG_MODULES gio-2.0 dlog gio-unix-2.0 capi-system-info capi-system-system-settings
+ iotivity)
+
+IF(NEW_SECURE)
+ SET(PKG_MODULES ${PKG_MODULES} cynara-client cynara-session cynara-creds-gdbus)
+ ADD_DEFINITIONS("-DIOTCON_CYNARA")
+ENDIF(NEW_SECURE)
+
+pkg_check_modules(daemon_pkgs REQUIRED ${PKG_MODULES})
FOREACH(flag ${daemon_pkgs_CFLAGS_OTHER})
IF(${flag} MATCHES "\\-D+")
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdlib.h>
+#include <glib.h>
+#include <gio/gio.h>
+#ifdef IOTCON_CYNARA
+#include <cynara-client.h>
+#include <cynara-session.h>
+#include <cynara-creds-gdbus.h>
+#endif
+
+#include "iotcon.h"
+#include "ic-common.h"
+#include "icd.h"
+#include "icd-cynara.h"
+
+static const char *_icd_privileges_network[] = {
+ /* network */
+ "http://tizen.org/privilege/bluetooth",
+ "http://tizen.org/privilege/network.get",
+ "http://tizen.org/privilege/wifidirect",
+ NULL,
+};
+
+static const char *_icd_privileges_data[] = {
+ /* network */
+ "http://tizen.org/privilege/bluetooth",
+ "http://tizen.org/privilege/network.get",
+ "http://tizen.org/privilege/wifidirect",
+ /* data */
+ "http://tizen.org/privilege/d2d.datasharing",
+ NULL,
+};
+
+static const char *_icd_privileges_device[] = {
+ /* network */
+ "http://tizen.org/privilege/bluetooth",
+ "http://tizen.org/privilege/network.get",
+ "http://tizen.org/privilege/wifidirect",
+ /* data */
+ "http://tizen.org/privilege/d2d.datasharing",
+ /* device */
+ "http://tizen.org/privilege/systemsettings",
+ NULL,
+};
+
+#ifdef IOTCON_CYNARA
+static cynara *_cynara;
+#endif
+
+int icd_cynara_init()
+{
+#ifdef IOTCON_CYNARA
+ int ret;
+ ret = cynara_initialize(&_cynara, NULL);
+
+ if (CYNARA_API_SUCCESS != ret) {
+ ERR("cynara_initialize() Fail(%d)", ret);
+ return IOTCON_ERROR_SYSTEM;
+ }
+#endif
+
+ return IOTCON_ERROR_NONE;
+}
+
+void icd_cynara_deinit()
+{
+#ifdef IOTCON_CYNARA
+ if (_cynara)
+ cynara_finish(_cynara);
+
+ _cynara = NULL;
+#endif
+}
+
+
+static int _icd_cynara_check(GDBusMethodInvocation *invocation, const char **privileges)
+{
+#ifdef IOTCON_CYNARA
+ FN_CALL;
+ int i = 0;
+ int ret;
+ pid_t pid;
+ char *user = NULL;
+ char *client = NULL;
+ char *session = NULL;
+ const char *sender = NULL;
+ GDBusConnection *conn = NULL;
+
+ RETV_IF(NULL == _cynara, IOTCON_ERROR_SYSTEM);
+ RETV_IF(NULL == invocation, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == privileges, IOTCON_ERROR_INVALID_PARAMETER);
+
+ conn = g_dbus_method_invocation_get_connection(invocation);
+ if (NULL == conn) {
+ ERR("g_dbus_method_invocation_get_connection() return NULL");
+ return IOTCON_ERROR_SYSTEM;
+ }
+
+ sender = g_dbus_method_invocation_get_sender(invocation);
+ if (NULL == sender) {
+ ERR("g_dbus_method_invocation_get_sender() return NULL");
+ return IOTCON_ERROR_SYSTEM;
+ }
+
+ ret = cynara_creds_gdbus_get_client(conn, sender, CLIENT_METHOD_SMACK, &client);
+ if (CYNARA_API_SUCCESS != ret) {
+ ERR("cynara_creds_dbus_get_client() Fail(%d)", ret);
+ return IOTCON_ERROR_SYSTEM;
+ }
+
+ ret = cynara_creds_gdbus_get_user(conn, sender, USER_METHOD_UID, &user);
+ if (CYNARA_API_SUCCESS != ret) {
+ ERR("cynara_creds_dbus_get_user() Fail(%d)", ret);
+ free(client);
+ return IOTCON_ERROR_SYSTEM;
+ }
+
+ ret = cynara_creds_gdbus_get_pid(conn, sender, &pid);
+ if (CYNARA_API_SUCCESS != ret) {
+ ERR("cynara_creds_gdbus_get_pid() Fail(%d)", ret);
+ free(user);
+ free(client);
+ return IOTCON_ERROR_SYSTEM;
+ }
+
+ session = cynara_session_from_pid(pid);
+ if (NULL == session) {
+ ERR("cynara_session_from_pid() return NULL");
+ free(user);
+ free(client);
+ return IOTCON_ERROR_SYSTEM;
+ }
+
+ while (privileges[i]) {
+ SECURE_DBG("privileges[%d]: %s, user: %s, client: %s", i, privileges[i], user, client);
+ ret = cynara_check(_cynara, client, session, user, privileges[i]);
+ if (CYNARA_API_ACCESS_DENIED == ret) {
+ ERR("Denied (%s)", privileges[i]);
+ free(session);
+ free(user);
+ free(client);
+ return IOTCON_ERROR_PERMISSION_DENIED;
+ } else if (CYNARA_API_ACCESS_ALLOWED != ret) {
+ ERR("cynara_check(%s) Fail(%d)", privileges[i], ret);
+ free(session);
+ free(user);
+ free(client);
+ return IOTCON_ERROR_SYSTEM;
+ }
+ i++;
+ }
+ free(session);
+ free(user);
+ free(client);
+#endif
+ return IOTCON_ERROR_NONE;
+}
+
+
+int icd_cynara_check_network(GDBusMethodInvocation *invocation)
+{
+ int ret;
+
+ ret = _icd_cynara_check(invocation, _icd_privileges_network);
+ if (IOTCON_ERROR_NONE != ret)
+ ERR("_icd_cynara_check() Fail(%d)", ret);
+
+ return ret;
+}
+
+
+int icd_cynara_check_data(GDBusMethodInvocation *invocation)
+{
+ int ret;
+
+ ret = _icd_cynara_check(invocation, _icd_privileges_data);
+ if (IOTCON_ERROR_NONE != ret)
+ ERR("_icd_cynara_check() Fail(%d)", ret);
+
+ return ret;
+}
+
+
+int icd_cynara_check_device(GDBusMethodInvocation *invocation)
+{
+ int ret;
+
+ ret = _icd_cynara_check(invocation, _icd_privileges_device);
+ if (IOTCON_ERROR_NONE != ret)
+ ERR("_icd_cynara_check() Fail(%d)", ret);
+
+ return ret;
+}
+
+
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __IOT_CONNECTIVITY_MANAGER_DAEMON_CYNARA_H__
+#define __IOT_CONNECTIVITY_MANAGER_DAEMON_CYNARA_H__
+
+#include <gio/gio.h>
+
+int icd_cynara_init();
+void icd_cynara_deinit();
+int icd_cynara_check_network(GDBusMethodInvocation *invocation);
+int icd_cynara_check_data(GDBusMethodInvocation *invocation);
+int icd_cynara_check_device(GDBusMethodInvocation *invocation);
+
+#endif /*__IOT_CONNECTIVITY_MANAGER_DAEMON_CYNARA_H__*/
#include "ic-dbus.h"
#include "icd.h"
#include "icd-ioty.h"
+#include "icd-cynara.h"
#include "icd-dbus.h"
static icDbus *icd_dbus_object;
const gchar *uri_path,
const gchar* const *resource_types,
gint ifaces,
- gint properties)
+ gint properties,
+ gboolean is_lite)
{
FN_CALL;
int ret;
OCResourceHandle handle;
int64_t signal_number = 0;
+ if (true == is_lite) {
+ ret = icd_cynara_check_data(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_data() Fail(%d)", ret);
+ ic_dbus_complete_register_resource(object, invocation, signal_number, ret);
+ return TRUE;
+ }
+ } else {
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_register_resource(object, invocation, signal_number, ret);
+ return TRUE;
+ }
+ }
+
handle = icd_ioty_register_resource(uri_path, resource_types, ifaces, properties);
if (handle) {
sender = g_dbus_method_invocation_get_sender(invocation);
sender = g_dbus_method_invocation_get_sender(invocation);
_icd_dbus_resource_list_remove(sender, ICD_INT64_TO_POINTER(resource));
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_unregister_resource(object, invocation);
+ return TRUE;
+ }
+
ret = icd_ioty_unregister_resource(ICD_INT64_TO_POINTER(resource));
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_unregister_resource() Fail(%d)", ret);
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_bind_interface(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_bind_interface(ICD_INT64_TO_POINTER(resource), iface);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_bind_interface() Fail(%d)", ret);
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_bind_type(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_bind_type(ICD_INT64_TO_POINTER(resource), type);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_bind_type() Fail(%d)", ret);
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_bind_resource(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_bind_resource(ICD_INT64_TO_POINTER(parent),
ICD_INT64_TO_POINTER(child));
if (IOTCON_ERROR_NONE != ret)
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_unbind_resource(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_unbind_resource(ICD_INT64_TO_POINTER(parent),
ICD_INT64_TO_POINTER(child));
if (IOTCON_ERROR_NONE != ret)
const gchar *sender;
int64_t signal_number;
+ signal_number = icd_dbus_generate_signal_number();
+
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_find_resource(object, invocation, signal_number, ret);
+ return TRUE;
+ }
+
sender = g_dbus_method_invocation_get_sender(invocation);
- signal_number = icd_dbus_generate_signal_number();
ret = icd_ioty_find_resource(host_address, connectivity, type, is_secure, timeout,
signal_number, sender);
if (IOTCON_ERROR_NONE != ret)
{
int ret;
const gchar *sender;
- OCDoHandle observe_h;
int64_t signal_number;
+ OCDoHandle observe_h = 0;
signal_number = icd_dbus_generate_signal_number();
+
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_observer_start(object, invocation, signal_number,
+ ICD_POINTER_TO_INT64(observe_h));
+ return TRUE;
+ }
+
sender = g_dbus_method_invocation_get_sender(invocation);
observe_h = icd_ioty_observer_start(resource, observe_policy, query,
int ret;
const gchar *sender;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_observer_stop(object, invocation, ret);
+ return TRUE;
+ }
+
sender = g_dbus_method_invocation_get_sender(invocation);
_icd_dbus_observe_list_remove(sender, ICD_INT64_TO_POINTER(observe_h));
{
int ret;
+ /* iotcon_resource_notify()
+ * iotcon_lite_resource_update_state() */
+ ret = icd_cynara_check_data(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_data() Fail(%d)", ret);
+ ic_dbus_complete_notify(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_notify(ICD_INT64_TO_POINTER(resource), notify_msg, observers);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_notify() Fail(%d)", ret);
{
int ret;
+ ret = icd_cynara_check_data(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_data() Fail(%d)", ret);
+ ic_dbus_complete_send_response(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_send_response(response);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_send_response() Fail(%d)", ret);
int64_t signal_number;
signal_number = icd_dbus_generate_signal_number();
+
+ ret = icd_cynara_check_device(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_device() Fail(%d)", ret);
+ ic_dbus_complete_get_device_info(object, invocation, signal_number, ret);
+ return TRUE;
+ }
+
sender = g_dbus_method_invocation_get_sender(invocation);
ret = icd_ioty_get_info(ICD_DEVICE_INFO, host_address, connectivity, timeout,
int64_t signal_number;
signal_number = icd_dbus_generate_signal_number();
+
+ ret = icd_cynara_check_data(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_data() Fail(%d)", ret);
+ ic_dbus_complete_get_platform_info(object, invocation, signal_number, ret);
+ return TRUE;
+ }
+
sender = g_dbus_method_invocation_get_sender(invocation);
ret = icd_ioty_get_info(ICD_PLATFORM_INFO, host_address, connectivity, timeout,
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_start_presence(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_start_presence(time_to_live);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_start_presence() Fail(%d)", ret);
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_start_presence(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_stop_presence();
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_stop_presence() Fail(%d)", ret);
{
int ret;
const gchar *sender;
- OCDoHandle presence_h;
+ OCDoHandle presence_h = NULL;
+
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_subscribe_presence(object, invocation,
+ ICD_POINTER_TO_INT64(presence_h));
+ return TRUE;
+ }
presence_h = icd_ioty_subscribe_presence(ICD_PRESENCE, host_address, connectivity,
type, NULL);
int ret;
const gchar *sender;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_unsubscribe_presence(object, invocation, ret);
+ return TRUE;
+ }
+
sender = g_dbus_method_invocation_get_sender(invocation);
_icd_dbus_presence_list_remove(sender, ICD_INT64_TO_POINTER(presence_h));
gint connectivity)
{
int ret;
- int64_t signal_number;
+ int64_t signal_number = 0;
+
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_start_monitoring(object, invocation, signal_number, ret);
+ return TRUE;
+ }
ret = icd_ioty_start_encap(ICD_ENCAP_MONITORING, uri_path, host_address,
connectivity, &signal_number);
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_stop_monitoring(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_stop_encap(ICD_ENCAP_MONITORING, uri_path, host_address);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_stop_encap() Fail(%d)", ret);
gint connectivity)
{
int ret;
- int64_t signal_number;
+ int64_t signal_number = 0;
+
+ ret = icd_cynara_check_data(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_data() Fail(%d)", ret);
+ ic_dbus_complete_start_monitoring(object, invocation, signal_number, ret);
+ return TRUE;
+ }
ret = icd_ioty_start_encap(ICD_ENCAP_CACHING, uri_path, host_address,
connectivity, &signal_number);
{
int ret;
+ ret = icd_cynara_check_network(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_network() Fail(%d)", ret);
+ ic_dbus_complete_stop_monitoring(object, invocation, ret);
+ return TRUE;
+ }
+
ret = icd_ioty_stop_encap(ICD_ENCAP_CACHING, uri_path, host_address);
if (IOTCON_ERROR_NONE != ret)
ERR("icd_ioty_stop_encap() Fail(%d)", ret);
#include "ic-dbus.h"
#include "ic-utils.h"
#include "icd.h"
+#include "icd-cynara.h"
#include "icd-payload.h"
#include "icd-dbus.h"
#include "icd-ioty.h"
OCConnectivityType oic_conn_type;
OCDevAddr dev_addr = {0};
+ ret = icd_cynara_check_data(invocation);
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_check_data() Fail(%d)", ret);
+ icd_ioty_complete_error(type, invocation, ret);
+ return TRUE;
+ }
+
switch (type) {
case ICD_CRUD_GET:
cbdata.cb = icd_ioty_ocprocess_get_cb;
break;
default:
ERR("Invalid CRUD Type(%d)", type);
- return FALSE;
+ return TRUE;
}
g_variant_get(resource, "(&s&sba(qs)i)", &uri_path, &host, &is_secure, &options,
#include "icd.h"
#include "icd-dbus.h"
#include "icd-ioty.h"
+#include "icd-cynara.h"
#include "icd-ioty-ocprocess.h"
#define ICD_ALL_INTERFACES "0.0.0.0"
return -1;
}
+ ret = icd_cynara_init();
+ if (IOTCON_ERROR_NONE != ret) {
+ ERR("icd_cynara_init() Fail(%d)", ret);
+ icd_ioty_deinit(thread);
+ icd_dbus_deinit(id);
+ }
+
g_main_loop_run(loop);
+ icd_cynara_deinit();
icd_ioty_deinit(thread);
icd_dbus_deinit(id);
g_main_loop_unref(loop);
}
ic_dbus_call_register_resource_sync(icl_dbus_get_object(), uri_path, types, iface,
- properties, &signal_number, &(resource->handle), NULL, &error);
+ properties, true, &signal_number, &(resource->handle), NULL, &error);
if (error) {
ERR("ic_dbus_call_register_resource_sync() Fail(%s)", error->message);
ret = icl_dbus_convert_dbus_error(error->code);
}
ic_dbus_call_register_resource_sync(icl_dbus_get_object(), uri_path, types, ifaces,
- properties, &signal_number, &(resource->handle), NULL, &error);
+ properties, false, &signal_number, &(resource->handle), NULL, &error);
if (error) {
ERR("ic_dbus_call_register_resource_sync() Fail(%s)", error->message);
ret = icl_dbus_convert_dbus_error(error->code);
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks The length of @a resource_type should be less than or equal to 61.\n
* The @a resource_type must start with a lowercase alphabetic character, followed by a sequence
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] presence_handle The presence handle to be unsubscribed
*
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks The length of @a resource_type should be less than or equal to 61.\n
* The @a resource_type must start with a lowercase alphabetic character, followed by a sequence
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/systemsettings
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] host_address The host address of remote server
* @param[in] connectivity_type The connectivity type
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] host_address The host address of remote server
* @param[in] connectivity_type The connectivity type
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks If @a time_to_live is 0, server will set default value as 60 seconds.\n
* If @a time_to_live is very big, server will set maximum value as (60 * 60 * 24) seconds.
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @return 0 on success, otherwise a negative error value.
* @retval #IOTCON_ERROR_NONE Successful
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @remarks @a uri_path length must be less than or equal 36.\n
* You must destroy @a resource_handle by calling iotcon_lite_resource_destroy()
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks When a normal variable is used, there are only dbus error and permission\n
* denied error. If the errors of this API are not handled, then you must check\n
* @brief Updates state into the lite resource handle
*
* @since_tizen 3.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the lite resource
* @param[in] state The state handle to update
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] resource The handle of the resource
* @param[in] observe_policy The type to specify how client wants to observe.
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] resource The handle of the resource
*
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the resource
* @param[in] query The query to send to server
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the resource
* @param[in] repr The handle of the representation
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the resource
* @param[in] repr The handle of the representation
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the resource
* @param[in] cb The callback function
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the remote resource to be cached
* @param[in] cb The callback function to add into callback list
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] resource The handle of the remote resource
*
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] resource The handle of the remote resource
* @param[in] cb The callback function to add into callback list
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] resource The handle of the remote resource
*
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks @a uri_path length must be less than or equal 36.\n
* You must destroy @a resource by calling iotcon_resource_destroy()
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks When a normal variable is used, there are only dbus error and permission\n
* denied error. If the errors of this API are not handled, then you must check\n
* @details The @a iface could be one of #iotcon_interface_e.
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks Sets only one interface to @a iface. If not, @a iface will be ignored.
*
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @remarks The length of @a resource_type should be less than or equal to 61.\n
* The @a resource_type must start with a lowercase alphabetic character, followed by a sequence
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] parent The handle of the parent resource
* @param[in] child The handle of the child resource to be added to the parent resource
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
*
* @param[in] parent The handle of the parent resource
* @param[in] child The handle of the child resource to be unbound from the parent resource
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resource The handle of the resource
* @param[in] repr The handle of the representation
*
* @since_tizen 3.0
* @privlevel public
- * @privilege %http://tizen.org/privilege/internet
+ * @privilege %http://tizen.org/privilege/bluetooth
+ * @privilege %http://tizen.org/privilege/network.get
+ * @privilege %http://tizen.org/privilege/wifidirect
+ * @privilege %http://tizen.org/privilege/d2d.datasharing
*
* @param[in] resp The handle of the response to send
*
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
- <policy user="root">
+ <policy context="default">
<allow own="@DBUS_INTERFACE@"/>
<allow send_destination="@DBUS_INTERFACE@" send_interface="@DBUS_INTERFACE@"/>
</policy>
-
- <policy context="default">
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="registerResource"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="unregisterResource"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="bindInterface"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="bindType"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="bindResource"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="unbindResource"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="notify"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="sendResponse"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="findResource"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="get"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="put"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="post"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="delete"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="observerStart"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="observerStop"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="getDeviceInfo"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="getPlatformInfo"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="subscribePresence"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="unsubscribePresence"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="startPresence"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="stopPresence"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="startCaching"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="stopCaching"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="startMonitoring"
- privilege="http://tizen.org/privilege/internet"/>
- <check send_destination="@DBUS_INTERFACE@"
- send_interface="@DBUS_INTERFACE@" send_member="stopMonitoring"
- privilege="http://tizen.org/privilege/internet"/>
- </policy>
</busconfig>
BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(iotivity)
+%if 0%{?tizen_version_major} >= 3
+BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(cynara-session)
+BuildRequires: pkgconfig(cynara-creds-gdbus)
+%endif
%if "%{tizen}" == "2.3"
BuildRequires: python-xml
%endif