Debian Codegraph @

crt/aws-c-io/tests/mock_dns_resolver.h

raw symbols SCIP
1 #ifndef AWS_MOCK_DNS_RESOLVER_H
2 #define AWS_MOCK_DNS_RESOLVER_H
3 /**
4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: Apache-2.0.
6 */
7 #include <aws/common/array_list.h>
8 #include <aws/io/io.h>
9
10 struct aws_string;
11
12 struct mock_dns_resolver {
13 struct aws_array_list address_list;
14 size_t index;
15 size_t max_resolves;
16 size_t resolve_count;
17 };
18
19 int mock_dns_resolver_init(struct mock_dns_resolver *resolver, size_t max_resolves, struct aws_allocator *allocator);
20
21 void mock_dns_resolver_clean_up(struct mock_dns_resolver *resolver);
22
23 int mock_dns_resolver_append_address_list(struct mock_dns_resolver *resolver, struct aws_array_list *addresses);
24
25 int mock_dns_resolve(
26 struct aws_allocator *allocator,
27 const struct aws_string *host_name,
28 struct aws_array_list *output_addresses,
29 void *user_data);
30
31 #endif /* AWS_MOCK_DNS_RESOLVER_H */