/*
- * Bluetooth-frwk
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * Girishashok Joshi <girish.joshi@samsung.com>
- * Chanyeol Park <chanyeol.park@samsung.com>
+ * Copyright (c) 2011 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.
#include "bt-request-sender.h"
#include "bt-event-handler.h"
+#ifdef TIZEN_FEATURE_BT_DPM
+#include "bt-dpm.h"
+#endif
+
BT_EXPORT_API int bluetooth_network_activate_server()
{
int result;
return BLUETOOTH_ERROR_PERMISSION_DEINED;
}
+#ifdef TIZEN_FEATURE_BT_DPM
+ char *uuid = NULL;
+ if (_bt_check_dpm(BT_DPM_ADDRESS, (void *)device_address) == BT_DPM_RESTRICTED) {
+ BT_ERR("Blacklist device");
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
+ }
+
+ switch (role) {
+ case BLUETOOTH_NETWORK_PANU_ROLE:
+ uuid = g_strdup(BT_PAN_PANU_UUID);
+ break;
+ case BLUETOOTH_NETWORK_NAP_ROLE:
+ uuid = g_strdup(BT_PAN_NAP_UUID);
+ break;
+ case BLUETOOTH_NETWORK_GN_ROLE:
+ uuid = g_strdup(BT_PAN_GN_UUID);
+ break;
+ default:
+ break;
+ }
+
+ if (_bt_check_dpm(BT_DPM_UUID, uuid) == BT_DPM_RESTRICTED) {
+ BT_ERR("Blacklist uuid");
+ g_free(uuid);
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
+ }
+
+ if (_bt_check_dpm(BT_DPM_DESKTOP, NULL) == BT_DPM_RESTRICTED) {
+ char address[BT_ADDRESS_STRING_SIZE] = { 0 };
+ bluetooth_device_class_t dev_class;
+
+ _bt_convert_addr_type_to_string(address, (unsigned char *)device_address->addr);
+ _bt_get_cod_by_address(address, &dev_class);
+
+ if (dev_class.major_class == BLUETOOTH_DEVICE_MAJOR_CLASS_COMPUTER) {
+ BT_ERR("Reject a authorization due to MDM Policy");
+ g_free(uuid);
+ return BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION;
+ }
+ }
+ g_free(uuid);
+#endif
+
user_info = _bt_get_user_data(BT_COMMON);
retv_if(user_info->cb == NULL, BLUETOOTH_ERROR_INTERNAL);