]> jfr.im git - solanum.git/blob - authd/dns.h
dns: add format_address function
[solanum.git] / authd / dns.h
1 /* authd/dns.h - header for authd DNS functions
2 * Copyright (c) 2016 William Pitcock <nenolod@dereferenced.org>
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice is present in all copies.
7 *
8 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
9 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
11 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
12 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
13 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
14 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
15 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
16 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
17 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
18 * POSSIBILITY OF SUCH DAMAGE.
19 */
20
21 #ifndef _AUTHD_DNS_H
22 #define _AUTHD_DNS_H
23
24 #define DNS_REQ_IDLEN 10
25
26 #include "res.h"
27 #include "reslib.h"
28
29 struct dns_request
30 {
31 struct DNSQuery query;
32 char reqid[DNS_REQ_IDLEN];
33 struct rb_sockaddr_storage addr;
34 char type;
35 };
36
37 extern void format_address(struct rb_sockaddr_storage *addr, char *buffer, size_t length);
38 extern void resolve_dns(int parc, char *parv[]);
39 extern void enumerate_nameservers(const char *rid, const char letter);
40 extern void reload_nameservers(const char letter);
41
42 #endif