1 1.1 christos /* advertising_proxy_services.h 2 1.1 christos * 3 1.1 christos * Copyright (c) 2020-2024 Apple Inc. All rights reserved. 4 1.1 christos * 5 1.1 christos * Licensed under the Apache License, Version 2.0 (the "License"); 6 1.1 christos * you may not use this file except in compliance with the License. 7 1.1 christos * You may obtain a copy of the License at 8 1.1 christos * 9 1.1 christos * https://www.apache.org/licenses/LICENSE-2.0 10 1.1 christos * 11 1.1 christos * Unless required by applicable law or agreed to in writing, software 12 1.1 christos * distributed under the License is distributed on an "AS IS" BASIS, 13 1.1 christos * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 1.1 christos * See the License for the specific language governing permissions and 15 1.1 christos * limitations under the License. 16 1.1 christos * 17 1.1 christos * This file contains definitions for the SRP Advertising Proxy management 18 1.1 christos * API on MacOS, which is private API used to control and manage the advertising 19 1.1 christos * proxy. 20 1.1 christos */ 21 1.1 christos 22 1.1 christos #ifndef DNSSD_PROXY_SERVICES_H 23 1.1 christos #define DNSSD_PROXY_SERVICES_H 24 1.1 christos 25 1.1 christos #if !defined(__BEGIN_DECLS) 26 1.1 christos #if defined(__cplusplus) 27 1.1 christos #define __BEGIN_DECLS extern "C" { 28 1.1 christos #define __END_DECLS } 29 1.1 christos #else 30 1.1 christos #define __BEGIN_DECLS 31 1.1 christos #define __END_DECLS 32 1.1 christos #endif 33 1.1 christos #endif 34 1.1 christos 35 1.1 christos __BEGIN_DECLS 36 1.1 christos typedef void *run_context_t; 37 1.1 christos typedef struct _cti_connection_t *advertising_proxy_conn_ref; 38 1.1 christos #define ADV_CTL_SERVER_SOCKET_NAME "/var/run/adv-ctl-server-socket" 39 1.1 christos #define RCHAR char 40 1.1 christos #define RUCHAR uint8_t 41 1.1 christos 42 1.1 christos typedef struct advertising_proxy_subscription advertising_proxy_subscription_t; 43 1.1 christos 44 1.1 christos typedef struct advertising_proxy_host_address { 45 1.1 christos uint16_t rrtype; 46 1.1 christos RUCHAR *NULLABLE rdata; 47 1.1 christos uint16_t rdlen; 48 1.1 christos } advertising_proxy_host_address_t; 49 1.1 christos 50 1.1 christos typedef struct advertising_proxy_instance { 51 1.1 christos RCHAR *NULLABLE instance_name; 52 1.1 christos RCHAR *NULLABLE service_type; 53 1.1 christos RCHAR *NULLABLE reg_type; 54 1.1 christos uint16_t port; 55 1.1 christos RUCHAR *NULLABLE txt_data; 56 1.1 christos uint16_t txt_len; 57 1.1 christos } advertising_proxy_instance_t; 58 1.1 christos 59 1.1 christos typedef struct advertising_proxy_host { 60 1.1 christos int ref_count; 61 1.1 christos RCHAR *NULLABLE hostname; 62 1.1 christos RCHAR *NULLABLE regname; 63 1.1 christos uint16_t num_addresses; 64 1.1 christos uint32_t lease_time; 65 1.1 christos advertising_proxy_host_address_t *NULLABLE addresses; 66 1.1 christos uint16_t num_instances; 67 1.1 christos advertising_proxy_instance_t *NULLABLE instances; 68 1.1 christos bool removed; 69 1.1 christos uint64_t server_id; 70 1.1 christos } advertising_proxy_host_t; 71 1.1 christos 72 1.1 christos #if (defined(__GNUC__) && (__GNUC__ >= 4)) 73 1.1 christos #define DNS_SERVICES_EXPORT __attribute__((visibility("default"))) 74 1.1 christos #else 75 1.1 christos #define DNS_SERVICES_EXPORT 76 1.1 christos #endif 77 1.1 christos 78 1.1 christos typedef enum 79 1.1 christos { 80 1.1 christos kDNSSDAdvertisingProxyStatus_NoError = 0, 81 1.1 christos kDNSSDAdvertisingProxyStatus_UnknownErr = -65537, /* 0xFFFE FFFF */ 82 1.1 christos kDNSSDAdvertisingProxyStatus_NoMemory = -65539, /* No Memory */ 83 1.1 christos kDNSSDAdvertisingProxyStatus_BadParam = -65540, /* Client passed invalid arg */ 84 1.1 christos kDNSSDAdvertisingProxyStatus_Invalid = -65549, /* Invalid message */ 85 1.1 christos kDNSSDAdvertisingProxyStatus_DaemonNotRunning = -65563, /* Daemon not running */ 86 1.1 christos kDNSSDAdvertisingProxyStatus_Disconnected = -65569, /* Daemon disconnected */ 87 1.1 christos kDNSSDAdvertisingProxyStatus_NotPermitted = -65571 88 1.1 christos } advertising_proxy_error_type; 89 1.1 christos 90 1.1 christos // Register for notification that TLS key has changed 91 1.1 christos #define kDNSSDAdvertisingProxyTLSKeyUpdateNotification "com.apple.srp-mdns-proxy.tls-key-update" 92 1.1 christos 93 1.1 christos /********************************************************************************************* 94 1.1 christos * 95 1.1 christos * DNSSD Advertising Proxy control/management library functions 96 1.1 christos * 97 1.1 christos *********************************************************************************************/ 98 1.1 christos 99 1.1 christos /* advertising_proxy_reply: Callback from all DNSSD Advertising proxy library functions 100 1.1 christos * 101 1.1 christos * advertising_proxy_reply() parameters: 102 1.1 christos * 103 1.1 christos * conn_ref: The advertising_proxy_conn_ref initialized by the library function. 104 1.1 christos * 105 1.1 christos * errCode: Will be kDNSSDAdvertisingProxy_NoError on success, otherwise will indicate the 106 1.1 christos * failure that occurred. 107 1.1 christos * 108 1.1 christos */ 109 1.1 christos 110 1.1 christos typedef void (*advertising_proxy_reply) 111 1.1 christos ( 112 1.1 christos advertising_proxy_conn_ref NULLABLE conn_ref, 113 1.1 christos void * NULLABLE data, 114 1.1 christos advertising_proxy_error_type errCode 115 1.1 christos ); 116 1.1 christos 117 1.1 christos /* advertising_proxy_response_reply: Callback from all DNSSD Advertising proxy library functions 118 1.1 christos * 119 1.1 christos * advertising_proxy_response_reply() parameters: 120 1.1 christos * 121 1.1 christos * conn_ref: The advertising_proxy_conn_ref initialized by the library function. Call advertising_proxy_ 122 1.1 christos * 123 1.1 christos * context: context passed to advertising proxy call 124 1.1 christos * 125 1.1 christos * response: Any data returned by the advertising proxy in response to the request. 126 1.1 christos * 127 1.1 christos * errCode: Will be kDNSSDAdvertisingProxy_NoError on success, otherwise will indicate the 128 1.1 christos * failure that occurred. 129 1.1 christos * 130 1.1 christos */ 131 1.1 christos 132 1.1 christos typedef void (*advertising_proxy_response_reply) 133 1.1 christos ( 134 1.1 christos advertising_proxy_conn_ref NULLABLE conn_ref, 135 1.1 christos void * NULLABLE context; 136 1.1 christos void * NULLABLE response, 137 1.1 christos advertising_proxy_error_type errCode 138 1.1 christos ); 139 1.1 christos 140 1.1 christos 141 1.1 christos 142 1.1 christos /* advertising_proxy_flush_entries 143 1.1 christos * 144 1.1 christos * Flushes any host entries that have been registered with the advertising proxy. For testing only: 145 1.1 christos * this is never the right thing to do in production. 146 1.1 christos * 147 1.1 christos * advertising_proxy_flush_entries() Parameters: 148 1.1 christos * 149 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 150 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 151 1.1 christos * The same conn_ref can be used for more than one call. 152 1.1 christos * 153 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 154 1.1 christos * 155 1.1 christos * callback: CallBack function for the client that indicates success or failure. 156 1.1 christos * Callback is not called until either the command has failed, or has completed. 157 1.1 christos * 158 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 159 1.1 christos * error code indicating the error that occurred. Note: A return value of 160 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that DNSSD Advertising Proxy host 161 1.1 christos * table was successfully flushed. The callback may asynchronously return an 162 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 163 1.1 christos * 164 1.1 christos */ 165 1.1 christos 166 1.1 christos DNS_SERVICES_EXPORT 167 1.1 christos advertising_proxy_error_type advertising_proxy_flush_entries 168 1.1 christos ( 169 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 170 1.1 christos run_context_t NONNULL clientq, 171 1.1 christos advertising_proxy_reply NULLABLE callback 172 1.1 christos ); 173 1.1 christos 174 1.1 christos /* advertising_proxy_get_service_list 175 1.1 christos * 176 1.1 christos * Returns a list of registered services on the advertising proxy. 177 1.1 christos * 178 1.1 christos * advertising_proxy_get_service_list() Parameters: 179 1.1 christos * 180 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 181 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 182 1.1 christos * The same conn_ref can be used for more than one call. 183 1.1 christos * 184 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 185 1.1 christos * 186 1.1 christos * callback: CallBack function for the client that indicates success or failure. 187 1.1 christos * Callback is not called until either the command has failed, or has completed. 188 1.1 christos * 189 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 190 1.1 christos * error code indicating the error that occurred. Note: A return value of 191 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that DNSSD Advertising Proxy host 192 1.1 christos * table was successfully flushed. The callback may asynchronously return an 193 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 194 1.1 christos * 195 1.1 christos */ 196 1.1 christos 197 1.1 christos DNS_SERVICES_EXPORT 198 1.1 christos advertising_proxy_error_type advertising_proxy_get_service_list 199 1.1 christos ( 200 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 201 1.1 christos run_context_t NONNULL clientq, 202 1.1 christos advertising_proxy_reply NULLABLE callback 203 1.1 christos ); 204 1.1 christos 205 1.1 christos /* advertising_proxy_block_service 206 1.1 christos * 207 1.1 christos * For testing, block advertisement of SRP service on the thread network. 208 1.1 christos * 209 1.1 christos * advertising_proxy_block_service() Parameters: 210 1.1 christos * 211 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 212 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 213 1.1 christos * The same conn_ref can be used for more than one call. 214 1.1 christos * 215 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 216 1.1 christos * 217 1.1 christos * callback: CallBack function for the client that indicates success or failure. 218 1.1 christos * Callback is not called until either the command has failed, or has completed. 219 1.1 christos * 220 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 221 1.1 christos * error code indicating the error that occurred. Note: A return value of 222 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that DNSSD Advertising Proxy host 223 1.1 christos * table was successfully flushed. The callback may asynchronously return an 224 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 225 1.1 christos * 226 1.1 christos */ 227 1.1 christos 228 1.1 christos DNS_SERVICES_EXPORT 229 1.1 christos advertising_proxy_error_type advertising_proxy_block_service 230 1.1 christos ( 231 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 232 1.1 christos run_context_t NONNULL clientq, 233 1.1 christos advertising_proxy_reply NULLABLE callback 234 1.1 christos ); 235 1.1 christos 236 1.1 christos /* advertising_proxy_unblock_service 237 1.1 christos * 238 1.1 christos * For testing, unblock advertisement of SRP service on the thread network. 239 1.1 christos * 240 1.1 christos * advertising_proxy_unblock_service() Parameters: 241 1.1 christos * 242 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 243 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 244 1.1 christos * The same conn_ref can be used for more than one call. 245 1.1 christos * 246 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 247 1.1 christos * 248 1.1 christos * callback: CallBack function for the client that indicates success or failure. 249 1.1 christos * Callback is not called until either the command has failed, or has completed. 250 1.1 christos * 251 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 252 1.1 christos * error code indicating the error that occurred. Note: A return value of 253 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that DNSSD Advertising Proxy host 254 1.1 christos * table was successfully flushed. The callback may asynchronously return an 255 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 256 1.1 christos * 257 1.1 christos */ 258 1.1 christos 259 1.1 christos DNS_SERVICES_EXPORT 260 1.1 christos advertising_proxy_error_type advertising_proxy_unblock_service 261 1.1 christos ( 262 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 263 1.1 christos run_context_t NONNULL clientq, 264 1.1 christos advertising_proxy_reply NULLABLE callback 265 1.1 christos ); 266 1.1 christos 267 1.1 christos /* advertising_proxy_regenerate_ula 268 1.1 christos * 269 1.1 christos * For testing, generate a new ULA prefix 270 1.1 christos * 271 1.1 christos * advertising_proxy_regenerate_ula() Parameters: 272 1.1 christos * 273 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 274 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 275 1.1 christos * The same conn_ref can be used for more than one call. 276 1.1 christos * 277 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 278 1.1 christos * 279 1.1 christos * callback: CallBack function for the client that indicates success or failure. 280 1.1 christos * Callback is not called until either the command has failed, or has completed. 281 1.1 christos * 282 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 283 1.1 christos * error code indicating the error that occurred. Note: A return value of 284 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that DNSSD Advertising Proxy host 285 1.1 christos * table was successfully flushed. The callback may asynchronously return an 286 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 287 1.1 christos * 288 1.1 christos */ 289 1.1 christos 290 1.1 christos DNS_SERVICES_EXPORT 291 1.1 christos advertising_proxy_error_type advertising_proxy_regenerate_ula 292 1.1 christos ( 293 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 294 1.1 christos run_context_t NONNULL clientq, 295 1.1 christos advertising_proxy_reply NULLABLE callback 296 1.1 christos ); 297 1.1 christos 298 1.1 christos /* advertising_proxy_advertise_prefix 299 1.1 christos * 300 1.1 christos * For testing, advertise it's own prefix to thread network 301 1.1 christos * 302 1.1 christos * advertising_proxy_advertise_prefix() Parameters: 303 1.1 christos * 304 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 305 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 306 1.1 christos * The same conn_ref can be used for more than one call. 307 1.1 christos * 308 1.1 christos * high: If true, advertise the prefix as high priority. 309 1.1 christos * 310 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 311 1.1 christos * 312 1.1 christos * callback: Callback function for the client that indicates success or failure. 313 1.1 christos * Callback is not called until either the command has failed, or has completed. 314 1.1 christos * 315 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 316 1.1 christos * error code indicating the error that occurred. Note: A return value of 317 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the prefix advertising 318 1.1 christos * was successful. The callback may asynchronously return an 319 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 320 1.1 christos * 321 1.1 christos */ 322 1.1 christos 323 1.1 christos DNS_SERVICES_EXPORT 324 1.1 christos advertising_proxy_error_type advertising_proxy_advertise_prefix 325 1.1 christos ( 326 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 327 1.1 christos bool high, 328 1.1 christos run_context_t NONNULL clientq, 329 1.1 christos advertising_proxy_reply NULLABLE callback 330 1.1 christos ); 331 1.1 christos 332 1.1 christos /* advertising_proxy_add_prefix 333 1.1 christos * 334 1.1 christos * For testing, stop advertising service 335 1.1 christos * 336 1.1 christos * advertising_proxy_add_prefix() Parameters: 337 1.1 christos * 338 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 339 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 340 1.1 christos * The same conn_ref can be used for more than one call. 341 1.1 christos * 342 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL). 343 1.1 christos * 344 1.1 christos * callback: Callback function for the client that indicates success or failure. 345 1.1 christos * Callback is not called until either the command has failed, or has completed. 346 1.1 christos * 347 1.1 christos * prefix_buf: Prefix to be added. 348 1.1 christos * 349 1.1 christos * buf_len: Length of the prefixbuf. 350 1.1 christos * 351 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 352 1.1 christos * error code indicating the error that occurred. Note: A return value of 353 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the service advertising 354 1.1 christos * was stopped successfully. The callback may asynchronously return an 355 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning). 356 1.1 christos * 357 1.1 christos */ 358 1.1 christos 359 1.1 christos DNS_SERVICES_EXPORT 360 1.1 christos advertising_proxy_error_type advertising_proxy_add_prefix 361 1.1 christos ( 362 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 363 1.1 christos run_context_t NONNULL clientq, 364 1.1 christos advertising_proxy_reply NULLABLE callback, 365 1.1 christos const uint8_t *NONNULL prefix_buf, 366 1.1 christos size_t buf_len 367 1.1 christos ); 368 1.1 christos 369 1.1 christos /* advertising_proxy_remove_prefix 370 1.1 christos * 371 1.1 christos * For testing, stop advertising service 372 1.1 christos * 373 1.1 christos * advertising_proxy_remove_prefix() Parameters: 374 1.1 christos * 375 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 376 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 377 1.1 christos * The same conn_ref can be used for more than one call. 378 1.1 christos * 379 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL). 380 1.1 christos * 381 1.1 christos * callback: Callback function for the client that indicates success or failure. 382 1.1 christos * Callback is not called until either the command has failed, or has completed. 383 1.1 christos * 384 1.1 christos * prefix_buf: Prefix to be added. 385 1.1 christos * 386 1.1 christos * buf_len: Length of the prefixbuf. 387 1.1 christos * 388 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 389 1.1 christos * error code indicating the error that occurred. Note: A return value of 390 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the service advertising 391 1.1 christos * was stopped successfully. The callback may asynchronously return an 392 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning). 393 1.1 christos * 394 1.1 christos */ 395 1.1 christos 396 1.1 christos /* advertising_proxy_add_nat64_prefix 397 1.1 christos * 398 1.1 christos * For testing, add nat64 prefix 399 1.1 christos * 400 1.1 christos * advertising_proxy_add_nat64_prefix() Parameters: 401 1.1 christos * 402 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 403 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 404 1.1 christos * The same conn_ref can be used for more than one call. 405 1.1 christos * 406 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL). 407 1.1 christos * 408 1.1 christos * callback: Callback function for the client that indicates success or failure. 409 1.1 christos * Callback is not called until either the command has failed, or has completed. 410 1.1 christos * 411 1.1 christos * prefix_buf: Prefix to be added. 412 1.1 christos * 413 1.1 christos * buf_len: Length of the prefixbuf. 414 1.1 christos * 415 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 416 1.1 christos * error code indicating the error that occurred. Note: A return value of 417 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the service advertising 418 1.1 christos * was stopped successfully. The callback may asynchronously return an 419 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning). 420 1.1 christos * 421 1.1 christos */ 422 1.1 christos 423 1.1 christos DNS_SERVICES_EXPORT 424 1.1 christos advertising_proxy_error_type advertising_proxy_add_nat64_prefix 425 1.1 christos ( 426 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 427 1.1 christos run_context_t NONNULL clientq, 428 1.1 christos advertising_proxy_reply NULLABLE callback, 429 1.1 christos const uint8_t *NONNULL prefix_buf, 430 1.1 christos size_t buf_len 431 1.1 christos ); 432 1.1 christos 433 1.1 christos /* advertising_proxy_remove_nat64_prefix 434 1.1 christos * 435 1.1 christos * For testing, remove nat64 prefix 436 1.1 christos * 437 1.1 christos * advertising_proxy_remove_nat64_prefix() Parameters: 438 1.1 christos * 439 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 440 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 441 1.1 christos * The same conn_ref can be used for more than one call. 442 1.1 christos * 443 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL). 444 1.1 christos * 445 1.1 christos * callback: Callback function for the client that indicates success or failure. 446 1.1 christos * Callback is not called until either the command has failed, or has completed. 447 1.1 christos * 448 1.1 christos * prefix_buf: Prefix to be removed. 449 1.1 christos * 450 1.1 christos * buf_len: Length of the prefixbuf. 451 1.1 christos * 452 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 453 1.1 christos * error code indicating the error that occurred. Note: A return value of 454 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the service advertising 455 1.1 christos * was stopped successfully. The callback may asynchronously return an 456 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning). 457 1.1 christos * 458 1.1 christos */ 459 1.1 christos DNS_SERVICES_EXPORT 460 1.1 christos advertising_proxy_error_type advertising_proxy_remove_nat64_prefix 461 1.1 christos ( 462 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 463 1.1 christos run_context_t NONNULL clientq, 464 1.1 christos advertising_proxy_reply NULLABLE callback, 465 1.1 christos const uint8_t *NONNULL prefix_buf, 466 1.1 christos size_t buf_len 467 1.1 christos ); 468 1.1 christos 469 1.1 christos DNS_SERVICES_EXPORT 470 1.1 christos advertising_proxy_error_type advertising_proxy_remove_prefix 471 1.1 christos ( 472 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 473 1.1 christos run_context_t NONNULL clientq, 474 1.1 christos advertising_proxy_reply NULLABLE callback, 475 1.1 christos const uint8_t *NONNULL prefix_buf, 476 1.1 christos size_t buf_len 477 1.1 christos ); 478 1.1 christos 479 1.1 christos /* advertising_proxy_stop 480 1.1 christos * 481 1.1 christos * For testing, stop advertising service 482 1.1 christos * 483 1.1 christos * advertising_proxy_stop() Parameters: 484 1.1 christos * 485 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 486 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 487 1.1 christos * The same conn_ref can be used for more than one call. 488 1.1 christos * 489 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL). 490 1.1 christos * 491 1.1 christos * callback: Callback function for the client that indicates success or failure. 492 1.1 christos * Callback is not called until either the command has failed, or has completed. 493 1.1 christos * 494 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 495 1.1 christos * error code indicating the error that occurred. Note: A return value of 496 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the service advertising 497 1.1 christos * was stopped successfully. The callback may asynchronously return an 498 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning). 499 1.1 christos * 500 1.1 christos */ 501 1.1 christos 502 1.1 christos DNS_SERVICES_EXPORT 503 1.1 christos advertising_proxy_error_type advertising_proxy_stop 504 1.1 christos ( 505 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 506 1.1 christos run_context_t NONNULL clientq, 507 1.1 christos advertising_proxy_reply NULLABLE callback 508 1.1 christos ); 509 1.1 christos 510 1.1 christos /* advertising_proxy_get_ula 511 1.1 christos * 512 1.1 christos * For testing, advertise it's own prefix to thread network 513 1.1 christos * 514 1.1 christos * advertising_proxy_get_ula() Parameters: 515 1.1 christos * 516 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 517 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 518 1.1 christos * The same conn_ref can be used for more than one call. 519 1.1 christos * 520 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 521 1.1 christos * 522 1.1 christos * callback: Callback function for the client that indicates success or failure. 523 1.1 christos * Callback is not called until either the command has failed, or has completed. 524 1.1 christos * The response object in the callback is a pointer to a uint64_t containing the 525 1.1 christos * prefix in host byte order. 526 1.1 christos * 527 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 528 1.1 christos * error code indicating the error that occurred. Note: A return value of 529 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the prefix advertising 530 1.1 christos * was successful. The callback may asynchronously return an 531 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 532 1.1 christos * 533 1.1 christos */ 534 1.1 christos 535 1.1 christos DNS_SERVICES_EXPORT 536 1.1 christos advertising_proxy_error_type advertising_proxy_get_ula 537 1.1 christos ( 538 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 539 1.1 christos run_context_t NONNULL clientq, 540 1.1 christos advertising_proxy_reply NULLABLE callback 541 1.1 christos ); 542 1.1 christos 543 1.1 christos /* advertising_proxy_disable_srp_replication 544 1.1 christos * 545 1.1 christos * For testing, disable SRP replication. 546 1.1 christos * 547 1.1 christos * advertising_proxy_disable_srp_replication() Parameters: 548 1.1 christos * 549 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 550 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 551 1.1 christos * The same conn_ref can be used for more than one call. 552 1.1 christos * 553 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 554 1.1 christos * 555 1.1 christos * callback: Callback function for the client that indicates success or failure. 556 1.1 christos * Callback is not called until either the command has failed, or has completed. 557 1.1 christos * 558 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 559 1.1 christos * error code indicating the error that occurred. Note: A return value of 560 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication was disabled 561 1.1 christos * successfully. The callback may asynchronously return an 562 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 563 1.1 christos * 564 1.1 christos */ 565 1.1 christos 566 1.1 christos DNS_SERVICES_EXPORT 567 1.1 christos advertising_proxy_error_type advertising_proxy_disable_srp_replication 568 1.1 christos ( 569 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 570 1.1 christos run_context_t NONNULL clientq, 571 1.1 christos advertising_proxy_reply NULLABLE callback 572 1.1 christos ); 573 1.1 christos 574 1.1 christos /* advertising_proxy_undrop_srpl_advertisement 575 1.1 christos * 576 1.1 christos * For testing, undrop_srpl_advertisement 577 1.1 christos * 578 1.1 christos * advertising_proxy_undrop_srpl_advertisement() Parameters: 579 1.1 christos * 580 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 581 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 582 1.1 christos * The same conn_ref can be used for more than one call. 583 1.1 christos * 584 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 585 1.1 christos * 586 1.1 christos * callback: Callback function for the client that indicates success or failure. 587 1.1 christos * Callback is not called until either the command has failed, or has completed. 588 1.1 christos * 589 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 590 1.1 christos * error code indicating the error that occurred. Note: A return value of 591 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication advertisements 592 1.1 christos * were successfully resumed. The callback may asynchronously return an 593 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 594 1.1 christos * 595 1.1 christos */ 596 1.1 christos 597 1.1 christos DNS_SERVICES_EXPORT 598 1.1 christos advertising_proxy_error_type advertising_proxy_undrop_srpl_advertisement 599 1.1 christos ( 600 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 601 1.1 christos run_context_t NONNULL clientq, 602 1.1 christos advertising_proxy_reply NULLABLE callback 603 1.1 christos ); 604 1.1 christos 605 1.1 christos /* advertising_proxy_undrop_srpl_connection 606 1.1 christos * 607 1.1 christos * For testing, restart all dropped srpl connections 608 1.1 christos * 609 1.1 christos * advertising_proxy_undrop_srpl_connection() Parameters: 610 1.1 christos * 611 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 612 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 613 1.1 christos * The same conn_ref can be used for more than one call. 614 1.1 christos * 615 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 616 1.1 christos * 617 1.1 christos * callback: Callback function for the client that indicates success or failure. 618 1.1 christos * Callback is not called until either the command has failed, or has completed. 619 1.1 christos * 620 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 621 1.1 christos * error code indicating the error that occurred. Note: A return value of 622 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication connections 623 1.1 christos * were successfully resumed. The callback may asynchronously return an 624 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 625 1.1 christos * 626 1.1 christos */ 627 1.1 christos 628 1.1 christos DNS_SERVICES_EXPORT 629 1.1 christos advertising_proxy_error_type advertising_proxy_undrop_srpl_connection 630 1.1 christos ( 631 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 632 1.1 christos run_context_t NONNULL clientq, 633 1.1 christos advertising_proxy_reply NULLABLE callback 634 1.1 christos ); 635 1.1 christos 636 1.1 christos /* advertising_proxy_unblock_anycast_service 637 1.1 christos * 638 1.1 christos * For testing, unblock_anycast_service 639 1.1 christos * 640 1.1 christos * advertising_proxy_unblock_anycast_service() Parameters: 641 1.1 christos * 642 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 643 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 644 1.1 christos * The same conn_ref can be used for more than one call. 645 1.1 christos * 646 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 647 1.1 christos * 648 1.1 christos * callback: Callback function for the client that indicates success or failure. 649 1.1 christos * Callback is not called until either the command has failed, or has completed. 650 1.1 christos * 651 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 652 1.1 christos * error code indicating the error that occurred. Note: A return value of 653 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that anycast service advertisements 654 1.1 christos * were successfully unblocked. The callback may asynchronously return an 655 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 656 1.1 christos * 657 1.1 christos */ 658 1.1 christos 659 1.1 christos DNS_SERVICES_EXPORT 660 1.1 christos advertising_proxy_error_type advertising_proxy_unblock_anycast_service 661 1.1 christos ( 662 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 663 1.1 christos run_context_t NONNULL clientq, 664 1.1 christos advertising_proxy_reply NULLABLE callback 665 1.1 christos ); 666 1.1 christos 667 1.1 christos /* advertising_proxy_drop_srpl_advertisement 668 1.1 christos * 669 1.1 christos * For testing, drop all srpl advertisements 670 1.1 christos * 671 1.1 christos * advertising_proxy_drop_srpl_advertisement() Parameters: 672 1.1 christos * 673 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 674 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 675 1.1 christos * The same conn_ref can be used for more than one call. 676 1.1 christos * 677 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 678 1.1 christos * 679 1.1 christos * callback: Callback function for the client that indicates success or failure. 680 1.1 christos * Callback is not called until either the command has failed, or has completed. 681 1.1 christos * 682 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 683 1.1 christos * error code indicating the error that occurred. Note: A return value of 684 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication advertisements 685 1.1 christos * were successfully discontinued. The callback may asynchronously return an 686 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 687 1.1 christos * 688 1.1 christos */ 689 1.1 christos 690 1.1 christos DNS_SERVICES_EXPORT 691 1.1 christos advertising_proxy_error_type advertising_proxy_drop_srpl_advertisement 692 1.1 christos ( 693 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 694 1.1 christos run_context_t NONNULL clientq, 695 1.1 christos advertising_proxy_reply NULLABLE callback 696 1.1 christos ); 697 1.1 christos 698 1.1 christos /* advertising_proxy_drop_srpl_connection 699 1.1 christos * 700 1.1 christos * For testing, drop all srpl connections 701 1.1 christos * 702 1.1 christos * advertising_proxy_drop_srpl_connection() Parameters: 703 1.1 christos * 704 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 705 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 706 1.1 christos * The same conn_ref can be used for more than one call. 707 1.1 christos * 708 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 709 1.1 christos * 710 1.1 christos * callback: Callback function for the client that indicates success or failure. 711 1.1 christos * Callback is not called until either the command has failed, or has completed. 712 1.1 christos * 713 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 714 1.1 christos * error code indicating the error that occurred. Note: A return value of 715 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication connections 716 1.1 christos * were successfully dropped. The callback may asynchronously return an 717 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 718 1.1 christos * 719 1.1 christos */ 720 1.1 christos 721 1.1 christos DNS_SERVICES_EXPORT 722 1.1 christos advertising_proxy_error_type advertising_proxy_drop_srpl_connection 723 1.1 christos ( 724 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 725 1.1 christos run_context_t NONNULL clientq, 726 1.1 christos advertising_proxy_reply NULLABLE callback 727 1.1 christos ); 728 1.1 christos 729 1.1 christos /* advertising_proxy_start_dropping_push_connections 730 1.1 christos * 731 1.1 christos * For testing, start dropping DNS Push connections every 90 seconds. 732 1.1 christos * 733 1.1 christos * advertising_proxy_start_dropping_push_connections() Parameters: 734 1.1 christos * 735 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 736 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 737 1.1 christos * The same conn_ref can be used for more than one call. 738 1.1 christos * 739 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 740 1.1 christos * 741 1.1 christos * callback: Callback function for the client that indicates success or failure. 742 1.1 christos * Callback is not called until either the command has failed, or has completed. 743 1.1 christos * 744 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 745 1.1 christos * error code indicating the error that occurred. Note: A return value of 746 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication connections 747 1.1 christos * were successfully dropped. The callback may asynchronously return an 748 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 749 1.1 christos * 750 1.1 christos */ 751 1.1 christos 752 1.1 christos DNS_SERVICES_EXPORT 753 1.1 christos advertising_proxy_error_type advertising_proxy_start_dropping_push_connections 754 1.1 christos ( 755 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 756 1.1 christos run_context_t NONNULL clientq, 757 1.1 christos advertising_proxy_reply NULLABLE callback 758 1.1 christos ); 759 1.1 christos 760 1.1 christos /* advertising_proxy_block_anycast service 761 1.1 christos * 762 1.1 christos * For testing, block anycast service 763 1.1 christos * 764 1.1 christos * advertising_proxy_block_anycast_service() Parameters: 765 1.1 christos * 766 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 767 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 768 1.1 christos * The same conn_ref can be used for more than one call. 769 1.1 christos * 770 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 771 1.1 christos * 772 1.1 christos * callback: Callback function for the client that indicates success or failure. 773 1.1 christos * Callback is not called until either the command has failed, or has completed. 774 1.1 christos * 775 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 776 1.1 christos * error code indicating the error that occurred. Note: A return value of 777 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that anycast service advertisements 778 1.1 christos * were successfully blocked. The callback may asynchronously return an 779 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 780 1.1 christos * 781 1.1 christos */ 782 1.1 christos 783 1.1 christos DNS_SERVICES_EXPORT 784 1.1 christos advertising_proxy_error_type advertising_proxy_block_anycast_service 785 1.1 christos ( 786 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 787 1.1 christos run_context_t NONNULL clientq, 788 1.1 christos advertising_proxy_reply NULLABLE callback 789 1.1 christos ); 790 1.1 christos 791 1.1 christos /* advertising_proxy_start_breaking_time_validation 792 1.1 christos * 793 1.1 christos * For testing, start breaking SIG(0) validation on replicated host messages. This tests that we correctly 794 1.1 christos * handle such failures in the SRP replication protocol. 795 1.1 christos * 796 1.1 christos * advertising_proxy_start_dropping_push_connections() Parameters: 797 1.1 christos * 798 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 799 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 800 1.1 christos * The same conn_ref can be used for more than one call. 801 1.1 christos * 802 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 803 1.1 christos * 804 1.1 christos * callback: Callback function for the client that indicates success or failure. 805 1.1 christos * Callback is not called until either the command has failed, or has completed. 806 1.1 christos * 807 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 808 1.1 christos * error code indicating the error that occurred. Note: A return value of 809 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that srp replication connections 810 1.1 christos * were successfully dropped. The callback may asynchronously return an 811 1.1 christos * error (such as kDNSSDAdvertisingProxy_DaemonNotRunning) 812 1.1 christos * 813 1.1 christos */ 814 1.1 christos 815 1.1 christos DNS_SERVICES_EXPORT 816 1.1 christos advertising_proxy_error_type advertising_proxy_start_breaking_time_validation 817 1.1 christos ( 818 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 819 1.1 christos run_context_t NONNULL clientq, 820 1.1 christos advertising_proxy_reply NULLABLE callback 821 1.1 christos ); 822 1.1 christos 823 1.1 christos /* advertising_proxy_start_start_thread_shutdown 824 1.1 christos * 825 1.1 christos * For testing, start breaking SIG(0) validation on replicated host messages. This tests that we correctly 826 1.1 christos * handle such failures in the SRP replication protocol. 827 1.1 christos * 828 1.1 christos * advertising_proxy_start_dropping_push_connections() Parameters: 829 1.1 christos * 830 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 831 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 832 1.1 christos * The same conn_ref can be used for more than one call. 833 1.1 christos * 834 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 835 1.1 christos * 836 1.1 christos * callback: Callback function for the client that indicates success or failure. 837 1.1 christos * Callback is not called until either the command has failed, or has completed. 838 1.1 christos * Completion in this case means that all Thread services and prefixes were 839 1.1 christos * successfully removed from the Thread network data and a network data update 840 1.1 christos * was seen with this information removed, or else two seconds passed without 841 1.1 christos * seeing the update (in which case we give up). 842 1.1 christos * 843 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 844 1.1 christos * error code indicating the error that occurred. 845 1.1 christos * 846 1.1 christos */ 847 1.1 christos 848 1.1 christos DNS_SERVICES_EXPORT 849 1.1 christos advertising_proxy_error_type advertising_proxy_start_thread_shutdown 850 1.1 christos ( 851 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 852 1.1 christos run_context_t NONNULL clientq, 853 1.1 christos advertising_proxy_reply NULLABLE callback 854 1.1 christos ); 855 1.1 christos 856 1.1 christos /* advertising_proxy_set-variable 857 1.1 christos * 858 1.1 christos * Set the specified variable to the specified value on the advertising proxy 859 1.1 christos * 860 1.1 christos * advertising_proxy_set_variable() Parameters: 861 1.1 christos * 862 1.1 christos * conn_ref: A pointer to advertising_proxy_conn_ref that is initialized to NULL. 863 1.1 christos * If the call succeeds it will be initialized to a non-NULL value. 864 1.1 christos * The same conn_ref can be used for more than one call. 865 1.1 christos * 866 1.1 christos * clientq: Queue the client wants to schedule the callback on (Note: Must not be NULL) 867 1.1 christos * 868 1.1 christos * callback: Callback function for the client that indicates success or failure. 869 1.1 christos * Callback is not called until either the command has failed, or has completed. 870 1.1 christos * 871 1.1 christos * context: Context to return in callback 872 1.1 christos * 873 1.1 christos * variable: Name of variable to set 874 1.1 christos * 875 1.1 christos * value: Value to set. Value is a string which will be interpreted by the advertising proxy, 876 1.1 christos * and can be a quoted string ("\"foo\""), "NULL", a number ("100"), or a boolean 877 1.1 christos * ("true" or "false") depending on the variable's type. 878 1.1 christos * 879 1.1 christos * return value: Returns kDNSSDAdvertisingProxy_NoError when no error otherwise returns an 880 1.1 christos * error code indicating the error that occurred. Note: A return value of 881 1.1 christos * kDNSSDAdvertisingProxy_NoError does not mean that the variable was set, just 882 1.1 christos * that the variable set command was successfully created and sent. 883 1.1 christos * 884 1.1 christos */ 885 1.1 christos 886 1.1 christos DNS_SERVICES_EXPORT 887 1.1 christos advertising_proxy_error_type advertising_proxy_set_variable 888 1.1 christos ( 889 1.1 christos advertising_proxy_conn_ref NONNULL *NULLABLE conn_ref, 890 1.1 christos run_context_t NONNULL clientq, 891 1.1 christos advertising_proxy_response_reply NULLABLE callback, 892 1.1 christos void * NULLABLE context, 893 1.1 christos const char * NONNULL name, 894 1.1 christos const char * NONNULL value 895 1.1 christos ); 896 1.1 christos 897 1.1 christos 898 1.1 christos /* advertising_proxy_ref_dealloc() 899 1.1 christos * 900 1.1 christos * Terminate a connection with the daemon and free memory associated with the advertising_proxy_conn_ref. 901 1.1 christos * When used on a advertising_proxy_conn_ref returned by advertising_proxy_enable, terminates the advertising 902 1.1 christos * proxy. When used on a call that subscribes to notifications about objects managed by the advertising proxy, 903 1.1 christos * discontinues those notifications. 904 1.1 christos * 905 1.1 christos * conn_ref: A advertising_proxy_conn_ref initialized by any of the advertising_proxy_*() calls. 906 1.1 christos * 907 1.1 christos */ 908 1.1 christos DNS_SERVICES_EXPORT void 909 1.1 christos advertising_proxy_ref_dealloc(advertising_proxy_conn_ref NONNULL conn_ref); 910 1.1 christos 911 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 912 1.1 christos advertising_proxy_resolver_init(os_log_t NULLABLE log_thingy); 913 1.1 christos 914 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 915 1.1 christos advertising_proxy_browse_create(advertising_proxy_subscription_t *NULLABLE *NONNULL aref, 916 1.1 christos run_context_t NONNULL clientq, const char *NONNULL regtype, 917 1.1 christos advertising_proxy_browse_reply NONNULL callBack, void *NULLABLE context); 918 1.1 christos 919 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 920 1.1 christos advertising_proxy_resolve_create(advertising_proxy_subscription_t *NULLABLE *NONNULL subscription_ret, 921 1.1 christos run_context_t NONNULL clientq, 922 1.1 christos const char *NONNULL name, const char *NONNULL regtype, 923 1.1 christos const char *NONNULL domain, 924 1.1 christos advertising_proxy_resolve_reply NONNULL callback, void *NULLABLE context); 925 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 926 1.1 christos advertising_proxy_registrar_create(advertising_proxy_subscription_t *NULLABLE *NONNULL subscription_ret, 927 1.1 christos run_context_t NONNULL clientq, 928 1.1 christos advertising_proxy_registrar_reply NONNULL callback, 929 1.1 christos void *NULLABLE context); 930 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 931 1.1 christos advertising_proxy_get_addresses(advertising_proxy_subscription_t *NONNULL *NULLABLE subscription_ret, run_context_t NONNULL clientq, 932 1.1 christos const char *NULLABLE name, advertising_proxy_address_reply NONNULL callback, void *NULLABLEcontext); 933 1.1 christos 934 1.1 christos #define advertising_proxy_subscription_retain(subscription) advertising_proxy_subscription_retain_(subscription, __FILE__, __LINE__) 935 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 936 1.1 christos advertising_proxy_subscription_retain_(advertising_proxy_subscription_t *NONNULL subscription, const char *NONNULL file, int line); 937 1.1 christos 938 1.1 christos #define advertising_proxy_subscription_release(subscription) advertising_proxy_subscription_release_(subscription, __FILE__, __LINE__) 939 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 940 1.1 christos advertising_proxy_subscription_release_(advertising_proxy_subscription_t *NONNULL subscription, const char *NONNULL file, int line); 941 1.1 christos 942 1.1 christos DNS_SERVICES_EXPORT advertising_proxy_error_type 943 1.1 christos advertising_proxy_subscription_cancel(advertising_proxy_subscription_t *NONNULL subscription); 944 1.1 christos __END_DECLS 945 1.1 christos #endif /* DNSSD_PROXY_SERVICES_H */ 946 1.1 christos 947 1.1 christos // Local Variables: 948 1.1 christos // mode: C 949 1.1 christos // tab-width: 4 950 1.1 christos // c-file-style: "bsd" 951 1.1 christos // c-basic-offset: 4 952 1.1 christos // fill-column: 108 953 1.1 christos // indent-tabs-mode: nil 954 1.1 christos // End: 955