| /* |
| // Copyright (c) 2016 Intel Corporation |
| // |
| // 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 OC_RI_CONST_H |
| #define OC_RI_CONST_H |
| |
| typedef enum { OC_GET = 1, OC_POST, OC_PUT, OC_DELETE } oc_method_t; |
| |
| typedef enum { |
| OC_IF_BASELINE = 1 << 1, |
| OC_IF_LL = 1 << 2, |
| OC_IF_B = 1 << 3, |
| OC_IF_R = 1 << 4, |
| OC_IF_RW = 1 << 5, |
| OC_IF_A = 1 << 6, |
| OC_IF_S = 1 << 7, |
| } oc_interface_mask_t; |
| |
| typedef enum { |
| OC_STATUS_OK = 0, |
| OC_STATUS_CREATED, |
| OC_STATUS_CHANGED, |
| OC_STATUS_DELETED, |
| OC_STATUS_NOT_MODIFIED, |
| OC_STATUS_BAD_REQUEST, |
| OC_STATUS_UNAUTHORIZED, |
| OC_STATUS_BAD_OPTION, |
| OC_STATUS_FORBIDDEN, |
| OC_STATUS_NOT_FOUND, |
| OC_STATUS_METHOD_NOT_ALLOWED, |
| OC_STATUS_NOT_ACCEPTABLE, |
| OC_STATUS_REQUEST_ENTITY_TOO_LARGE, |
| OC_STATUS_UNSUPPORTED_MEDIA_TYPE, |
| OC_STATUS_INTERNAL_SERVER_ERROR, |
| OC_STATUS_NOT_IMPLEMENTED, |
| OC_STATUS_BAD_GATEWAY, |
| OC_STATUS_SERVICE_UNAVAILABLE, |
| OC_STATUS_GATEWAY_TIMEOUT, |
| OC_STATUS_PROXYING_NOT_SUPPORTED, |
| __NUM_OC_STATUS_CODES__, |
| OC_IGNORE |
| } oc_status_t; |
| |
| typedef enum oc_resource_properties { |
| OC_DISCOVERABLE = (1 << 0), |
| OC_OBSERVABLE = (1 << 1), |
| OC_ACTIVE = (1 << 2), |
| OC_SECURE = (1 << 4), |
| OC_PERIODIC = (1 << 6), |
| OC_TRANS_ENC = (1 << 7), /* Requires transport layer encryption. */ |
| OC_TRANS_AUTH = (1 << 8), /* Requires transport layer authentication. */ |
| } oc_resource_properties_t; |
| |
| #define OC_TRANS_SEC_MASK (OC_TRANS_ENC | OC_TRANS_AUTH) |
| |
| typedef enum { |
| OCF_RES = 0, |
| OCF_P, |
| #ifdef OC_SECURITY |
| OCF_SEC_DOXM, |
| OCF_SEC_PSTAT, |
| OCF_SEC_ACL, |
| OCF_SEC_CRED, |
| #endif |
| __NUM_OC_CORE_RESOURCES__ |
| } oc_core_resource_t; |
| |
| #define NUM_OC_CORE_RESOURCES (__NUM_OC_CORE_RESOURCES__ + MAX_NUM_DEVICES) |
| |
| #endif /* OC_RI_CONST_H */ |