]>
Commit | Line | Data |
---|---|---|
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 | ||
22 | typedef struct DnssdService DnssdService; | |
23 | ||
24 | typedef struct Manager Manager; | |
25 | typedef struct DnsResourceRecord DnsResourceRecord; | |
26 | typedef struct DnsTxtItem DnsTxtItem; | |
27 | ||
28 | enum { | |
29 | DNS_TXT_ITEM_TEXT, | |
30 | DNS_TXT_ITEM_DATA | |
31 | }; | |
32 | ||
33 | struct 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; | |
48 | }; | |
49 | ||
50 | DnssdService *dnssd_service_free(DnssdService *service); | |
51 | ||
52 | DEFINE_TRIVIAL_CLEANUP_FUNC(DnssdService*, dnssd_service_free); | |
53 | ||
54 | int dnssd_render_instance_name(DnssdService *s, char **ret_name); | |
55 | int dnssd_load(Manager *manager); | |
56 | int dnssd_txt_item_new_from_string(const char *key, const char *value, DnsTxtItem **ret_item); | |
57 | int dnssd_txt_item_new_from_data(const char *key, const void *value, const size_t size, DnsTxtItem **ret_item); | |
6db6a464 | 58 | int dnssd_update_rrs(DnssdService *s); |