]> git.meshlink.io Git - catta/blob - src/rr-util.h
rename everything avahi to catta
[catta] / src / rr-util.h
1 #ifndef foorrutilhfoo
2 #define foorrutilhfoo
3
4 /***
5   This file is part of catta.
6
7   catta is free software; you can redistribute it and/or modify it
8   under the terms of the GNU Lesser General Public License as
9   published by the Free Software Foundation; either version 2.1 of the
10   License, or (at your option) any later version.
11
12   catta is distributed in the hope that it will be useful, but WITHOUT
13   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15   Public License for more details.
16
17   You should have received a copy of the GNU Lesser General Public
18   License along with catta; if not, write to the Free Software
19   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20   USA.
21 ***/
22
23 #include <catta/rr.h>
24
25 CATTA_C_DECL_BEGIN
26
27 /** Creaze new CattaKey object based on an existing key but replaceing the type by CNAME */
28 CattaKey *catta_key_new_cname(CattaKey *key);
29
30 /** Match a key to a key pattern. The pattern has a type of
31 CATTA_DNS_CLASS_ANY, the classes are taken to be equal. Same for the
32 type. If the pattern has neither class nor type with ANY constants,
33 this function is identical to catta_key_equal(). In contrast to
34 catta_equal() this function is not commutative. */
35 int catta_key_pattern_match(const CattaKey *pattern, const CattaKey *k);
36
37 /** Check whether a key is a pattern key, i.e. the class/type has a
38  * value of CATTA_DNS_CLASS_ANY/CATTA_DNS_TYPE_ANY */
39 int catta_key_is_pattern(const CattaKey *k);
40
41 /** Returns a maximum estimate for the space that is needed to store
42  * this key in a DNS packet. */
43 size_t catta_key_get_estimate_size(CattaKey *k);
44
45 /** Returns a maximum estimate for the space that is needed to store
46  * the record in a DNS packet. */
47 size_t catta_record_get_estimate_size(CattaRecord *r);
48
49 /** Do a mDNS spec conforming lexicographical comparison of the two
50  * records. Return a negative value if a < b, a positive if a > b,
51  * zero if equal. */
52 int catta_record_lexicographical_compare(CattaRecord *a, CattaRecord *b);
53
54 /** Return 1 if the specified record is an mDNS goodbye record. i.e. TTL is zero. */
55 int catta_record_is_goodbye(CattaRecord *r);
56
57 /** Make a deep copy of an CattaRecord object */
58 CattaRecord *catta_record_copy(CattaRecord *r);
59
60 CATTA_C_DECL_END
61
62 #endif