Merge branch 'master' into windows-port
[platform/upstream/iotivity.git] / resource / csdk / stack / include / octypes.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //******************************************************************
20
21
22 /**
23  * @file
24  *
25  * This file contains the definition, types and APIs for resource(s) be implemented.
26  */
27
28 #ifndef OCTYPES_H_
29 #define OCTYPES_H_
30
31 #include "platform_features.h"
32 #include "ocstackconfig.h"
33 #include <stdbool.h>
34 #include <stdint.h>
35 #include <stdio.h>
36 #ifdef __cplusplus
37 #include <string.h>
38
39 extern "C" {
40 #endif // __cplusplus
41
42 /** For the feature presence.*/
43 #define WITH_PRESENCE
44
45 #include "ocpresence.h"
46 //-----------------------------------------------------------------------------
47 // Defines
48 //-----------------------------------------------------------------------------
49
50 /**
51  * OIC Virtual resources supported by every OIC device.
52  */
53 /**
54  *  Default discovery mechanism using '/oic/res' is supported by all OIC devices
55  *  That are Discoverable.
56  */
57 #define OC_RSRVD_WELL_KNOWN_URI               "/oic/res"
58
59 /** Device URI.*/
60 #define OC_RSRVD_DEVICE_URI                   "/oic/d"
61
62 /** Platform URI.*/
63 #define OC_RSRVD_PLATFORM_URI                 "/oic/p"
64
65 /** Resource Type.*/
66 #define OC_RSRVD_RESOURCE_TYPES_URI           "/oic/res/types/d"
67 #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
68 /** Gateway URI.*/
69 #define OC_RSRVD_GATEWAY_URI                  "/oic/gateway"
70 #endif
71 #ifdef WITH_PRESENCE
72
73 /** Presence URI through which the OIC devices advertise their presence.*/
74 #define OC_RSRVD_PRESENCE_URI                 "/oic/ad"
75
76 /** Sets the default time to live (TTL) for presence.*/
77 #define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
78
79 /** For multicast Discovery mechanism.*/
80 #define OC_MULTICAST_DISCOVERY_URI           "/oic/res"
81
82 /** Separator for multiple query string.*/
83 #define OC_QUERY_SEPARATOR                "&;"
84
85 /**
86  *  OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.
87  */
88 #define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
89
90 /**
91  *  OC_MAX_PRESENCE_TTL_SECONDS sets the maximum time to live (TTL) for presence.
92  *  NOTE: Changing the setting to a longer duration may lead to unsupported and untested
93  *  operation.
94  *  60 sec/min * 60 min/hr * 24 hr/day
95  */
96 #define OC_MAX_PRESENCE_TTL_SECONDS     (60 * 60 * 24)
97 #endif
98
99 /**
100  *  Presence "Announcement Triggers".
101  */
102
103 /** To create.*/
104 #define OC_RSRVD_TRIGGER_CREATE         "create"
105
106 /** To change.*/
107 #define OC_RSRVD_TRIGGER_CHANGE         "change"
108
109 /** To delete.*/
110 #define OC_RSRVD_TRIGGER_DELETE         "delete"
111
112 /**
113  *  Attributes used to form a proper OIC conforming JSON message.
114  */
115
116 #define OC_RSRVD_OC                     "oic"
117
118 /** For payload. */
119
120 #define OC_RSRVD_PAYLOAD                "payload"
121
122 /** To represent href */
123 #define OC_RSRVD_HREF                   "href"
124
125 /** To represent property*/
126 #define OC_RSRVD_PROPERTY               "prop"
127
128 /** For representation.*/
129 #define OC_RSRVD_REPRESENTATION         "rep"
130
131 /** To represent content type.*/
132 #define OC_RSRVD_CONTENT_TYPE           "ct"
133
134 /** To represent resource type.*/
135 #define OC_RSRVD_RESOURCE_TYPE          "rt"
136
137 /** To represent resource type with presence.*/
138 #define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
139
140 /** To represent resource type with device.*/
141 #define OC_RSRVD_RESOURCE_TYPE_DEVICE   "oic.wk.d"
142
143 /** To represent resource type with platform.*/
144 #define OC_RSRVD_RESOURCE_TYPE_PLATFORM "oic.wk.p"
145
146 /** To represent resource type with RES.*/
147 #define OC_RSRVD_RESOURCE_TYPE_RES    "oic.wk.res"
148
149 /** To represent interface.*/
150 #define OC_RSRVD_INTERFACE              "if"
151
152 /** To represent time to live.*/
153 #define OC_RSRVD_TTL                    "ttl"
154
155 /** To represent non*/
156 #define OC_RSRVD_NONCE                  "non"
157
158 /** To represent trigger type.*/
159 #define OC_RSRVD_TRIGGER                "trg"
160
161 /** To represent links.*/
162 #define OC_RSRVD_LINKS                  "links"
163
164 /** To represent default interface.*/
165 #define OC_RSRVD_INTERFACE_DEFAULT      "oic.if.baseline"
166
167 /** To represent read-only interface.*/
168 #define OC_RSRVD_INTERFACE_READ         "oic.if.r"
169
170 /** To represent ll interface.*/
171 #define OC_RSRVD_INTERFACE_LL           "oic.if.ll"
172
173 /** To represent batch interface.*/
174 #define OC_RSRVD_INTERFACE_BATCH        "oic.if.b"
175
176 /** To represent interface group.*/
177 #define OC_RSRVD_INTERFACE_GROUP        "oic.mi.grp"
178
179 /** To represent MFG date.*/
180 #define OC_RSRVD_MFG_DATE               "mndt"
181
182 /** To represent FW version.*/
183 #define OC_RSRVD_FW_VERSION             "mnfv"
184
185 /** To represent host name.*/
186 #define OC_RSRVD_HOST_NAME              "hn"
187
188 /** To represent policy.*/
189 #define OC_RSRVD_POLICY                 "p"
190
191 /** To represent bitmap.*/
192 #define OC_RSRVD_BITMAP                 "bm"
193
194 /** For security.*/
195 #define OC_RSRVD_SECURE                 "sec"
196
197 /** Port. */
198 #define OC_RSRVD_HOSTING_PORT           "port"
199
200 /** For Server instance ID.*/
201 #define OC_RSRVD_SERVER_INSTANCE_ID     "sid"
202
203 /**
204  *  Platform.
205  */
206
207 /** Platform ID. */
208 #define OC_RSRVD_PLATFORM_ID            "pi"
209
210 /** Platform MFG NAME. */
211 #define OC_RSRVD_MFG_NAME               "mnmn"
212
213 /** Platform URL. */
214 #define OC_RSRVD_MFG_URL                "mnml"
215
216 /** Model Number.*/
217 #define OC_RSRVD_MODEL_NUM              "mnmo"
218
219 /** Platform MFG Date.*/
220 #define OC_RSRVD_MFG_DATE               "mndt"
221
222 /** Platform versio.n */
223 #define OC_RSRVD_PLATFORM_VERSION       "mnpv"
224
225 /** Platform Operating system version. */
226 #define OC_RSRVD_OS_VERSION             "mnos"
227
228 /** Platform Hardware version. */
229 #define OC_RSRVD_HARDWARE_VERSION       "mnhw"
230
231 /**Platform Firmware version. */
232 #define OC_RSRVD_FIRMWARE_VERSION       "mnfv"
233
234 /** Support URL for the platform. */
235 #define OC_RSRVD_SUPPORT_URL            "mnsl"
236
237 /** System time for the platform. */
238 #define OC_RSRVD_SYSTEM_TIME             "st"
239
240 /**
241  *  Device.
242  */
243
244 /** Device ID.*/
245 #define OC_RSRVD_DEVICE_ID              "di"
246
247 /** Device Name.*/
248 #define OC_RSRVD_DEVICE_NAME            "n"
249
250 /** Device specification version.*/
251 #define OC_RSRVD_SPEC_VERSION           "icv"
252
253 /** Device data model.*/
254 #define OC_RSRVD_DATA_MODEL_VERSION     "dmv"
255
256 /** Device specification version.*/
257 #define OC_SPEC_VERSION                "core.1.0.0"
258
259 /** Device Data Model version.*/
260 #define OC_DATA_MODEL_VERSION          "res.1.0.0"
261
262 /**
263  *  These provide backward compatibility - their use is deprecated.
264  */
265 #ifndef GOING_AWAY
266
267 /** Multicast Prefix.*/
268 #define OC_MULTICAST_PREFIX                  "224.0.1.187:5683"
269
270 /** Multicast IP address.*/
271 #define OC_MULTICAST_IP                      "224.0.1.187"
272
273 /** Multicast Port.*/
274 #define OC_MULTICAST_PORT                    5683
275 #endif // GOING_AWAY
276
277 /** Max Device address size. */
278 #ifdef RA_ADAPTER
279 #define MAX_ADDR_STR_SIZE (256)
280 #else
281 /** Max Address could be "coap+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:xxxxx" */
282 #define MAX_ADDR_STR_SIZE (59)
283 #endif
284
285 /** Length of MAC address */
286 #define MAC_ADDR_STR_SIZE (17)
287
288 /** Blocks of MAC address */
289 #define MAC_ADDR_BLOCKS (6)
290
291 /** Max identity size. */
292 #define MAX_IDENTITY_SIZE (32)
293
294 /** Universal unique identity size. */
295 #define UUID_IDENTITY_SIZE (128/8)
296
297 /** Resource Directory */
298
299 /** Resource Directory URI used to Discover RD and Publish resources.*/
300 #define OC_RSRVD_RD_URI                  "/oic/rd"
301
302 /** To represent resource type with rd.*/
303 #define OC_RSRVD_RESOURCE_TYPE_RD        "oic.wk.rd"
304
305 /** RD Discovery bias factor type. */
306 #define OC_RSRVD_RD_DISCOVERY_SEL        "sel"
307
308 /** Base URI. */
309 #define OC_RSRVD_BASE_URI                "baseURI"
310
311 /** Unique value per collection/link. */
312 #define OC_RSRVD_INS                     "ins"
313
314 /** Allowable resource types in the links. */
315 #define OC_RSRVD_RTS                     "rts"
316
317 /** Default relationship. */
318 #define OC_RSRVD_DREL                    "drel"
319
320 /** Defines relationship between links. */
321 #define OC_RSRVD_REL                     "rel"
322
323 /** Defines title. */
324 #define OC_RSRVD_TITLE                   "title"
325
326 /** Defines URI. */
327 #define OC_RSRVD_URI                     "uri"
328
329 /** Defines media type. */
330 #define OC_RSRVD_MEDIA_TYPE              "mt"
331
332 /** To represent resource type with Publish RD.*/
333 #define OC_RSRVD_RESOURCE_TYPE_RDPUBLISH "oic.wk.rdpub"
334
335 /**
336  * Mark a parameter as unused. Used to prevent unused variable compiler warnings.
337  * Used in three cases:
338  * 1. in callbacks when one of the parameters are unused
339  * 2. when due to code changes a functions parameter is no longer
340  *    used but must be left in place for backward compatibility
341  *    reasons.
342  * 3. a variable is only used in the debug build variant and would
343  *    give a build warning in release mode.
344  */
345 #define OC_UNUSED(x) (void)(x)
346
347 /**
348  * These enums (OCTransportAdapter and OCTransportFlags) must
349  * be kept synchronized with OCConnectivityType (below) as well as
350  * CATransportAdapter and CATransportFlags (in CACommon.h).
351  */
352 typedef enum
353 {
354     /** value zero indicates discovery.*/
355     OC_DEFAULT_ADAPTER = 0,
356
357     /** IPv4 and IPv6, including 6LoWPAN.*/
358     OC_ADAPTER_IP           = (1 << 0),
359
360     /** GATT over Bluetooth LE.*/
361     OC_ADAPTER_GATT_BTLE    = (1 << 1),
362
363     /** RFCOMM over Bluetooth EDR.*/
364     OC_ADAPTER_RFCOMM_BTEDR = (1 << 2),
365 #ifdef RA_ADAPTER
366     /**Remote Access over XMPP.*/
367     OC_ADAPTER_REMOTE_ACCESS = (1 << 3),
368 #endif
369     /** CoAP over TCP.*/
370     OC_ADAPTER_TCP           = (1 << 4),
371
372     /** NFC Transport for Messaging.*/
373     OC_ADAPTER_NFC           = (1 << 5)
374 } OCTransportAdapter;
375
376 /**
377  *  Enum layout assumes some targets have 16-bit integer (e.g., Arduino).
378  */
379 typedef enum
380 {
381     /** default flag is 0*/
382     OC_DEFAULT_FLAGS = 0,
383
384     /** Insecure transport is the default (subject to change).*/
385     /** secure the transport path*/
386     OC_FLAG_SECURE     = (1 << 4),
387
388     /** IPv4 & IPv6 auto-selection is the default.*/
389     /** IP adapter only.*/
390     OC_IP_USE_V6       = (1 << 5),
391
392     /** IP adapter only.*/
393     OC_IP_USE_V4       = (1 << 6),
394
395     /** internal use only.*/
396     OC_RESERVED1       = (1 << 7),   // internal use only
397
398     /** Link-Local multicast is the default multicast scope for IPv6.
399      *  These are placed here to correspond to the IPv6 multicast address bits.*/
400
401     /** IPv6 Interface-Local scope (loopback).*/
402     OC_SCOPE_INTERFACE = 0x1,
403
404     /** IPv6 Link-Local scope (default).*/
405     OC_SCOPE_LINK      = 0x2,
406
407     /** IPv6 Realm-Local scope. */
408     OC_SCOPE_REALM     = 0x3,
409
410     /** IPv6 Admin-Local scope. */
411     OC_SCOPE_ADMIN     = 0x4,
412
413     /** IPv6 Site-Local scope. */
414     OC_SCOPE_SITE      = 0x5,
415
416     /** IPv6 Organization-Local scope. */
417     OC_SCOPE_ORG       = 0x8,
418
419     /**IPv6 Global scope. */
420     OC_SCOPE_GLOBAL    = 0xE,
421
422 } OCTransportFlags;
423
424 /** Bit mask for scope.*/
425 #define OC_MASK_SCOPE    (0x000F)
426
427 /** Bit mask for Mods.*/
428 #define OC_MASK_MODS     (0x0FF0)
429 #define OC_MASK_FAMS     (OC_IP_USE_V6|OC_IP_USE_V4)
430
431 typedef struct OCStringLL
432 {
433     struct OCStringLL *next;
434     char* value;
435 } OCStringLL;
436
437 /**
438  * End point identity.
439  */
440 typedef struct
441 {
442     /** Identity Length */
443     uint16_t id_length;
444
445     /** Array of end point identity.*/
446     unsigned char id[MAX_IDENTITY_SIZE];
447 } OCIdentity;
448
449 /**
450  * Universally unique identifier.
451  */
452 typedef struct
453 {
454     /** identitifier string.*/
455     unsigned char id[UUID_IDENTITY_SIZE];
456 } OCUUIdentity;
457
458 /**
459  * Data structure to encapsulate IPv4/IPv6/Contiki/lwIP device addresses.
460  * OCDevAddr must be the same as CAEndpoint (in CACommon.h).
461  */
462 typedef struct
463 {
464     /** adapter type.*/
465     OCTransportAdapter      adapter;
466
467     /** transport modifiers.*/
468     OCTransportFlags        flags;
469
470     /** for IP.*/
471     uint16_t                port;
472
473     /** address for all adapters.*/
474     char                    addr[MAX_ADDR_STR_SIZE];
475
476     /** usually zero for default interface.*/
477     uint32_t                interface;
478 #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
479     char                    routeData[MAX_ADDR_STR_SIZE]; //destination GatewayID:ClientId
480 #endif
481 } OCDevAddr;
482
483 /**
484  * This enum type includes elements of both ::OCTransportAdapter and ::OCTransportFlags.
485  * It is defined conditionally because the smaller definition limits expandability on 32/64 bit
486  * integer machines, and the larger definition won't fit into an enum on 16-bit integer machines
487  * like Arduino.
488  *
489  * This structure must directly correspond to ::OCTransportAdapter and ::OCTransportFlags.
490  */
491 typedef enum
492 {
493     /** use when defaults are ok. */
494     CT_DEFAULT = 0,
495
496     /** IPv4 and IPv6, including 6LoWPAN.*/
497     CT_ADAPTER_IP           = (1 << 16),
498
499     /** GATT over Bluetooth LE.*/
500     CT_ADAPTER_GATT_BTLE    = (1 << 17),
501
502     /** RFCOMM over Bluetooth EDR.*/
503     CT_ADAPTER_RFCOMM_BTEDR = (1 << 18),
504
505 #ifdef RA_ADAPTER
506     /** Remote Access over XMPP.*/
507     CT_ADAPTER_REMOTE_ACCESS = (1 << 19),
508 #endif
509     /** CoAP over TCP.*/
510     CT_ADAPTER_TCP     = (1 << 20),
511
512     /** NFC Transport.*/
513     CT_ADAPTER_NFC     = (1 << 21),
514
515     /** Insecure transport is the default (subject to change).*/
516
517     /** secure the transport path.*/
518     CT_FLAG_SECURE     = (1 << 4),
519
520     /** IPv4 & IPv6 autoselection is the default.*/
521
522     /** IP adapter only.*/
523     CT_IP_USE_V6       = (1 << 5),
524
525     /** IP adapter only.*/
526     CT_IP_USE_V4       = (1 << 6),
527
528     /** Link-Local multicast is the default multicast scope for IPv6.
529      * These are placed here to correspond to the IPv6 address bits.*/
530
531     /** IPv6 Interface-Local scope(loopback).*/
532     CT_SCOPE_INTERFACE = 0x1,
533
534     /** IPv6 Link-Local scope (default).*/
535     CT_SCOPE_LINK      = 0x2,
536
537     /** IPv6 Realm-Local scope.*/
538     CT_SCOPE_REALM     = 0x3,
539
540     /** IPv6 Admin-Local scope.*/
541     CT_SCOPE_ADMIN     = 0x4,
542
543     /** IPv6 Site-Local scope.*/
544     CT_SCOPE_SITE      = 0x5,
545
546     /** IPv6 Organization-Local scope.*/
547     CT_SCOPE_ORG       = 0x8,
548
549     /** IPv6 Global scope.*/
550     CT_SCOPE_GLOBAL    = 0xE,
551 } OCConnectivityType;
552
553 /** bit shift required for connectivity adapter.*/
554 #define CT_ADAPTER_SHIFT 16
555
556 /** Mask Flag.*/
557 #define CT_MASK_FLAGS 0xFFFF
558
559 /** Mask Adapter.*/
560 #define CT_MASK_ADAPTER 0xFFFF0000
561
562 /**
563  *  OCDoResource methods to dispatch the request
564  */
565 typedef enum
566 {
567     OC_REST_NOMETHOD       = 0,
568
569     /** Read.*/
570     OC_REST_GET            = (1 << 0),
571
572     /** Write.*/
573     OC_REST_PUT            = (1 << 1),
574
575     /** Update.*/
576     OC_REST_POST           = (1 << 2),
577
578     /** Delete.*/
579     OC_REST_DELETE         = (1 << 3),
580
581     /** Register observe request for most up date notifications ONLY.*/
582     OC_REST_OBSERVE        = (1 << 4),
583
584     /** Register observe request for all notifications, including stale notifications.*/
585     OC_REST_OBSERVE_ALL    = (1 << 5),
586
587     /** De-register observation, intended for internal use.*/
588     OC_REST_CANCEL_OBSERVE = (1 << 6),
589
590     #ifdef WITH_PRESENCE
591     /** Subscribe for all presence notifications of a particular resource.*/
592     OC_REST_PRESENCE       = (1 << 7),
593
594     #endif
595     /** Allows OCDoResource caller to do discovery.*/
596     OC_REST_DISCOVER       = (1 << 8)
597 } OCMethod;
598
599 /**
600  *  Formats for payload encoding.
601  */
602 typedef enum
603 {
604     OC_FORMAT_CBOR,
605     OC_FORMAT_UNDEFINED,
606     OC_FORMAT_UNSUPPORTED,
607 } OCPayloadFormat;
608
609 /**
610  * Host Mode of Operation.
611  */
612 typedef enum
613 {
614     OC_CLIENT = 0,
615     OC_SERVER,
616     OC_CLIENT_SERVER,
617     OC_GATEWAY          /**< Client server mode along with routing capabilities.*/
618 } OCMode;
619
620 /**
621  * Quality of Service attempts to abstract the guarantees provided by the underlying transport
622  * protocol. The precise definitions of each quality of service level depend on the
623  * implementation. In descriptions below are for the current implementation and may changed
624  * over time.
625  */
626 typedef enum
627 {
628     /** Packet delivery is best effort.*/
629     OC_LOW_QOS = 0,
630
631     /** Packet delivery is best effort.*/
632     OC_MEDIUM_QOS,
633
634     /** Acknowledgments are used to confirm delivery.*/
635     OC_HIGH_QOS,
636
637     /** No Quality is defined, let the stack decide.*/
638     OC_NA_QOS
639 } OCQualityOfService;
640
641 /**
642  * Resource Properties.
643  * The value of a policy property is defined as bitmap.
644  * The LSB represents OC_DISCOVERABLE and Second LSB bit represents OC_OBSERVABLE and so on.
645  * Not including the policy property is equivalent to zero.
646  *
647  */
648 typedef enum
649 {
650     /** When none of the bits are set, the resource is non-discoverable &
651      *  non-observable by the client.*/
652     OC_RES_PROP_NONE = (0),
653
654     /** When this bit is set, the resource is allowed to be discovered by clients.*/
655     OC_DISCOVERABLE  = (1 << 0),
656
657     /** When this bit is set, the resource is allowed to be observed by clients.*/
658     OC_OBSERVABLE    = (1 << 1),
659
660     /** When this bit is set, the resource is initialized, otherwise the resource
661      *  is 'inactive'. 'inactive' signifies that the resource has been marked for
662      *  deletion or is already deleted.*/
663     OC_ACTIVE        = (1 << 2),
664
665     /** When this bit is set, the resource has been marked as 'slow'.
666      * 'slow' signifies that responses from this resource can expect delays in
667      *  processing its requests from clients.*/
668     OC_SLOW          = (1 << 3),
669
670     /** When this bit is set, the resource is a secure resource.*/
671     OC_SECURE        = (1 << 4),
672
673     /** When this bit is set, the resource is allowed to be discovered only
674      *  if discovery request contains an explicit querystring.
675      *  Ex: GET /oic/res?rt=oic.sec.acl */
676     OC_EXPLICIT_DISCOVERABLE   = (1 << 5)
677 } OCResourceProperty;
678
679 /**
680  * Transport Protocol IDs.
681  */
682 typedef enum
683 {
684     /** For invalid ID.*/
685     OC_INVALID_ID   = (1 << 0),
686
687     /* For coap ID.*/
688     OC_COAP_ID      = (1 << 1)
689 } OCTransportProtocolID;
690
691 /**
692  * Declares Stack Results & Errors.
693  */
694 typedef enum
695 {
696     /** Success status code - START HERE.*/
697     OC_STACK_OK = 0,
698     OC_STACK_RESOURCE_CREATED,
699     OC_STACK_RESOURCE_DELETED,
700     OC_STACK_CONTINUE,
701     /** Success status code - END HERE.*/
702
703     /** Error status code - START HERE.*/
704     OC_STACK_INVALID_URI = 20,
705     OC_STACK_INVALID_QUERY,
706     OC_STACK_INVALID_IP,
707     OC_STACK_INVALID_PORT,
708     OC_STACK_INVALID_CALLBACK,
709     OC_STACK_INVALID_METHOD,
710
711     /** Invalid parameter.*/
712     OC_STACK_INVALID_PARAM,
713     OC_STACK_INVALID_OBSERVE_PARAM,
714     OC_STACK_NO_MEMORY,
715     OC_STACK_COMM_ERROR,
716     OC_STACK_TIMEOUT,
717     OC_STACK_ADAPTER_NOT_ENABLED,
718     OC_STACK_NOTIMPL,
719
720     /** Resource not found.*/
721     OC_STACK_NO_RESOURCE,
722
723     /** e.g: not supported method or interface.*/
724     OC_STACK_RESOURCE_ERROR,
725     OC_STACK_SLOW_RESOURCE,
726     OC_STACK_DUPLICATE_REQUEST,
727
728     /** Resource has no registered observers.*/
729     OC_STACK_NO_OBSERVERS,
730     OC_STACK_OBSERVER_NOT_FOUND,
731     OC_STACK_VIRTUAL_DO_NOT_HANDLE,
732     OC_STACK_INVALID_OPTION,
733
734     /** The remote reply contained malformed data.*/
735     OC_STACK_MALFORMED_RESPONSE,
736     OC_STACK_PERSISTENT_BUFFER_REQUIRED,
737     OC_STACK_INVALID_REQUEST_HANDLE,
738     OC_STACK_INVALID_DEVICE_INFO,
739     OC_STACK_INVALID_JSON,
740
741     /** Request is not authorized by Resource Server. */
742     OC_STACK_UNAUTHORIZED_REQ,
743
744     /** Error code from PDM */
745     OC_STACK_PDM_IS_NOT_INITIALIZED,
746     OC_STACK_DUPLICATE_UUID,
747     OC_STACK_INCONSISTENT_DB,
748
749     /**
750      * Error code from OTM
751      * This error is plused from DTLS interface when handshake failure happens
752      */
753     OC_STACK_AUTHENTICATION_FAILURE,
754
755     /** Insert all new error codes here!.*/
756     #ifdef WITH_PRESENCE
757     OC_STACK_PRESENCE_STOPPED = 128,
758     OC_STACK_PRESENCE_TIMEOUT,
759     OC_STACK_PRESENCE_DO_NOT_HANDLE,
760     #endif
761     /** ERROR in stack.*/
762     OC_STACK_ERROR = 255
763     /** Error status code - END HERE.*/
764 } OCStackResult;
765
766 /**
767  * Handle to an OCDoResource invocation.
768  */
769 typedef void * OCDoHandle;
770
771 /**
772  * Handle to an OCResource object owned by the OCStack.
773  */
774 typedef void * OCResourceHandle;
775
776 /**
777  * Handle to an OCRequest object owned by the OCStack.
778  */
779 typedef void * OCRequestHandle;
780
781 /**
782  * Unique identifier for each observation request. Used when observations are
783  * registered or de-registered. Used by entity handler to signal specific
784  * observers to be notified of resource changes.
785  * There can be maximum of 256 observations per server.
786  */
787 typedef uint8_t OCObservationId;
788
789 /**
790  * Action associated with observation.
791  */
792 typedef enum
793 {
794     /** To Register. */
795     OC_OBSERVE_REGISTER = 0,
796
797     /** To Deregister. */
798     OC_OBSERVE_DEREGISTER = 1,
799
800     /** Others. */
801     OC_OBSERVE_NO_OPTION = 2
802 } OCObserveAction;
803
804
805 /**
806  * Persistent storage handlers. An APP must provide OCPersistentStorage handler pointers
807  * when it calls OCRegisterPersistentStorageHandler.
808  * Persistent storage open handler points to default file path.
809  * Application can point to appropriate SVR database path for it's IoTivity Server.
810  */
811 typedef struct {
812     /** Persistent storage file path.*/
813     FILE* (* open)(const char *path, const char *mode);
814
815     /** Persistent storage read handler.*/
816     size_t (* read)(void *ptr, size_t size, size_t nmemb, FILE *stream);
817
818     /** Persistent storage write handler.*/
819     size_t (* write)(const void *ptr, size_t size, size_t nmemb, FILE *stream);
820
821     /** Persistent storage close handler.*/
822     int (* close)(FILE *fp);
823
824     /** Persistent storage unlink handler.*/
825     int (* unlink)(const char *path);
826 } OCPersistentStorage;
827
828 /**
829  * Possible returned values from entity handler.
830  */
831 typedef struct
832 {
833     /** Action associated with observation request.*/
834     OCObserveAction action;
835
836     /** Identifier for observation being registered/deregistered.*/
837     OCObservationId obsId;
838 } OCObservationInfo;
839
840 /**
841  * Possible returned values from entity handler.
842  */
843 typedef enum
844 {
845     OC_EH_OK = 0,
846     OC_EH_ERROR,
847     OC_EH_RESOURCE_CREATED,
848     OC_EH_RESOURCE_DELETED,
849     OC_EH_SLOW,
850     OC_EH_FORBIDDEN,
851     OC_EH_RESOURCE_NOT_FOUND
852 } OCEntityHandlerResult;
853
854 /**
855  * This structure will be used to define the vendor specific header options to be included
856  * in communication packets.
857  */
858 typedef struct OCHeaderOption
859 {
860     /** The protocol ID this option applies to.*/
861     OCTransportProtocolID protocolID;
862
863     /** The header option ID which will be added to communication packets.*/
864     uint16_t optionID;
865
866     /** its length 191.*/
867     uint16_t optionLength;
868
869     /** pointer to its data.*/
870     uint8_t optionData[MAX_HEADER_OPTION_DATA_LENGTH];
871
872 #ifdef SUPPORTS_DEFAULT_CTOR
873     OCHeaderOption() = default;
874     OCHeaderOption(OCTransportProtocolID pid,
875                    uint16_t optId,
876                    uint16_t optlen,
877                    const uint8_t* optData)
878         : protocolID(pid),
879           optionID(optId),
880           optionLength(optlen)
881     {
882
883         // parameter includes the null terminator.
884         optionLength = optionLength < MAX_HEADER_OPTION_DATA_LENGTH ?
885                         optionLength : MAX_HEADER_OPTION_DATA_LENGTH;
886         memcpy(optionData, optData, optionLength);
887         optionData[optionLength - 1] = '\0';
888     }
889 #endif
890 } OCHeaderOption;
891
892
893 /**
894  * This structure describes the platform properties. All non-Null properties will be
895  * included in a platform discovery request.
896  */
897 typedef struct
898 {
899     /** Platform ID.*/
900     char *platformID;
901
902     /** Manufacturer name.*/
903     char *manufacturerName;
904
905     /** Manufacturer URL for platform property.*/
906     char *manufacturerUrl;
907
908     /** Model number.*/
909     char *modelNumber;
910
911     /** Manufacturer date.*/
912     char *dateOfManufacture;
913
914     /** Platform version.*/
915     char *platformVersion;
916
917     /** Operating system version.*/
918     char *operatingSystemVersion;
919
920     /** HW version.*/
921     char *hardwareVersion;
922
923     /** FW version.*/
924     char *firmwareVersion;
925
926     /** Platform support URL.*/
927     char *supportUrl;
928
929     /** System time.*/
930     char *systemTime;
931
932 } OCPlatformInfo;
933
934 /**
935  * This structure is expected as input for device properties.
936  * device name is mandatory and expected from the application.
937  * device id of type UUID will be generated by the stack.
938  */
939 typedef struct
940 {
941     /** Pointer to the device name.*/
942     char *deviceName;
943     /** Pointer to the types.*/
944     OCStringLL *types;
945 } OCDeviceInfo;
946
947 #ifdef RA_ADAPTER
948 /**
949  * callback for bound JID
950  */
951 typedef void (*jid_bound_cb)(char *jid);
952
953 /**
954  * CA Remote Access information for XMPP Client
955  *
956  */
957 typedef struct
958 {
959     char *hostname;     /**< XMPP server hostname */
960     uint16_t   port;    /**< XMPP server serivce port */
961     char *xmpp_domain;  /**< XMPP login domain */
962     char *username;     /**< login username */
963     char *password;     /**< login password */
964     char *resource;     /**< specific resource for login */
965     char *user_jid;     /**< specific JID for login */
966     jid_bound_cb jidbound;  /**< callback when JID bound */
967 } OCRAInfo_t;
968 #endif  /* RA_ADAPTER */
969
970
971 /** Enum to describe the type of object held by the OCPayload object.*/
972 typedef enum
973 {
974     PAYLOAD_TYPE_INVALID,
975     PAYLOAD_TYPE_DISCOVERY,
976     PAYLOAD_TYPE_DEVICE,
977     PAYLOAD_TYPE_PLATFORM,
978     PAYLOAD_TYPE_REPRESENTATION,
979     PAYLOAD_TYPE_SECURITY,
980     PAYLOAD_TYPE_PRESENCE,
981     PAYLOAD_TYPE_RD
982 } OCPayloadType;
983
984 typedef struct
985 {
986     // The type of message that was received
987     OCPayloadType type;
988 } OCPayload;
989
990 typedef enum
991 {
992     OCREP_PROP_NULL,
993     OCREP_PROP_INT,
994     OCREP_PROP_DOUBLE,
995     OCREP_PROP_BOOL,
996     OCREP_PROP_STRING,
997     OCREP_PROP_BYTE_STRING,
998     OCREP_PROP_OBJECT,
999     OCREP_PROP_ARRAY
1000 }OCRepPayloadPropType;
1001
1002 /** This structure will be used to represent a binary string for CBOR payloads.*/
1003 typedef struct
1004 {
1005     /** pointer to data bytes.*/
1006     uint8_t* bytes;
1007
1008     /** number of data bytes.*/
1009     size_t   len;
1010 } OCByteString;
1011
1012 #define MAX_REP_ARRAY_DEPTH 3
1013 typedef struct
1014 {
1015     OCRepPayloadPropType type;
1016     size_t dimensions[MAX_REP_ARRAY_DEPTH];
1017
1018     union
1019     {
1020         int64_t* iArray;
1021         double* dArray;
1022         bool* bArray;
1023         char** strArray;
1024
1025         /** pointer to ByteString array.*/
1026         OCByteString* ocByteStrArray;
1027
1028         struct OCRepPayload** objArray;
1029     };
1030 } OCRepPayloadValueArray;
1031
1032 typedef struct OCRepPayloadValue
1033 {
1034     char* name;
1035     OCRepPayloadPropType type;
1036     union
1037     {
1038         int64_t i;
1039         double d;
1040         bool b;
1041         char* str;
1042
1043         /** ByteString object.*/
1044         OCByteString ocByteStr;
1045
1046         struct OCRepPayload* obj;
1047         OCRepPayloadValueArray arr;
1048     };
1049     struct OCRepPayloadValue* next;
1050
1051 } OCRepPayloadValue;
1052
1053 // used for get/set/put/observe/etc representations
1054 typedef struct OCRepPayload
1055 {
1056     OCPayload base;
1057     char* uri;
1058     OCStringLL* types;
1059     OCStringLL* interfaces;
1060     OCRepPayloadValue* values;
1061     struct OCRepPayload* next;
1062 } OCRepPayload;
1063
1064 // used inside a discovery payload
1065 typedef struct OCResourcePayload
1066 {
1067     char* uri;
1068     OCStringLL* types;
1069     OCStringLL* interfaces;
1070     uint8_t bitmap;
1071     bool secure;
1072     uint16_t port;
1073     struct OCResourcePayload* next;
1074 } OCResourcePayload;
1075
1076 /**
1077  * Structure holding Links Payload. It is a sub-structure used in
1078  * OCResourceCollectionPayload.
1079  */
1080 typedef struct OCLinksPayload
1081 {
1082     /** This is the target relative URI. */
1083     char *href;
1084     /** Resource Type - A standard OIC specified or vendor defined resource
1085      * type of the resource referenced by the target URI. */
1086     OCStringLL *rt;
1087     /** Interface - The interfaces supported by the resource referenced by the target URI. */
1088     OCStringLL *itf;
1089     /** The relation of the target URI referenced by the link to the context URI;
1090      * The default value is null. */
1091     char *rel;
1092     /** Specifies if the resource referenced by the target URIis observable or not. */
1093     bool obs;
1094     /** A title for the link relation. Can be used by the UI to provide a context. */
1095     char *title;
1096     /** This is used to override the context URI e.g. override the URI of the containing collection. */
1097     char *uri;
1098     /** The instance identifier for this web link in an array of web links - used in links. */
1099     union
1100     {
1101         /** An ordinal number that is not repeated - must be unique in the collection context. */
1102         uint8_t ins;
1103         /** Any unique string including a URI. */
1104         char *uniqueStr;
1105         /** Use UUID for universal uniqueness - used in /oic/res to identify the device. */
1106         OCIdentity uniqueUUID;
1107     };
1108     /** A hint of the media type of the representation of the resource referenced by the target URI. */
1109     OCStringLL *mt;
1110     /** Holding address of the next resource. */
1111     struct OCLinksPayload *next;
1112 } OCLinksPayload;
1113
1114 /** Structure holding tags value of the links payload. */
1115 typedef struct
1116 {
1117     /** Name of tags. */
1118     OCDeviceInfo n;
1119     /** Device identifier. */
1120     OCIdentity di;
1121     /** The base URI where the resources are hold. */
1122     char *baseURI;
1123     /** Bitmap holds observable, discoverable, secure option flag.*/
1124     uint8_t bitmap;
1125     /** Port set in case, the secure flag is set above. */
1126     uint16_t port;
1127     /** Id for each set of links i.e. tag. */
1128     union
1129     {
1130         /** An ordinal number that is not repeated - must be unique in the collection context. */
1131         uint8_t ins;
1132         /** Any unique string including a URI. */
1133         char *uniqueStr;
1134         /** Use UUID for universal uniqueness - used in /oic/res to identify the device. */
1135         OCIdentity uniqueUUID;
1136     };
1137     /** Defines the list of allowable resource types (for Target and anchors) in links included
1138      * in the collection; new links being created can only be from this list. */
1139     char *rts;
1140     /** When specified this is the default relationship to use when an OIC Link does not specify
1141      * an explicit relationship with *rel* parameter. */
1142     char *drel;
1143     /** Time to keep holding resource.*/
1144     uint32_t ttl;
1145 } OCTagsPayload;
1146
1147 /** Resource collection payload. */
1148 typedef struct OCResourceCollectionPayload
1149 {
1150     /** Collection tags payload.*/
1151     OCTagsPayload *tags;
1152     /** Array of links payload. */
1153     OCLinksPayload *setLinks;
1154     /** Holding address of the next resource. */
1155     struct OCResourceCollectionPayload *next;
1156 } OCResourceCollectionPayload;
1157
1158 typedef struct
1159 {
1160     OCPayload base;
1161
1162     /** Device Id */
1163     char *sid;
1164
1165     /** A special case for handling RD address. */
1166     char* baseURI;
1167
1168     /** Name */
1169     char *name;
1170
1171     /** HREF */
1172     char *uri;
1173
1174     /** Resource Type */
1175     char *type;
1176
1177     /** Interface */
1178     OCStringLL *interface;
1179
1180     /** This structure holds the old /oic/res response. */
1181     OCResourcePayload *resources;
1182
1183 } OCDiscoveryPayload;
1184
1185 /**
1186  * Structure holding discovery payload.
1187  */
1188 typedef struct
1189 {
1190     /** Device Name. */
1191     OCDeviceInfo n;
1192     /** Device Identity. */
1193     OCIdentity di;
1194     /** Value holding the bias factor of the RD. */
1195     uint8_t sel;
1196 } OCRDDiscoveryPayload;
1197
1198 /**
1199  * RD Payload that will be transmitted over the wire.
1200  */
1201 typedef struct
1202 {
1203     OCPayload base;
1204     /** Pointer to the discovery response payload.*/
1205     OCRDDiscoveryPayload *rdDiscovery;
1206     /** Pointer to the publish payload.*/
1207     OCResourceCollectionPayload *rdPublish;
1208 } OCRDPayload;
1209
1210 typedef struct
1211 {
1212     OCPayload base;
1213     char *sid;
1214     char* deviceName;
1215     char* specVersion;
1216     char* dataModelVersion;
1217     OCStringLL *interfaces;
1218     OCStringLL *types;
1219 } OCDevicePayload;
1220
1221 typedef struct
1222 {
1223     OCPayload base;
1224     char* uri;
1225     OCPlatformInfo info;
1226     char* rt;
1227     OCStringLL* interfaces;
1228 } OCPlatformPayload;
1229
1230 typedef struct
1231 {
1232     OCPayload base;
1233     char* securityData;
1234 } OCSecurityPayload;
1235 #ifdef WITH_PRESENCE
1236 typedef struct
1237 {
1238     OCPayload base;
1239     uint32_t sequenceNumber;
1240     uint32_t maxAge;
1241     OCPresenceTrigger trigger;
1242     char* resourceType;
1243 } OCPresencePayload;
1244 #endif
1245
1246 /**
1247  * Incoming requests handled by the server. Requests are passed in as a parameter to the
1248  * OCEntityHandler callback API.
1249  * The OCEntityHandler callback API must be implemented in the application in order
1250  * to receive these requests.
1251  */
1252 typedef struct
1253 {
1254     /** Associated resource.*/
1255     OCResourceHandle resource;
1256
1257     /** Associated request handle.*/
1258     OCRequestHandle requestHandle;
1259
1260     /** the REST method retrieved from received request PDU.*/
1261     OCMethod method;
1262
1263     /** description of endpoint that sent the request.*/
1264     OCDevAddr devAddr;
1265
1266     /** resource query send by client.*/
1267     char * query;
1268
1269     /** Information associated with observation - valid only when OCEntityHandler flag includes
1270      * ::OC_OBSERVE_FLAG.*/
1271     OCObservationInfo obsInfo;
1272
1273     /** Number of the received vendor specific header options.*/
1274     uint8_t numRcvdVendorSpecificHeaderOptions;
1275
1276     /** Pointer to the array of the received vendor specific header options.*/
1277     OCHeaderOption * rcvdVendorSpecificHeaderOptions;
1278
1279     /** the payload from the request PDU.*/
1280     OCPayload *payload;
1281
1282 } OCEntityHandlerRequest;
1283
1284
1285 /**
1286  * Response from queries to remote servers. Queries are made by calling the OCDoResource API.
1287  */
1288 typedef struct
1289 {
1290     /** Address of remote server.*/
1291     OCDevAddr devAddr;
1292
1293     /** backward compatibility (points to devAddr).*/
1294     OCDevAddr *addr;
1295
1296     /** backward compatibility.*/
1297     OCConnectivityType connType;
1298
1299     /** the security identity of the remote server.*/
1300     OCIdentity identity;
1301
1302     /** the is the result of our stack, OCStackResult should contain coap/other error codes.*/
1303     OCStackResult result;
1304
1305     /** If associated with observe, this will represent the sequence of notifications from server.*/
1306     uint32_t sequenceNumber;
1307
1308     /** resourceURI.*/
1309     const char * resourceUri;
1310
1311     /** the payload for the response PDU.*/
1312     OCPayload *payload;
1313
1314     /** Number of the received vendor specific header options.*/
1315     uint8_t numRcvdVendorSpecificHeaderOptions;
1316
1317     /** An array of the received vendor specific header options.*/
1318     OCHeaderOption rcvdVendorSpecificHeaderOptions[MAX_HEADER_OPTIONS];
1319 } OCClientResponse;
1320
1321 /**
1322  * Request handle is passed to server via the entity handler for each incoming request.
1323  * Stack assigns when request is received, server sets to indicate what request response is for.
1324  */
1325 typedef struct
1326 {
1327     /** Request handle.*/
1328     OCRequestHandle requestHandle;
1329
1330     /** Resource handle.*/
1331     OCResourceHandle resourceHandle;
1332
1333     /** Allow the entity handler to pass a result with the response.*/
1334     OCEntityHandlerResult  ehResult;
1335
1336     /** This is the pointer to server payload data to be transferred.*/
1337     OCPayload* payload;
1338
1339     /** number of the vendor specific header options .*/
1340     uint8_t numSendVendorSpecificHeaderOptions;
1341
1342     /** An array of the vendor specific header options the entity handler wishes to use in response.*/
1343     OCHeaderOption sendVendorSpecificHeaderOptions[MAX_HEADER_OPTIONS];
1344
1345     /** URI of new resource that entity handler might create.*/
1346     char resourceUri[MAX_URI_LENGTH];
1347
1348     /** Server sets to true for persistent response buffer,false for non-persistent response buffer*/
1349     uint8_t persistentBufferFlag;
1350 } OCEntityHandlerResponse;
1351
1352 /**
1353  * Entity's state
1354  */
1355 typedef enum
1356 {
1357     /** Request state.*/
1358     OC_REQUEST_FLAG = (1 << 1),
1359     /** Observe state.*/
1360     OC_OBSERVE_FLAG = (1 << 2)
1361 } OCEntityHandlerFlag;
1362
1363 /**
1364  * Possible returned values from client application.
1365  */
1366 typedef enum
1367 {
1368     OC_STACK_DELETE_TRANSACTION = 0,
1369     OC_STACK_KEEP_TRANSACTION
1370 } OCStackApplicationResult;
1371
1372
1373 //#ifdef DIRECT_PAIRING
1374 /**
1375  * @brief   direct pairing Method Type.
1376  *              0:  not allowed
1377  *              1:  pre-configured pin
1378  *              2:  random pin
1379  */
1380 typedef enum OCPrm
1381 {
1382     DP_NOT_ALLOWED             = 0x0,
1383     DP_PRE_CONFIGURED        = (0x1 << 0),
1384     DP_RANDOM_PIN               = (0x1 << 1),
1385 } OCPrm_t;
1386
1387 /**
1388  * Device Information of discoverd direct pairing device(s).
1389  */
1390 typedef struct OCDPDev
1391 {
1392     OCDevAddr               endpoint;
1393     OCConnectivityType   connType;
1394     uint16_t                     securePort;
1395     bool                  edp;
1396     OCPrm_t           *prm;
1397     size_t                prmLen;
1398     OCUUIdentity     deviceID;
1399     OCUUIdentity     rowner;
1400     struct OCDPDev *next;
1401 } OCDPDev_t;
1402 //#endif // DIRECT_PAIRING
1403
1404 /*
1405  * -------------------------------------------------------------------------------------------
1406  * Callback function definitions
1407  * -------------------------------------------------------------------------------------------
1408  */
1409
1410 /**
1411  * Client applications implement this callback to consume responses received from Servers.
1412  */
1413 typedef OCStackApplicationResult (* OCClientResponseHandler)(void *context, OCDoHandle handle,
1414     OCClientResponse * clientResponse);
1415
1416 /**
1417  * Client applications using a context pointer implement this callback to delete the
1418  * context upon removal of the callback/context pointer from the internal callback-list.
1419  */
1420 typedef void (* OCClientContextDeleter)(void *context);
1421
1422 /**
1423  * This info is passed from application to OC Stack when initiating a request to Server.
1424  */
1425 typedef struct OCCallbackData
1426 {
1427     /** Pointer to the context.*/
1428     void *context;
1429
1430     /** The pointer to a function the stack will call to handle the requests.*/
1431     OCClientResponseHandler cb;
1432
1433     /** A pointer to a function to delete the context when this callback is removed.*/
1434     OCClientContextDeleter cd;
1435
1436 #ifdef SUPPORTS_DEFAULT_CTOR
1437     OCCallbackData() = default;
1438     OCCallbackData(void* ctx, OCClientResponseHandler callback, OCClientContextDeleter deleter)
1439         :context(ctx), cb(callback), cd(deleter){}
1440 #endif
1441 } OCCallbackData;
1442
1443 /**
1444  * Application server implementations must implement this callback to consume requests OTA.
1445  * Entity handler callback needs to fill the resPayload of the entityHandlerRequest.
1446  */
1447 typedef OCEntityHandlerResult (*OCEntityHandler)
1448 (OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, void* callbackParam);
1449
1450 /**
1451  * Device Entity handler need to use this call back instead of OCEntityHandler.
1452  */
1453 typedef OCEntityHandlerResult (*OCDeviceEntityHandler)
1454 (OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, char* uri, void* callbackParam);
1455
1456 //#ifdef DIRECT_PAIRING
1457 /**
1458  * Callback function definition of direct-pairing
1459  *
1460  * @param[OUT] peer - pairing device info.
1461  * @param[OUT} result - It's returned with 'OC_STACK_XXX'. It will return 'OC_STACK_OK'
1462  *                                   if D2D pairing is success without error
1463  */
1464 typedef void (*OCDirectPairingCB)(OCDPDev_t *peer, OCStackResult result);
1465 //#endif // DIRECT_PAIRING
1466
1467 #ifdef __cplusplus
1468 }
1469 #endif // __cplusplus
1470
1471 #endif /* OCTYPES_H_ */