blob: 3ad79c3a459df7b69ba3c43b8bc330ef4e3ebc2d [file] [log] [blame]
Baptiste Assmann325137d2015-04-13 23:40:55 +02001/*
2 * include/proto/dns.h
3 * This file provides functions related to DNS protocol
4 *
5 * Copyright (C) 2014 Baptiste Assmann <bedis9@gmail.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _PROTO_DNS_H
23#define _PROTO_DNS_H
24
25#include <types/dns.h>
Baptiste Assmann325137d2015-04-13 23:40:55 +020026
Christopher Faulet67957bd2017-09-27 11:00:59 +020027extern struct list dns_resolvers;
28
29struct dns_resolvers *find_resolvers_by_id(const char *id);
30struct dns_srvrq *find_srvrq_by_name(const char *name, struct proxy *px);
31struct dns_srvrq *new_dns_srvrq(struct server *srv, char *fqdn);
32
33int dns_str_to_dn_label(const char *str, int str_len, char *dn, int dn_len);
34int dns_dn_label_to_str(const char *dn, int dn_len, char *str, int str_len);
35
Baptiste Assmann325137d2015-04-13 23:40:55 +020036int dns_hostname_validation(const char *string, char **err);
Baptiste Assmannfb7091e2017-05-03 15:43:12 +020037int dns_get_ip_from_response(struct dns_response_packet *dns_p,
Baptiste Assmann42746372017-05-03 12:12:02 +020038 struct dns_options *dns_opts, void *currentip,
Thierry Fournierada34842016-02-17 21:25:09 +010039 short currentip_sin_family,
Baptiste Assmannfb7091e2017-05-03 15:43:12 +020040 void **newip, short *newip_sin_family,
41 void *owner);
Baptiste Assmann201c07f2017-05-22 15:17:15 +020042
Olivier Houchard55dcdf42017-11-06 15:15:04 +010043int dns_link_resolution(void *requester, int requester_type, int requester_locked);
Christopher Faulet67957bd2017-09-27 11:00:59 +020044void dns_unlink_resolution(struct dns_requester *requester);
45void dns_trigger_resolution(struct dns_requester *requester);
Baptiste Assmann201c07f2017-05-22 15:17:15 +020046
Baptiste Assmann325137d2015-04-13 23:40:55 +020047
48#endif // _PROTO_DNS_H