srp-proxy.h revision 1.1 1 1.1 christos /* srp-proxy.h
2 1.1 christos *
3 1.1 christos * Copyright (c) 2018-2021 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 * Service Registration Protocol common definitions.
18 1.1 christos */
19 1.1 christos
20 1.1 christos #ifndef __SRP_PROXY_H
21 1.1 christos #define __SRP_PROXY_H
22 1.1 christos
23 1.1 christos typedef struct srp_proxy_listener_state srp_proxy_listener_state_t;
24 1.1 christos typedef struct srp_server_state srp_server_t;
25 1.1 christos typedef struct srpl_connection srpl_connection_t;
26 1.1 christos typedef struct client_update client_update_t;
27 1.1 christos
28 1.1 christos void srp_proxy_listener_cancel(srp_proxy_listener_state_t *NONNULL listener_state);
29 1.1 christos comm_t *NULLABLE srp_proxy_listen(uint16_t *NULLABLE avoid_ports, int num_avoid_ports, const char *NULLABLE interface_name,
30 1.1 christos ready_callback_t NULLABLE ready, cancel_callback_t NULLABLE cancel,
31 1.1 christos addr_t *NULLABLE address, finalize_callback_t NULLABLE context_callback, void *NONNULL context);
32 1.1 christos void srp_proxy_init(const char *NONNULL update_zone);
33 1.1 christos client_update_t *NULLABLE srp_evaluate(const char *NULLABLE remote_name,
34 1.1 christos dns_message_t *NONNULL *NULLABLE in_parsed_message,
35 1.1 christos message_t *NONNULL raw_message, int index);
36 1.1 christos bool srp_update_start(client_update_t *NONNULL client_update);
37 1.1 christos #define srp_parse_client_updates_free(messages) srp_parse_client_updates_free_(messages, __FILE__, __LINE__);
38 1.1 christos void srp_parse_client_updates_free_(client_update_t *NULLABLE messages, const char *NONNULL file, int line);
39 1.1 christos
40 1.1 christos // Provided
41 1.1 christos void dns_input(comm_t *NONNULL comm, message_t *NONNULL message, void *NULLABLE context);
42 1.1 christos void srp_mdns_flush(srp_server_t *NONNULL server_state);
43 1.1 christos bool srp_dns_evaluate(comm_t *NONNULL connection, srp_server_t *NULLABLE server_state,
44 1.1 christos message_t *NONNULL message, dns_message_t *NONNULL *NULLABLE p_parsed_message);
45 1.1 christos bool srp_parse_host_messages_evaluate(srp_server_t *NONNULL server_state, srpl_connection_t *NONNULL srpl_connection,
46 1.1 christos message_t *NONNULL *NONNULL messages, int num_messages);
47 1.1 christos #endif // __SRP_PROXY_H
48 1.1 christos
49 1.1 christos // Local Variables:
50 1.1 christos // mode: C
51 1.1 christos // tab-width: 4
52 1.1 christos // c-file-style: "bsd"
53 1.1 christos // c-basic-offset: 4
54 1.1 christos // fill-column: 108
55 1.1 christos // indent-tabs-mode: nil
56 1.1 christos // End:
57