#ifndef __DNSINFO_H__
#define __DNSINFO_H__
#include <sys/cdefs.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#define DNSINFO_VERSION 20111104
#define DEFAULT_SEARCH_ORDER 200000
#define DNS_PTR(type, name) \
union { \
type name; \
uint64_t _ ## name ## _p; \
}
#define DNS_VAR(type, name) \
type name
#pragma pack(4)
typedef struct {
struct in_addr address;
struct in_addr mask;
} dns_sortaddr_t;
#pragma pack()
#pragma pack(4)
typedef struct {
DNS_PTR(char *, domain);
DNS_VAR(int32_t, n_nameserver);
DNS_PTR(struct sockaddr **, nameserver);
DNS_VAR(uint16_t, port);
DNS_VAR(int32_t, n_search);
DNS_PTR(char **, search);
DNS_VAR(int32_t, n_sortaddr);
DNS_PTR(dns_sortaddr_t **, sortaddr);
DNS_PTR(char *, options);
DNS_VAR(uint32_t, timeout);
DNS_VAR(uint32_t, search_order);
DNS_VAR(uint32_t, if_index);
DNS_VAR(uint32_t, flags);
DNS_VAR(uint32_t, reach_flags);
DNS_VAR(uint32_t, reserved[5]);
} dns_resolver_t;
#pragma pack()
#define DNS_RESOLVER_FLAGS_SCOPED 1
#pragma pack(4)
typedef struct {
DNS_VAR(int32_t, n_resolver);
DNS_PTR(dns_resolver_t **, resolver);
DNS_VAR(int32_t, n_scoped_resolver);
DNS_PTR(dns_resolver_t **, scoped_resolver);
DNS_VAR(uint32_t, reserved[5]);
} dns_config_t;
#pragma pack()
__BEGIN_DECLS
const char *
dns_configuration_notify_key ();
dns_config_t *
dns_configuration_copy ();
void
dns_configuration_free (dns_config_t *config);
void
_dns_configuration_ack (dns_config_t *config,
const char *bundle_id);
__END_DECLS
#endif