9fd62d1db53bf4a409771e3633ef43682d2c8442
[platform/upstream/iotivity.git] / resource / csdk / connectivity / api / cacommon.h
1 /* ****************************************************************
2  *
3  * Copyright 2014 Samsung Electronics 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  * @file cacommon.h
23  * This file contains the common data structures between Resource , CA and adapters
24  */
25
26 #ifndef CA_COMMON_H_
27 #define CA_COMMON_H_
28
29 #include "iotivity_config.h"
30
31 #ifndef WITH_ARDUINO
32 #ifdef TCP_ADAPTER
33 #define HAVE_SYS_POLL_H
34 #endif
35 #endif
36
37 #include <stdint.h>
38 #include <stdlib.h>
39 #include <stdbool.h>
40
41 #ifdef HAVE_SYS_POLL_H
42 #include <sys/poll.h>
43 #endif
44
45 #ifdef HAVE_WINSOCK2_H
46 #include <winsock2.h>
47 #include <mswsock.h>
48 #endif
49
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54
55 /**
56  * IP address Length.
57  */
58 #define CA_IPADDR_SIZE 16
59
60 /**
61  * Remote Access jabber ID length.
62  */
63 #define CA_RAJABBERID_SIZE 256
64
65 /**
66  * Mac address length for BT port.
67  */
68 #define CA_MACADDR_SIZE 18
69
70 /**
71  * Max header options data length.
72  */
73 #ifdef ARDUINO
74 #define CA_MAX_HEADER_OPTION_DATA_LENGTH 20
75 #else
76 #define CA_MAX_HEADER_OPTION_DATA_LENGTH 1024
77 #endif
78
79 /**
80 * Max token length.
81 */
82 #define CA_MAX_TOKEN_LEN (8)
83
84 /**
85  * Max URI length.
86  */
87 #ifdef ARDUINO
88 #define CA_MAX_URI_LENGTH 128  /* maximum size of URI for embedded platforms*/
89 #else
90 #define CA_MAX_URI_LENGTH 512 /* maximum size of URI for other platforms*/
91 #endif
92
93 /**
94  * Max PDU length supported.
95  */
96 #ifdef ARDUINO
97 #define COAP_MAX_PDU_SIZE           320  /* maximum size of a CoAP PDU for embedded platforms*/
98 #else
99 #define COAP_MAX_PDU_SIZE           1400 /* maximum size of a CoAP PDU for big platforms*/
100 #endif
101
102 #ifdef WITH_BWT
103 #define CA_DEFAULT_BLOCK_SIZE       CA_BLOCK_SIZE_1024_BYTE
104 #endif
105
106 /**
107  *Maximum length of the remoteEndpoint identity.
108  */
109 #define CA_MAX_ENDPOINT_IDENTITY_LEN   (32)
110
111 /**
112  * option types - the highest option number 63.
113  */
114 #define CA_OPTION_IF_MATCH 1
115 #define CA_OPTION_ETAG 4
116 #define CA_OPTION_IF_NONE_MATCH 5
117 #define CA_OPTION_OBSERVE 6
118 #define CA_OPTION_LOCATION_PATH 8
119 #define CA_OPTION_URI_PATH 11
120 #define CA_OPTION_CONTENT_FORMAT 12
121 #define CA_OPTION_CONTENT_TYPE COAP_OPTION_CONTENT_FORMAT
122 #define CA_OPTION_MAXAGE 14
123 #define CA_OPTION_URI_QUERY 15
124 #define CA_OPTION_ACCEPT 17
125 #define CA_OPTION_LOCATION_QUERY 20
126
127 /**
128  * Payload information from resource model.
129  */
130 typedef uint8_t *CAPayload_t;
131
132 /**
133  * URI for the OIC base.CA considers relative URI as the URI.
134  */
135 typedef char *CAURI_t;
136
137 /**
138  * Token information for mapping the request and responses by resource model.
139  */
140 typedef char *CAToken_t;
141
142 /*
143  * Socket types and error definitions.
144  */
145 #ifdef HAVE_WINSOCK2_H
146 # define OC_SOCKET_ERROR      SOCKET_ERROR
147 # define OC_INVALID_SOCKET    INVALID_SOCKET
148 typedef SOCKET CASocketFd_t;
149 #else // HAVE_WINSOCK2_H
150 # define OC_SOCKET_ERROR      (-1)
151 # define OC_INVALID_SOCKET    (-1)
152 typedef int    CASocketFd_t;
153 #endif
154
155 /*
156  * The following flags are the same as the equivalent OIC values in
157  * octypes.h, allowing direct copying with slight fixup.
158  * The CA layer should used the OC types when build allows that.
159  */
160 #ifdef RA_ADAPTER
161 #define MAX_ADDR_STR_SIZE_CA (256)
162 #else
163 /*
164  * Max Address could be "coaps+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyy.yyy.yyy.yyy]:xxxxx"
165  * Which is 65, +1 for null terminator => 66
166  * OCDevAddr (defined in OCTypes.h) must be the same
167  * as CAEndpoint_t (defined here)
168  */
169 #define MAX_ADDR_STR_SIZE_CA (66)
170 #endif
171
172 typedef enum
173 {
174     CA_DEFAULT_ADAPTER = 0,
175
176     // value zero indicates discovery
177     CA_ADAPTER_IP            = (1 << 0),   // IPv4 and IPv6, including 6LoWPAN
178     CA_ADAPTER_GATT_BTLE     = (1 << 1),   // GATT over Bluetooth LE
179     CA_ADAPTER_RFCOMM_BTEDR  = (1 << 2),   // RFCOMM over Bluetooth EDR
180
181 #ifdef RA_ADAPTER
182     CA_ADAPTER_REMOTE_ACCESS = (1 << 3),   // Remote Access over XMPP.
183 #endif
184
185     CA_ADAPTER_TCP           = (1 << 4),   // CoAP over TCP
186     CA_ADAPTER_NFC           = (1 << 5),   // NFC Adapter
187
188     CA_ALL_ADAPTERS          = 0xffffffff
189 } CATransportAdapter_t;
190
191 typedef enum
192 {
193     CA_DEFAULT_FLAGS = 0,
194
195     // Insecure transport is the default (subject to change)
196     CA_SECURE          = (1 << 4),   // secure the transport path
197     // IPv4 & IPv6 autoselection is the default
198     CA_IPV6            = (1 << 5),   // IP adapter only
199     CA_IPV4            = (1 << 6),   // IP adapter only
200     // Indication that a message was received by multicast.
201     CA_MULTICAST       = (1 << 7),
202     // Link-Local multicast is the default multicast scope for IPv6.
203     // These correspond in both value and position to the IPv6 address bits.
204     CA_SCOPE_INTERFACE = 0x1, // IPv6 Interface-Local scope
205     CA_SCOPE_LINK      = 0x2, // IPv6 Link-Local scope (default)
206     CA_SCOPE_REALM     = 0x3, // IPv6 Realm-Local scope
207     CA_SCOPE_ADMIN     = 0x4, // IPv6 Admin-Local scope
208     CA_SCOPE_SITE      = 0x5, // IPv6 Site-Local scope
209     CA_SCOPE_ORG       = 0x8, // IPv6 Organization-Local scope
210     CA_SCOPE_GLOBAL    = 0xE, // IPv6 Global scope
211 } CATransportFlags_t;
212
213 #define CA_IPFAMILY_MASK (CA_IPV6|CA_IPV4)
214 #define CA_SCOPE_MASK 0xf     // mask scope bits above
215
216 /**
217  * Information about the network status.
218  */
219 typedef enum
220 {
221     CA_INTERFACE_DOWN,   /**< Connection is not available */
222     CA_INTERFACE_UP    /**< Connection is Available */
223 } CANetworkStatus_t;
224
225 /*
226  * remoteEndpoint identity.
227  */
228 typedef struct
229 {
230     uint16_t id_length;
231     unsigned char id[CA_MAX_ENDPOINT_IDENTITY_LEN];
232 } CARemoteId_t;
233
234 /**
235  * Message Type for Base source code.
236  */
237 typedef enum
238 {
239     CA_MSG_CONFIRM = 0,  /**< confirmable message (requires ACK/RST) */
240     CA_MSG_NONCONFIRM,   /**< non-confirmable message (one-shot message) */
241     CA_MSG_ACKNOWLEDGE,  /**< used to acknowledge confirmable messages */
242     CA_MSG_RESET         /**< used to indicates not-interested or error (lack of context)in
243                                                   received messages */
244 } CAMessageType_t;
245
246 /**
247  * Allowed method to be used by resource model.
248  */
249 typedef enum
250 {
251     CA_GET = 1, /**< GET Method  */
252     CA_POST,    /**< POST Method */
253     CA_PUT,     /**< PUT Method */
254     CA_DELETE   /**< DELETE Method */
255 } CAMethod_t;
256
257 /**
258  * block size.
259  * it depends on defined size in libCoAP.
260  */
261 typedef enum
262 {
263     CA_BLOCK_SIZE_16_BYTE = 0,    /**< 16byte */
264     CA_BLOCK_SIZE_32_BYTE = 1,    /**< 32byte */
265     CA_BLOCK_SIZE_64_BYTE = 2,    /**< 64byte */
266     CA_BLOCK_SIZE_128_BYTE = 3,   /**< 128byte */
267     CA_BLOCK_SIZE_256_BYTE = 4,   /**< 256byte */
268     CA_BLOCK_SIZE_512_BYTE = 5,   /**< 512byte */
269     CA_BLOCK_SIZE_1024_BYTE = 6     /**< 1Kbyte */
270 } CABlockSize_t;
271
272 /**
273  * Endpoint information for connectivities.
274  * Must be identical to OCDevAddr.
275  */
276 typedef struct
277 {
278     CATransportAdapter_t    adapter;    // adapter type
279     CATransportFlags_t      flags;      // transport modifiers
280     uint16_t                port;       // for IP
281     char                    addr[MAX_ADDR_STR_SIZE_CA]; // address for all
282     uint32_t                ifindex;    // usually zero for default interface
283 #if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
284     char                    routeData[MAX_ADDR_STR_SIZE_CA]; /**< GatewayId:ClientId of
285                                                                     destination. **/
286 #endif
287 } CAEndpoint_t;
288
289 /**
290  * Endpoint information for secure messages.
291  */
292 typedef struct
293 {
294     CAEndpoint_t endpoint;      /**< endpoint */
295     // TODO change name to deviceId
296     CARemoteId_t identity;      /**< endpoint device uuid */
297     CARemoteId_t userId;        /**< endpoint user uuid */
298 } CASecureEndpoint_t;
299
300 /**
301  * Enums for CA return values.
302  */
303 typedef enum
304 {
305     /* Result code - START HERE */
306     CA_STATUS_OK = 0,               /**< Success */
307     CA_STATUS_INVALID_PARAM,        /**< Invalid Parameter */
308     CA_ADAPTER_NOT_ENABLED,         /**< Adapter is not enabled */
309     CA_SERVER_STARTED_ALREADY,      /**< Server is started already */
310     CA_SERVER_NOT_STARTED,          /**< Server is not started */
311     CA_DESTINATION_NOT_REACHABLE,   /**< Destination is not reachable */
312     CA_SOCKET_OPERATION_FAILED,     /**< Socket operation failed */
313     CA_SEND_FAILED,                 /**< Send request failed */
314     CA_RECEIVE_FAILED,              /**< Receive failed */
315     CA_MEMORY_ALLOC_FAILED,         /**< Memory allocation failed */
316     CA_REQUEST_TIMEOUT,             /**< Request is Timeout */
317     CA_DESTINATION_DISCONNECTED,    /**< Destination is disconnected */
318     CA_NOT_SUPPORTED,               /**< Not supported */
319     CA_STATUS_NOT_INITIALIZED,      /**< Not Initialized*/
320     CA_DTLS_AUTHENTICATION_FAILURE, /**< Decryption error in DTLS */
321     CA_STATUS_FAILED =255           /**< Failure */
322     /* Result code - END HERE */
323 } CAResult_t;
324
325 /**
326  * Enums for CA Response values.
327  */
328 typedef enum
329 {
330     /* Response status code - START HERE */
331     CA_EMPTY = 0,                           /**< Empty */
332     CA_CREATED = 201,                       /**< Created */
333     CA_DELETED = 202,                       /**< Deleted */
334     CA_VALID = 203,                         /**< Valid */
335     CA_CHANGED = 204,                       /**< Changed */
336     CA_CONTENT = 205,                       /**< Content */
337     CA_CONTINUE = 231,                      /**< Continue */
338     CA_BAD_REQ = 400,                       /**< Bad Request */
339     CA_UNAUTHORIZED_REQ = 401,              /**< Unauthorized Request */
340     CA_BAD_OPT = 402,                       /**< Bad Option */
341     CA_FORBIDDEN_REQ = 403,                 /**< Forbidden Request */
342     CA_NOT_FOUND = 404,                     /**< Not found */
343     CA_METHOD_NOT_ALLOWED = 405,            /**< Method Not Allowed */
344     CA_NOT_ACCEPTABLE = 406,                /**< Not Acceptable */
345     CA_REQUEST_ENTITY_INCOMPLETE = 408,     /**< Request Entity Incomplete */
346     CA_REQUEST_ENTITY_TOO_LARGE = 413,      /**< Request Entity Too Large */
347     CA_INTERNAL_SERVER_ERROR = 500,         /**< Internal Server Error */
348     CA_BAD_GATEWAY = 502,
349     CA_RETRANSMIT_TIMEOUT = 504,            /**< Retransmit timeout */
350     CA_PROXY_NOT_SUPPORTED = 505            /**< Proxy not enabled to service a request */
351     /* Response status code - END HERE */
352 } CAResponseResult_t;
353
354 /**
355  * Data type whether the data is Request Message or Response Message.
356  * if there is some failure before send data on network.
357  * Type will be set as error type for error callback.
358  */
359 typedef enum
360 {
361     CA_REQUEST_DATA = 1,
362     CA_RESPONSE_DATA,
363     CA_ERROR_DATA,
364     CA_RESPONSE_FOR_RES
365 } CADataType_t;
366
367 /**
368  * Transport Protocol IDs for additional options.
369  */
370 typedef enum
371 {
372     CA_INVALID_ID = (1 << 0),   /**< Invalid ID */
373     CA_COAP_ID = (1 << 1)       /**< COAP ID */
374 } CATransportProtocolID_t;
375
376 /**
377  * Adapter State to indicate the network changed notifications.
378  */
379 typedef enum
380 {
381     CA_ADAPTER_DISABLED,   /**< Adapter is Disabled */
382     CA_ADAPTER_ENABLED     /**< Adapter is Enabled */
383 } CAAdapterState_t;
384
385 /**
386  * Format indicating which encoding has been used on the payload.
387  */
388 typedef enum
389 {
390     CA_FORMAT_UNDEFINED = 0,            /**< Undefined enoding format */
391     CA_FORMAT_TEXT_PLAIN,
392     CA_FORMAT_APPLICATION_LINK_FORMAT,
393     CA_FORMAT_APPLICATION_XML,
394     CA_FORMAT_APPLICATION_OCTET_STREAM,
395     CA_FORMAT_APPLICATION_RDF_XML,
396     CA_FORMAT_APPLICATION_EXI,
397     CA_FORMAT_APPLICATION_JSON,
398     CA_FORMAT_APPLICATION_CBOR,
399     CA_FORMAT_UNSUPPORTED
400 } CAPayloadFormat_t;
401
402 /**
403  * Header options structure to be filled.
404  *
405  * This structure is used to hold header information.
406  */
407 typedef struct
408 {
409     CATransportProtocolID_t protocolID;                     /**< Protocol ID of the Option */
410     uint16_t optionID;                                      /**< The header option ID which will be
411                                                             added to communication packets */
412     uint16_t optionLength;                                  /**< Option Length **/
413     char optionData[CA_MAX_HEADER_OPTION_DATA_LENGTH];      /**< Optional data values**/
414 } CAHeaderOption_t;
415
416 /**
417  * Base Information received.
418  *
419  * This structure is used to hold request & response base information.
420  */
421 typedef struct
422 {
423     CAMessageType_t type;       /**< Qos for the request */
424 #ifdef ROUTING_GATEWAY
425     bool skipRetransmission;    /**< Will not attempt retransmission even if type is CONFIRM.
426                                      Required for packet forwarding */
427 #endif
428     uint16_t messageId;         /**< Message id.
429                                  * if message id is zero, it will generated by CA inside.
430                                  * otherwise, you can use it */
431     CAToken_t token;            /**< Token for CA */
432     uint8_t tokenLength;        /**< token length */
433     CAHeaderOption_t *options;  /** Header Options for the request */
434     uint8_t numOptions;         /**< Number of Header options */
435     CAPayload_t payload;        /**< payload of the request  */
436     size_t payloadSize;         /**< size in bytes of the payload */
437     CAPayloadFormat_t payloadFormat;    /**< encoding format of the request payload */
438     CAPayloadFormat_t acceptFormat;     /**< accept format for the response payload */
439     CAURI_t resourceUri;        /**< Resource URI information **/
440     CARemoteId_t identity;      /**< endpoint identity */
441     CADataType_t dataType;      /**< data type */
442 } CAInfo_t;
443
444 /**
445  * Request Information to be sent.
446  *
447  * This structure is used to hold request information.
448  */
449 typedef struct
450 {
451     CAMethod_t method;  /**< Name of the Method Allowed */
452     CAInfo_t info;      /**< Information of the request. */
453     bool isMulticast;   /**< is multicast request */
454 } CARequestInfo_t;
455
456 /**
457  * Response information received.
458  *
459  * This structure is used to hold response information.
460  */
461 typedef struct
462 {
463     CAResponseResult_t result;  /**< Result for response by resource model */
464     CAInfo_t info;              /**< Information of the response */
465     bool isMulticast;
466 } CAResponseInfo_t;
467
468 /**
469  * Error information from CA
470  *        contains error code and message information.
471  *
472  * This structure holds error information.
473  */
474 typedef struct
475 {
476     CAResult_t result;  /**< CA API request result  */
477     CAInfo_t info;      /**< message information such as token and payload data
478                              helpful to identify the error */
479 } CAErrorInfo_t;
480
481 /**
482  * Hold global variables for CA layer. (also used by RI layer)
483  */
484 typedef struct
485 {
486     CASocketFd_t fd;    /**< socket fd */
487     uint16_t port;      /**< socket port */
488 } CASocket_t;
489
490 #define HISTORYSIZE (4)
491
492 typedef struct
493 {
494     CATransportFlags_t flags;
495     uint16_t messageId;
496     char token[CA_MAX_TOKEN_LEN];
497     uint8_t tokenLength;
498 } CAHistoryItem_t;
499
500 typedef struct
501 {
502     int nextIndex;
503     CAHistoryItem_t items[HISTORYSIZE];
504 } CAHistory_t;
505
506 /**
507  * Hold interface index for keeping track of comings and goings.
508  */
509 typedef struct
510 {
511     int32_t ifIndex; /**< network interface index */
512 } CAIfItem_t;
513
514 /**
515  * Hold the port number assigned from application.
516  * It will be used when creating a socket.
517  */
518 typedef struct
519 {
520     struct udpports
521     {
522         uint16_t u6;    /**< unicast IPv6 socket port */
523         uint16_t u6s;   /**< unicast IPv6 socket secure port */
524         uint16_t u4;    /**< unicast IPv4 socket port */
525         uint16_t u4s;   /**< unicast IPv4 socket secure port */
526     } udp;
527 #ifdef TCP_ADAPTER
528     struct tcpports
529     {
530         uint16_t u4;    /**< unicast IPv4 socket port */
531         uint16_t u6;    /**< unicast IPv6 socket port */
532     } tcp;
533 #endif
534 } CAPorts_t;
535
536 typedef struct
537 {
538     CATransportFlags_t clientFlags; /**< flag for client */
539     CATransportFlags_t serverFlags; /**< flag for server */
540     bool client; /**< client mode */
541     bool server; /**< server mode */
542
543     CAPorts_t ports;
544
545     struct sockets
546     {
547         void *threadpool;           /**< threadpool between Initialize and Start */
548         CASocket_t u6;              /**< unicast   IPv6 */
549         CASocket_t u6s;             /**< unicast   IPv6 secure */
550         CASocket_t u4;              /**< unicast   IPv4 */
551         CASocket_t u4s;             /**< unicast   IPv4 secure */
552         CASocket_t m6;              /**< multicast IPv6 */
553         CASocket_t m6s;             /**< multicast IPv6 secure */
554         CASocket_t m4;              /**< multicast IPv4 */
555         CASocket_t m4s;             /**< multicast IPv4 secure */
556         CASocketFd_t netlinkFd;     /**< netlink */
557 #if defined(_WIN32)
558         WSAEVENT shutdownEvent;     /**< Event used to signal threads to stop */
559 #else
560         int shutdownFds[2];         /**< fds used to signal threads to stop */
561 #endif
562         int selectTimeout;          /**< in seconds */
563         int maxfd;                  /**< highest fd (for select) */
564         bool started;               /**< the IP adapter has started */
565         bool terminate;             /**< the IP adapter needs to stop */
566         bool ipv6enabled;           /**< IPv6 enabled by OCInit flags */
567         bool ipv4enabled;           /**< IPv4 enabled by OCInit flags */
568         bool dualstack;             /**< IPv6 and IPv4 enabled */
569 #if defined (_WIN32)
570         LPFN_WSARECVMSG wsaRecvMsg; /**< Win32 function pointer to WSARecvMsg() */
571 #endif
572
573         struct networkmonitors
574         {
575             CAIfItem_t *ifItems; /**< current network interface index list */
576             size_t sizeIfItems;  /**< size of network interface index array */
577             size_t numIfItems;   /**< number of valid network interfaces */
578         } nm;
579     } ip;
580
581     struct calayer
582     {
583         CAHistory_t requestHistory;  /**< filter IP family in requests */
584     } ca;
585
586 #ifdef TCP_ADAPTER
587     /**
588      * Hold global variables for TCP Adapter.
589      */
590     struct tcpsockets
591     {
592         void *threadpool;       /**< threadpool between Initialize and Start */
593         CASocket_t ipv4;        /**< IPv4 accept socket */
594         CASocket_t ipv6;        /**< IPv6 accept socket */
595         void *svrlist;          /**< unicast IPv4 TCP server information*/
596         int selectTimeout;      /**< in seconds */
597         int listenBacklog;      /**< backlog counts*/
598         int shutdownFds[2];     /**< shutdown pipe */
599         int connectionFds[2];   /**< connection pipe */
600         int maxfd;              /**< highest fd (for select) */
601         bool started;           /**< the TCP adapter has started */
602         bool terminate;         /**< the TCP adapter needs to stop */
603         bool ipv4tcpenabled;    /**< IPv4 TCP enabled by OCInit flags */
604         bool ipv6tcpenabled;    /**< IPv6 TCP enabled by OCInit flags */
605     } tcp;
606 #endif
607 } CAGlobals_t;
608
609 extern CAGlobals_t caglobals;
610
611 /**
612  * Callback function type for request delivery.
613  * @param[out]   object       Endpoint object from which the request is received.
614  *                            It contains endpoint address based on the connectivity type.
615  * @param[out]   requestInfo  Info for resource model to understand about the request.
616  */
617 typedef void (*CARequestCallback)(const CAEndpoint_t *object,
618                                   const CARequestInfo_t *requestInfo);
619
620 /**
621  * Callback function type for response delivery.
622  * @param[out]   object           Endpoint object from which the response is received.
623  * @param[out]   responseInfo     Identifier which needs to be mapped with response.
624  */
625 typedef void (*CAResponseCallback)(const CAEndpoint_t *object,
626                                    const CAResponseInfo_t *responseInfo);
627 /**
628  * Callback function type for error.
629  * @param[out]   object           remote device information.
630  * @param[out]   errorInfo        CA Error information.
631  */
632 typedef void (*CAErrorCallback)(const CAEndpoint_t *object,
633                                 const CAErrorInfo_t *errorInfo);
634
635 /**
636  * Callback function type for network status changes delivery from CA common logic.
637  * @param[out]   info       Endpoint object from which the network status is changed.
638  *                          It contains endpoint address based on the connectivity type.
639  * @param[out]   status     Current network status info.
640  */
641 typedef void (*CANetworkMonitorCallback)(const CAEndpoint_t *info, CANetworkStatus_t status);
642
643 #ifdef __cplusplus
644 } /* extern "C" */
645 #endif
646
647 #endif // CA_COMMON_H_