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