3 * Copyright (c) 2020 Apple Computer, Inc. All rights reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * This file contains definitions for the SRP Advertising Proxy CoreThreadRadio
18 * API on MacOS, which is private API used to control and manage the wpantund
19 * and thereby manage the thread network.
22 #ifndef CTI_SERVICES_H
23 #define CTI_SERVICES_H
25 #include <netinet/in.h>
26 #include <arpa/inet.h>
27 #include <dispatch/dispatch.h>
31 #if (defined(__GNUC__) && (__GNUC__ >= 4))
32 #define DNS_SERVICES_EXPORT __attribute__((visibility("default")))
34 #define DNS_SERVICES_EXPORT
37 // cti_connection: Opaque internal data type
38 typedef struct _cti_connection_t
*cti_connection_t
;
42 kCTIStatus_NoError
= 0,
43 kCTIStatus_UnknownError
= -65537, /* 0xFFFE FFFF */
44 kCTIStatus_NoMemory
= -65539, /* No Memory */
45 kCTIStatus_BadParam
= -65540, /* Client passed invalid arg */
46 kCTIStatus_DaemonNotRunning
= -65563, /* Daemon not running */
47 kCTIStatus_Disconnected
= -65569 /* XPC connection disconnected. */
50 // Enum values for kWPANTUNDStateXXX (see wpan-properties.h)
52 kCTI_NCPState_Uninitialized
,
54 kCTI_NCPState_Upgrading
,
55 kCTI_NCPState_DeepSleep
,
56 kCTI_NCPState_Offline
,
57 kCTI_NCPState_Commissioned
,
58 kCTI_NCPState_Associating
,
59 kCTI_NCPState_CredentialsNeeded
,
60 kCTI_NCPState_Associated
,
61 kCTI_NCPState_Isolated
,
62 kCTI_NCPState_NetWake_Asleep
,
63 kCTI_NCPState_NetWake_Waking
,
65 } cti_network_state_t
;
68 kCTI_NetworkNodeType_Unknown
,
69 kCTI_NetworkNodeType_Router
,
70 kCTI_NetworkNodeType_EndDevice
,
71 kCTI_NetworkNodeType_SleepyEndDevice
,
72 kCTI_NetworkNodeType_NestLurker
,
73 kCTI_NetworkNodeType_Commissioner
,
74 kCTI_NetworkNodeType_Leader
,
75 } cti_network_node_type_t
;
77 typedef struct _cti_service
{
78 uint64_t enterprise_number
;
79 uint16_t service_type
;
80 uint16_t service_version
;
81 uint8_t *NONNULL server
;
84 int flags
; // E.g., kCTIFlag_NCP
87 typedef struct _cti_service_vec
{
90 cti_service_t
*NULLABLE
*NONNULL services
;
93 typedef struct _cti_prefix
{
94 struct in6_addr prefix
;
101 typedef struct _cti_prefix_vec
{
104 cti_prefix_t
*NULLABLE
*NONNULL prefixes
;
108 #define kCTIFlag_Stable 1
109 #define kCTIFlag_NCP 2
111 /*********************************************************************************************
113 * wpantund private SPI for use in SRP Advertising Proxy
115 *********************************************************************************************/
119 * A general reply mechanism to indicate success or failure for a cti call that doesn't
122 * cti_reply parameters:
124 * context: The context that was passed to the cti service call to which this is a callback.
126 * status: Will be kCTIStatus_NoError on success, otherwise will indicate the
127 * failure that occurred.
132 (*cti_reply_t
)(void *NULLABLE context
, cti_status_t status
);
134 /* cti_tunnel_reply: Callback for cti_get_tunnel_name()
136 * Called exactly once in response to a cti_get_tunnel_name() call, either with an error or with
137 * the name of the tunnel that wpantund is using as the Thread network interface. The invoking
138 * program is responsible for releasing the connection state either during or after the callback.
140 * cti_reply parameters:
142 * context: The context that was passed to the cti service call to which this is a callback.
144 * tunnel_name: If error is kCTIStatus_NoError, this dictionary contains either the response to
145 * a request, or else the content of a CTI event if this is an event callback.
147 * status: Will be kCTIStatus_NoError on success, otherwise will indicate the
148 * failure that occurred.
153 (*cti_tunnel_reply_t
)(void *NULLABLE context
, const char *NONNULL tunnel_name
,
154 cti_status_t status
);
156 /* cti_get_tunnel_name
158 * Get the name of the tunnel that wpantund is presenting as the Thread network interface.
159 * The tunnel name is passed to the reply callback if the request succeeds; otherwise an error
160 * is either returned immediately or returned to the callback.
162 * context: An anonymous pointer that will be passed along to the callback when
165 * client_queueq: Queue the client wants to schedule the callback on (Note: Must not be NULL)
167 * callback: CallBack function for the client that indicates success or failure.
169 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating the
170 * error that occurred. Note: A return value of kCTIStatus_NoError does not mean that the
171 * request succeeded, merely that it was successfully started.
175 DNS_SERVICES_EXPORT cti_status_t
176 cti_get_tunnel_name(void *NULLABLE context
, cti_tunnel_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
);
179 * cti_service_vec_create
181 * creates a service array vector of specified length
183 * num_services: Number of service slots available in the service vector.
185 * return value: NULL, if the call failed; otherwise a service vector capable of containing the requested number of
188 cti_service_vec_t
*NULLABLE
189 cti_service_vec_create_(size_t num_services
, const char *NONNULL file
, int line
);
190 #define cti_service_vec_create(num_services) cti_service_vec_create_(num_services, __FILE__, __LINE__)
193 * cti_service_vec_release
195 * decrements the reference count on the provided service vector and, if it reaches zero, finalizes the service vector,
196 * which calls cti_service_release on each service in the vector, potentially also finalizing them.
198 * num_services: Number of service slots available in the service vector.
200 * return value: NULL, if the call failed; otherwise a service vector capable of containing the requested number of
205 cti_service_vec_release_(cti_service_vec_t
*NONNULL services
, const char *NONNULL file
, int line
);
206 #define cti_service_vec_release(services) cti_service_vec_release_(services, __FILE__, __LINE__)
211 * Creates a service containing the specified information. service and server are retained, and will be
212 * freed using free() when the service object is finalized. Caller must not retain or free these values, and
213 * they must be allocated on the malloc heap.
215 * enterprise_number: The enterprise number for this service.
217 * service_type: The service type, from the service data.
219 * service_version: The service version, from the service data.
221 * server: Server information for this service, stored in network byte order. Format depends on service type.
223 * server_length: Length of server information in bytes.
225 * flags: Thread network status flags, e.g. NCP versue User
227 * return value: NULL, if the call failed; otherwise a service object containing the specified state.
230 cti_service_t
*NULLABLE
231 cti_service_create_(uint64_t enterprise_number
, uint16_t service_type
, uint16_t service_version
,
232 uint8_t *NONNULL server
, size_t server_length
, int flags
,
233 const char *NONNULL file
, int line
);
234 #define cti_service_create(enterprise_number, service_type, service_version, server, server_length, flags) \
235 cti_service_create_(enterprise_number, service_type, service_version, server, server_length, flags, \
239 * cti_service_vec_release
241 * decrements the reference count on the provided service vector and, if it reaches zero, finalizes the service vector,
242 * which calls cti_service_release on each service in the vector, potentially also finalizing them.
244 * services: The service vector to release
246 * return value: NULL, if the call failed; otherwise a service vector capable of containing the requested number of
251 cti_service_release_(cti_service_t
*NONNULL service
, const char *NONNULL file
, int line
);
252 #define cti_service_release(services) cti_service_release(service, __FILE__, __LINE__)
254 /* cti_service_reply: Callback from cti_get_service_list()
256 * Called when an error occurs during processing of the cti_get_service_list call, or when data
257 * is available in response to the call.
259 * In the case of an error, the callback will not be called again, and the caller is responsible for
260 * releasing the connection state and restarting if needed.
262 * The callback will be called once immediately upon success, and once again each time the service list
263 * is updated. If the callback wishes to retain either the cti_service_vec_t or any of the elements
264 * of that vector, the appropriate retain function should be called; when the object is no longer needed,
265 * the corresponding release call must be called.
267 * cti_reply parameters:
269 * context: The context that was passed to the cti service call to which this is a callback.
271 * services: If status is kCTIStatus_NoError, a cti_service_vec_t containing the list of services
272 * provided in the update.
274 * status: Will be kCTIStatus_NoError if the service list request is successful, or
275 * will indicate the failure that occurred.
280 (*cti_service_reply_t
)(void *NULLABLE context
, cti_service_vec_t
*NULLABLE services
, cti_status_t status
);
282 /* cti_get_service_list
284 * Requests wpantund to immediately send the current list of services published in the Thread network data.
285 * Whenever the service list is updated, the callback will be called again with the new information. A
286 * return value of kCTIStatus_NoError means that the caller can expect the reply callback to be called at least
287 * once. Any other error status means that the request could not be sent, and the callback will never be
290 * To discontinue receiving service add/remove callbacks, the calling program should call
291 * cti_connection_ref_deallocate on the conn_ref returned by a successful call to get_service_list();
293 * ref: A pointer to a reference to the connection is stored through ref if ref is not NULL.
294 * When events are no longer needed, call cti_discontinue_events() on the returned pointer.
296 * context: An anonymous pointer that will be passed along to the callback when
299 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
301 * callback: CallBack function for the client that indicates success or failure.
302 * If the get_services call fails, response will be NULL and status
303 * will indicate what went wrong. No further callbacks can be expected
304 * after this. If the request succeeds, then the callback will be called
305 * once immediately with the current service list, and then again whenever
306 * the service list is updated.
308 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
309 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
310 * that the request succeeded, merely that it was successfully started.
314 DNS_SERVICES_EXPORT cti_status_t
315 cti_get_service_list(cti_connection_t NULLABLE
*NULLABLE ref
, void *NULLABLE context
, cti_service_reply_t NONNULL callback
,
316 dispatch_queue_t NONNULL client_queue
);
319 * cti_service_vec_create
321 * creates a service array vector of specified length
323 * num_prefixes: Number of prefix slots available in the prefix vector.
325 * return value: NULL, if the call failed; otherwise a prefix vector capable of containing the requested number of
328 cti_prefix_vec_t
*NULLABLE
329 cti_prefix_vec_create_(size_t num_prefixes
, const char *NONNULL file
, int line
);
330 #define cti_prefix_vec_create(num_prefixes) cti_prefix_vec_create_(num_prefixes, __FILE__, __LINE__)
333 * cti_prefix_vec_release
335 * decrements the reference count on the provided prefix vector and, if it reaches zero, finalizes the prefix vector,
336 * which calls cti_prefix_release on each prefix in the vector, potentially also finalizing them.
338 * num_prefixes: Number of prefix slots available in the prefix vector.
340 * return value: NULL, if the call failed; otherwise a prefix vector capable of containing the requested number of
345 cti_prefix_vec_release_(cti_prefix_vec_t
*NONNULL prefixes
, const char *NONNULL file
, int line
);
346 #define cti_prefix_vec_release(prefixes) cti_prefix_vec_release(prefixes, __FILE__, __LINE__)
351 * Creates a prefix containing the specified information. prefix and server are retained, and will be
352 * freed using free() when the prefix object is finalized. Caller must not retain or free these values, and
353 * they must be allocated on the malloc heap.
355 * enterprise_number: The enterprise number for this prefix.
357 * prefix_type: The prefix type, from the prefix data.
359 * prefix_version: The prefix version, from the prefix data.
361 * server: Server information for this prefix, stored in network byte order. Format depends on prefix type.
363 * server_length: Length of server information in bytes.
365 * flags: Thread network status flags, e.g. NCP versue User
367 * return value: NULL, if the call failed; otherwise a prefix object containing the specified state.
370 cti_prefix_t
*NULLABLE
371 cti_prefix_create_(struct in6_addr
*NONNULL prefix
, int prefix_length
, int metric
, int flags
,
372 const char *NONNULL file
, int line
);
373 #define cti_prefix_create(prefix, prefix_length, metric, flags) \
374 cti_prefix_create_(prefix, prefix_length, metric, flags, __FILE__, __LINE__)
377 * cti_prefix_vec_release
379 * decrements the reference count on the provided prefix vector and, if it reaches zero, finalizes the prefix vector,
380 * which calls cti_prefix_release on each prefix in the vector, potentially also finalizing them.
382 * prefixes: The prefix vector to release.
384 * return value: NULL, if the call failed; otherwise a prefix vector capable of containing the requested number of
389 cti_prefix_release_(cti_prefix_t
*NONNULL prefix
, const char *NONNULL file
, int line
);
390 #define cti_prefix_release(prefixes) cti_prefix_release(prefix, __FILE__, __LINE__)
392 /* cti_prefix_reply: Callback from cti_get_prefix_list()
394 * Called when an error occurs during processing of the cti_get_prefix_list call, or when a prefix
395 * is added or removed.
397 * In the case of an error, the callback will not be called again, and the caller is responsible for
398 * releasing the connection state and restarting if needed.
400 * The callback will be called once for each prefix present on the Thread network at the time
401 * get_prefix_list() is first called, and then again whenever a prefix is added or removed.
403 * cti_reply parameters:
405 * context: The context that was passed to the cti prefix call to which this is a callback.
407 * prefix_vec: If status is kCTIStatus_NoError, a vector containing all of the prefixes that were reported in
410 * status: Will be kCTIStatus_NoError if the prefix list request is successful, or
411 * will indicate the failure that occurred.
416 (*cti_prefix_reply_t
)(void *NULLABLE context
, cti_prefix_vec_t
*NONNULL prefixes
, cti_status_t status
);
418 /* cti_get_prefix_list
420 * Requests wpantund to immediately send the current list of off-mesh prefixes configured in the Thread
421 * network data. Whenever the prefix list is updated, the callback will be called again with the new
422 * information. A return value of kCTIStatus_NoError means that the caller can expect the reply callback to be
423 * called at least once. Any other error means that the request could not be sent, and the callback will
426 * To discontinue receiving prefix add/remove callbacks, the calling program should call
427 * cti_connection_ref_deallocate on the conn_ref returned by a successful call to get_prefix_list();
429 * ref: A pointer to a reference to the connection is stored through ref if ref is not NULL.
430 * When events are no longer needed, call cti_discontinue_events() on the returned pointer.
432 * context: An anonymous pointer that will be passed along to the callback when
435 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
437 * callback: CallBack function for the client that indicates success or failure.
439 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
440 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
441 * that the request succeeded, merely that it was successfully started.
445 DNS_SERVICES_EXPORT cti_status_t
446 cti_get_prefix_list(cti_connection_t NULLABLE
*NULLABLE ref
, void *NULLABLE context
, cti_prefix_reply_t NONNULL callback
,
447 dispatch_queue_t NONNULL client_queue
);
449 /* cti_state_reply: Callback from cti_get_state()
451 * Called when an error occurs during processing of the cti_get_state call, or when network state
452 * information is available.
454 * In the case of an error, the callback will not be called again, and the caller is responsible for
455 * releasing the connection state and restarting if needed.
457 * The callback will be called initially to report the network state, and subsequently whenever the
458 * network state changes.
460 * cti_reply parameters:
462 * context: The context that was passed to the cti state call to which this is a callback.
464 * state: The network state.
466 * status: Will be kCTIStatus_NoError if the prefix list request is successful, or
467 * will indicate the failure that occurred.
472 (*cti_state_reply_t
)(void *NULLABLE context
, cti_network_state_t state
, cti_status_t status
);
476 * Requests wpantund to immediately send the current state of the thread network. Whenever the thread
477 * network state changes, the callback will be called again with the new state. A return value of
478 * kCTIStatus_NoError means that the caller can expect the reply callback to be called at least once. Any
479 * other error means that the request could not be sent, and the callback will never be called.
481 * To discontinue receiving state change callbacks, the calling program should call
482 * cti_connection_ref_deallocate on the conn_ref returned by a successful call to cti_get_state();
484 * ref: A pointer to a reference to the connection is stored through ref if ref is not NULL.
485 * When events are no longer needed, call cti_discontinue_events() on the returned pointer.
487 * context: An anonymous pointer that will be passed along to the callback when
489 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
491 * callback: CallBack function for the client that indicates success or failure.
493 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
494 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
495 * that the request succeeded, merely that it was successfully started.
499 DNS_SERVICES_EXPORT cti_status_t
500 cti_get_state(cti_connection_t NULLABLE
*NULLABLE ref
, void *NULLABLE context
, cti_state_reply_t NONNULL callback
,
501 dispatch_queue_t NONNULL client_queue
);
503 /* cti_partition_id_reply: Callback from cti_get_partition_id()
505 * Called when an error occurs during processing of the cti_get_partition_id call, or when network partition ID
506 * information is available.
508 * In the case of an error, the callback will not be called again, and the caller is responsible for
509 * releasing the connection partition_id and restarting if needed.
511 * The callback will be called initially to report the network partition ID, and subsequently whenever the
512 * network partition ID changes.
514 * cti_reply parameters:
516 * context: The context that was passed to the cti prefix call to which this is a callback.
518 * partition_id: The network partition ID, or -1 if it is not known.
520 * status: Will be kCTIStatus_NoError if the partition ID request is successful, or will indicate the failure
526 (*cti_partition_id_reply_t
)(void *NULLABLE context
, int32_t partition_id
, cti_status_t status
);
528 /* cti_get_partition_id
530 * Requests wpantund to immediately send the current partition_id of the thread network. Whenever the thread
531 * network partition_id changes, the callback will be called again with the new partition_id. A return value of
532 * kCTIStatus_NoError means that the caller can expect the reply callback to be called at least once. Any
533 * other error means that the request could not be sent, and the callback will never be called.
535 * To discontinue receiving partition_id change callbacks, the calling program should call
536 * cti_connection_ref_deallocate on the conn_ref returned by a successful call to cti_get_partition_id();
538 * ref: A pointer to a reference to the connection is stored through ref if ref is not NULL.
539 * When events are no longer needed, call cti_discontinue_events() on the returned pointer.
541 * context: An anonymous pointer that will be passed along to the callback when
543 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
545 * callback: CallBack function for the client that indicates success or failure.
547 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
548 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
549 * that the request succeeded, merely that it was successfully started.
553 DNS_SERVICES_EXPORT cti_status_t
554 cti_get_partition_id(cti_connection_t NULLABLE
*NULLABLE ref
, void *NULLABLE context
,
555 cti_partition_id_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
);
557 /* cti_network_node_type_reply: Callback from cti_get_network_node_type()
559 * Called when an error occurs during processing of the cti_get_network_node_type call, or when network partition ID
560 * information is available.
562 * In the case of an error, the callback will not be called again, and the caller is responsible for releasing the
563 * connection network_node_type and restarting if needed.
565 * The callback will be called initially to report the network partition ID, and subsequently whenever the network
566 * partition ID changes.
568 * cti_reply parameters:
570 * context: The context that was passed to the cti prefix call to which this is a callback.
572 * network_node_type: The network node type, kCTI_NetworkNodeType_Unknown if it is not known.
574 * status: Will be kCTIStatus_NoError if the partition ID request is successful, or will indicate the failure
580 (*cti_network_node_type_reply_t
)(void *NULLABLE context
, cti_network_node_type_t network_node_type
, cti_status_t status
);
582 /* cti_get_network_node_type
584 * Requests wpantund to immediately send the current network_node_type of the thread network. Whenever the thread
585 * network network_node_type changes, the callback will be called again with the new network_node_type. A return value of
586 * kCTIStatus_NoError means that the caller can expect the reply callback to be called at least once. Any
587 * other error means that the request could not be sent, and the callback will never be called.
589 * To discontinue receiving network_node_type change callbacks, the calling program should call
590 * cti_connection_ref_deallocate on the conn_ref returned by a successful call to cti_get_network_node_type();
592 * ref: A pointer to a reference to the connection is stored through ref if ref is not NULL.
593 * When events are no longer needed, call cti_discontinue_events() on the returned pointer.
595 * context: An anonymous pointer that will be passed along to the callback when
597 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
599 * callback: CallBack function for the client that indicates success or failure.
601 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
602 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
603 * that the request succeeded, merely that it was successfully started.
607 DNS_SERVICES_EXPORT cti_status_t
608 cti_get_network_node_type(cti_connection_t NULLABLE
*NULLABLE ref
, void *NULLABLE context
,
609 cti_network_node_type_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
);
613 * Requests wpantund to add the specified service to the thread network data. A return value of
614 * kCTIStatus_NoError means that the caller can expect the reply callback to be called with a success or fail
615 * status exactly one time. Any other error means that the request could not be sent, and the callback will
618 * context: An anonymous pointer that will be passed along to the callback when
621 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
623 * callback: CallBack function for the client that indicates success or failure.
625 * enterprise_number: Contains the enterprise number of the service.
627 * service_data: Typically four bytes, in network byte order, the first two bytes indicate
628 * the type of service within the enterprise' number space, and the second
629 * two bytes indicate the version number.
631 * service_data_len: The length of the service data in bytes.
633 * server_data: Typically four bytes, in network byte order, the first two bytes indicate
634 * the type of service within the enterprise' number space, and the second
635 * two bytes indicate the version number.
637 * server_data_len: The length of the service data in bytes.
639 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
640 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
641 * that the request succeeded, merely that it was successfully started.
645 DNS_SERVICES_EXPORT cti_status_t
646 cti_add_service(void *NULLABLE context
, cti_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
,
647 uint32_t enterprise_number
, const uint8_t *NONNULL service_data
, size_t service_data_length
,
648 const uint8_t *NONNULL server_data
, size_t server_data_length
);
650 /* cti_remove_service
652 * Requests wpantund to remove the specified service from the thread network data. A return value of
653 * kCTIStatus_NoError means that the caller can expect the reply callback to be called with a success or fail
654 * status exactly one time. Any other error means that the request could not be sent, and the callback will
657 * context: An anonymous pointer that will be passed along to the callback when
660 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
662 * enterprise_number: Contains the enterprise number of the service.
664 * service_data: Typically four bytes, in network byte order, the first two bytes indicate
665 * the type of service within the enterprise' number space, and the second
666 * two bytes indicate the version number.
668 * service_data_len: The length of the service data in bytes.
670 * callback: callback function for the client that indicates success or failure.
672 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
673 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
674 * that the request succeeded, merely that it was successfully started.
677 DNS_SERVICES_EXPORT cti_status_t
678 cti_remove_service(void *NULLABLE context
, cti_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
,
679 uint32_t enterprise_number
, const uint8_t *NONNULL service_data
,
680 size_t service_data_length
);
684 * Requests wpantund to add the specified prefix to the set of off-mesh prefixes configured on the thread
685 * network. A return value of kCTIStatus_NoError means that the caller can expect the reply callback to be
686 * called with a success or fail status exactly one time. Any other error means that the request could not
687 * be sent, and the callback will never be called.
689 * context: An anonymous pointer that will be passed along to the callback when
691 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
693 * prefix: A pointer to a struct in6_addr. Must not be reatained by the callback.
695 * prefix_len: The length of the prefix in bits.
697 * callback: CallBack function for the client that indicates success or failure.
699 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
700 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
701 * that the request succeeded, merely that it was successfully started.
705 DNS_SERVICES_EXPORT cti_status_t
706 cti_add_prefix(void *NULLABLE context
, cti_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
,
707 struct in6_addr
*NONNULL prefix
, int prefix_length
, bool on_mesh
, bool preferred
, bool slaac
,
712 * Requests wpantund to remove the specified prefix from the set of off-mesh prefixes configured on the thread network.
713 * A return value of kCTIStatus_NoError means that the caller can expect the reply callback to be called with a success
714 * or fail status exactly one time. Any other error means that the request could not be sent, and the callback will
717 * context: An anonymous pointer that will be passed along to the callback when
720 * client_queue: Queue the client wants to schedule the callback on (Note: Must not be NULL)
722 * prefix: A pointer to a struct in6_addr. Must not be reatained by the callback.
724 * prefix_len: The length of the prefix in bits.
726 * callback: CallBack function for the client that indicates success or failure.
728 * return value: Returns kCTIStatus_NoError when no error otherwise returns an error code indicating
729 * the error that occurred. Note: A return value of kCTIStatus_NoError does not mean
730 * that the request succeeded, merely that it was successfully started.
734 DNS_SERVICES_EXPORT cti_status_t
735 cti_remove_prefix(void *NULLABLE context
, cti_reply_t NONNULL callback
, dispatch_queue_t NONNULL client_queue
,
736 struct in6_addr
*NONNULL prefix
, int prefix_length
);
738 /* cti_events_discontinue
740 * Requests that the CTI library stop delivering events on the specified connection. The connection will have
741 * been returned by a CTI library call that subscribes to events.
743 DNS_SERVICES_EXPORT cti_status_t
744 cti_events_discontinue(cti_connection_t NONNULL ref
);
746 #endif /* CTI_SERVICES_H */
751 // c-file-style: "bsd"
754 // indent-tabs-mode: nil