1 /* srp-proxy.h
2  *
3  * Copyright (c) 2018-2019 Apple Computer, Inc. All rights reserved.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  * Service Registration Protocol common definitions
18  */
19 
20 #ifndef __SRP_PROXY_H
21 #define __SRP_PROXY_H
22 
23 typedef struct srp_proxy_listener_state srp_proxy_listener_state_t;
24 
25 void srp_proxy_listener_cancel(srp_proxy_listener_state_t *NONNULL listener_state);
26 srp_proxy_listener_state_t *NULLABLE srp_proxy_listen(const char *NONNULL update_zone, uint16_t *NULLABLE avoid_ports,
27                                                       int num_avoid_ports, ready_callback_t NULLABLE ready);
28 bool srp_evaluate(comm_t *NONNULL comm, dns_message_t *NONNULL message, message_t *NONNULL raw_message);
29 bool srp_update_start(comm_t *NONNULL connection, dns_message_t *NONNULL parsed_message, message_t *NONNULL raw_message,
30                       dns_host_description_t *NONNULL new_host, service_instance_t *NONNULL instances,
31                       service_t *NONNULL services, dns_name_t *NONNULL update_zone,
32                       uint32_t lease_time, uint32_t key_lease_time);
33 void srp_update_free_parts(service_instance_t *NULLABLE service_instances, service_instance_t *NULLABLE added_instances,
34                            service_t *NULLABLE services, dns_host_description_t *NULLABLE host_description);
35 void srp_update_free(update_t *NONNULL update);
36 
37 
38 // Provided
39 void dns_input(comm_t *NONNULL comm, message_t *NONNULL message, void *NULLABLE context);
40 #if TARGET_OS_TV
41 #ifndef OPEN_SOURCE
42 void adv_xpc_disconnect(void);
43 #endif
44 void srp_mdns_flush(void);
45 #endif
46 #endif // __SRP_PROXY_H
47 
48 // Local Variables:
49 // mode: C
50 // tab-width: 4
51 // c-file-style: "bsd"
52 // c-basic-offset: 4
53 // fill-column: 108
54 // indent-tabs-mode: nil
55 // End:
56