]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/resolve/resolved-dnssd.h
resolved: consult Polkit for privileges when manipulating DNS-SD
[thirdparty/systemd.git] / src / resolve / resolved-dnssd.h
CommitLineData
6501dd31
DR
1#pragma once
2
3/***
4 This file is part of systemd.
5
6 Copyright 2017 Dmitry Rozhkov
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
22typedef struct DnssdService DnssdService;
23
24typedef struct Manager Manager;
25typedef struct DnsResourceRecord DnsResourceRecord;
26typedef struct DnsTxtItem DnsTxtItem;
27
28enum {
29 DNS_TXT_ITEM_TEXT,
30 DNS_TXT_ITEM_DATA
31};
32
33struct DnssdService {
34 char *filename;
35 char *name;
36 char *name_template;
37 char *type;
38 uint16_t port;
39 uint16_t priority;
40 uint16_t weight;
41 DnsTxtItem *txt;
42
43 DnsResourceRecord *ptr_rr;
44 DnsResourceRecord *srv_rr;
45 DnsResourceRecord *txt_rr;
46
47 Manager *manager;
c3036641
DR
48
49 bool withdrawn:1;
84b0f133 50 uid_t originator;
6501dd31
DR
51};
52
53DnssdService *dnssd_service_free(DnssdService *service);
54
55DEFINE_TRIVIAL_CLEANUP_FUNC(DnssdService*, dnssd_service_free);
56
57int dnssd_render_instance_name(DnssdService *s, char **ret_name);
58int dnssd_load(Manager *manager);
59int dnssd_txt_item_new_from_string(const char *key, const char *value, DnsTxtItem **ret_item);
60int dnssd_txt_item_new_from_data(const char *key, const void *value, const size_t size, DnsTxtItem **ret_item);
6db6a464 61int dnssd_update_rrs(DnssdService *s);
c3036641 62void dnssd_signal_conflict(Manager *manager, const char *name);