resolved.h revision ec2c5e4398f9d65e5dfe61530f2556224733d1e6
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2013 Tom Gundersen <teg@jklm.no>
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "sd-event.h"
#include "sd-network.h"
#include "sd-rtnl.h"
#include "util.h"
#include "list.h"
#include "in-addr-util.h"
#include "hashmap.h"
#include "resolved-dns-query.h"
#include "resolved-dns-server.h"
#include "resolved-dns-scope.h"
#include "resolved-dns-stream.h"
struct Manager {
bool use_llmnr:1;
/* Network */
/* DNS query management */
unsigned n_dns_queries;
unsigned n_dns_streams;
/* Unicast dns */
int dns_ipv4_fd;
int dns_ipv6_fd;
/* LLMNR */
int llmnr_ipv4_udp_fd;
int llmnr_ipv6_udp_fd;
int llmnr_ipv4_tcp_fd;
int llmnr_ipv6_tcp_fd;
/* dbus */
/* The hostname we publish on LLMNR and mDNS */
char *hostname;
};
/* Manager */
int manager_parse_config_file(Manager *m);
int manager_write_resolv_conf(Manager *m);
void manager_next_dns_server(Manager *m);
int manager_send(Manager *m, int fd, int ifindex, int family, const union in_addr_union *addr, uint16_t port, DnsPacket *p);
int manager_dns_ipv4_fd(Manager *m);
int manager_dns_ipv6_fd(Manager *m);
int manager_llmnr_ipv4_udp_fd(Manager *m);
int manager_llmnr_ipv6_udp_fd(Manager *m);
int manager_llmnr_ipv4_tcp_fd(Manager *m);
int manager_llmnr_ipv6_tcp_fd(Manager *m);
int manager_next_hostname(Manager *m);
int manager_connect_bus(Manager *m);
int config_parse_dnsv(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
#define EXTRA_CMSG_SPACE 1024