Commit Graph

63 Commits

Author SHA1 Message Date
Lennart Poettering 0a49b6b6dc dns-domain: add code for verifying validity of DNS-SD service names and types 2015-11-23 21:31:28 +01:00
Beniamino Galvani 54adabf727 dns-domain: add dns_name_to_wire_format()
The function converts a domain name string to the wire format
described in RFC 1035 Section 3.1.
2015-11-17 15:06:01 +01:00
Lennart Poettering b5efdb8af4 util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
Lennart Poettering e4e73a6325 util-lib: split out hex/dec/oct encoding/decoding into its own file 2015-10-27 13:25:55 +01:00
Lennart Poettering 6bedfcbb29 util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] 2015-10-27 13:25:55 +01:00
Lennart Poettering 07630cea1f util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.

This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.

Also touches a few unrelated include files.
2015-10-24 23:05:02 +02:00
Tom Gundersen 1e2527a6fe hashmap: hash_funcs - make inputs unambiguous
Make sure all variable-length inputs are properly terminated or that
their length is encoded in some way. This avoids ambiguity of
adjacent inputs.

E.g., in case of a hash function taking two strings, compressing "ab"
followed by "c" is now distinct from "a" followed by "bc".
2015-10-05 19:21:02 +02:00
Tom Gundersen b826ab586c hashmap: refactor hash_func
All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.

This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result.
2015-10-05 18:22:10 +02:00
Lennart Poettering 9ca45586e6 dns-domain: add call for concatenating two domain names
This is specifically useful for appending the mDNS ".local" suffix to a
single-label hostname in the most correct way. (used in later commit)
2015-08-21 12:41:07 +02:00
Tom Gundersen ae72b22c40 shared: dns-name - add dns_name_between()
Given three DNS names this function indicates if the second argument lies
strictly between the first and the third according to the canonical DNS
name order. Note that the order is circular, so the last name is
considered to be before the first.
2015-07-28 00:07:32 +02:00
Tom Gundersen 5dfd7011ba shared: dns-name - use the canonical dns name ordering
The canonical DNS name ordering considers the rightmost label the most significant,
we were considering it the least significant. This is important when implementing
NSEC, which relies on the correct order.
2015-07-28 00:07:32 +02:00
Tom Gundersen 642900d3fa shared: dns-name - introduce dns_label_unescape_suffix()
Intended to be called repeatedly, and returns then successive unescaped labels
from the most to the least significant (left to right).

This is slightly inefficient as it scans the string three times (two would be
sufficient): once to find the end of the string, once to find the beginning
of each label and lastly once to do the actual unescaping. The latter two
could be done in one go, but that seemed unnecessarily convoluted.
2015-07-28 00:07:31 +02:00
Nick Owens 4ad7f2761d resolve: move dns routines into shared 2015-06-10 11:15:45 -07:00
Renamed from src/resolve/resolved-dns-domain.c (Browse further)