Commit 197f479e authored by George Nash's avatar George Nash Committed by Kishen Maloor

Removed include security/oc_acl.h from oc_obt.h

- Removed #include "security/oc_acl.h" from oc_obt.h
- Added forward declaration of oc_ace_res_s and typedef of oc_ace_res_t
- Added forward declaration of oc_sec_ace_s and typedef of oc_sec_ace_t
- moved enum oc_ace_connection_type_t from oc_acl.h to oc_obt.h
- moved enum oc_ace_wildcart_t from oc_acl.h to oc_obt.h
- moved enum oc_ace_permission_t from oc_acl.h to oc_obt.h
- removed typedef of oc_ace_res_t from oc_acl.h it is now forward declared in oc_obt.h
- removed typedef of oc_sec_ace_t from oc_acl.h is it now forward declared in oc_obt.h

The header file oc_acl.h is not part of the public API
by including is in a public header file we are inadvertently
making it part of the public API since the only way to build
code that includes oc_obt.h was to also include the internal
header oc_acl.h

This moves the parts of oc_acl.h that were required for oc_obt.h
from oc_acl.h to oc_obt.h and reverses the include order so the
internal header now relies on the public header.

Change-Id: Ia9e6bcde832880912de8e7e8e2e370001ad69847
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/29444Tested-by: default avatarIoTivity Jenkins <jenkins-daemon@iotivity.org>
Reviewed-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 521b1a41
...@@ -21,13 +21,36 @@ ...@@ -21,13 +21,36 @@
#include "oc_api.h" #include "oc_api.h"
#include "oc_uuid.h" #include "oc_uuid.h"
#include "security/oc_acl.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
typedef struct oc_ace_res_s oc_ace_res_t;
typedef struct oc_sec_ace_s oc_sec_ace_t;
typedef enum {
OC_CONN_AUTH_CRYPT = 0,
OC_CONN_ANON_CLEAR
} oc_ace_connection_type_t;
typedef enum {
OC_ACE_NO_WC = -1,
OC_ACE_WC_ALL = 0x111,
OC_ACE_WC_ALL_SECURED = 0x01,
OC_ACE_WC_ALL_PUBLIC = 0x10,
} oc_ace_wildcard_t;
typedef enum {
OC_PERM_NONE = 0,
OC_PERM_CREATE = (1 << 0),
OC_PERM_RETRIEVE = (1 << 1),
OC_PERM_UPDATE = (1 << 2),
OC_PERM_DELETE = (1 << 3),
OC_PERM_NOTIFY = (1 << 4)
} oc_ace_permissions_t;
typedef void (*oc_obt_discovery_cb_t)(oc_uuid_t *, oc_endpoint_t *, void *); typedef void (*oc_obt_discovery_cb_t)(oc_uuid_t *, oc_endpoint_t *, void *);
typedef void (*oc_obt_device_status_cb_t)(oc_uuid_t *, int, void *); typedef void (*oc_obt_device_status_cb_t)(oc_uuid_t *, int, void *);
typedef void (*oc_obt_status_cb_t)(int, void *); typedef void (*oc_obt_status_cb_t)(int, void *);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#ifndef OC_ACL_H #ifndef OC_ACL_H
#define OC_ACL_H #define OC_ACL_H
#include "oc_obt.h"
#include "oc_ri.h" #include "oc_ri.h"
#include "oc_uuid.h" #include "oc_uuid.h"
#include "port/oc_log.h" #include "port/oc_log.h"
...@@ -29,41 +30,21 @@ extern "C" ...@@ -29,41 +30,21 @@ extern "C"
{ {
#endif #endif
typedef enum {
OC_PERM_NONE = 0,
OC_PERM_CREATE = (1 << 0),
OC_PERM_RETRIEVE = (1 << 1),
OC_PERM_UPDATE = (1 << 2),
OC_PERM_DELETE = (1 << 3),
OC_PERM_NOTIFY = (1 << 4)
} oc_ace_permissions_t;
typedef enum {
OC_ACE_NO_WC = -1,
OC_ACE_WC_ALL = 0x111,
OC_ACE_WC_ALL_SECURED = 0x01,
OC_ACE_WC_ALL_PUBLIC = 0x10,
} oc_ace_wildcard_t;
typedef enum { typedef enum {
OC_SUBJECT_UUID = 0, OC_SUBJECT_UUID = 0,
OC_SUBJECT_ROLE, OC_SUBJECT_ROLE,
OC_SUBJECT_CONN OC_SUBJECT_CONN
} oc_ace_subject_type_t; } oc_ace_subject_type_t;
typedef enum {
OC_CONN_AUTH_CRYPT = 0,
OC_CONN_ANON_CLEAR
} oc_ace_connection_type_t;
typedef struct oc_ace_res_s struct oc_ace_res_s
{ {
struct oc_ace_res_s *next; struct oc_ace_res_s *next;
oc_string_t href; oc_string_t href;
oc_interface_mask_t interfaces; oc_interface_mask_t interfaces;
oc_string_array_t types; oc_string_array_t types;
oc_ace_wildcard_t wildcard; oc_ace_wildcard_t wildcard;
} oc_ace_res_t; };
typedef union typedef union
{ {
...@@ -76,7 +57,7 @@ typedef union ...@@ -76,7 +57,7 @@ typedef union
oc_ace_connection_type_t conn; oc_ace_connection_type_t conn;
} oc_ace_subject_t; } oc_ace_subject_t;
typedef struct oc_sec_ace_s struct oc_sec_ace_s
{ {
struct oc_sec_ace_s *next; struct oc_sec_ace_s *next;
OC_LIST_STRUCT(resources); OC_LIST_STRUCT(resources);
...@@ -85,7 +66,7 @@ typedef struct oc_sec_ace_s ...@@ -85,7 +66,7 @@ typedef struct oc_sec_ace_s
int aceid; int aceid;
oc_ace_permissions_t permission; oc_ace_permissions_t permission;
// TODO: Add "validity" for ACE. It is currently not a mandatory property // TODO: Add "validity" for ACE. It is currently not a mandatory property
} oc_sec_ace_t; };
typedef struct typedef struct
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment