Commit graph

10 commits

Author SHA1 Message Date
Lennart Poettering 58db254ade resolved: implement client-side DNAME resolution
Most servers apparently always implicitly convert DNAME to CNAME, but
some servers don't, hence implement this properly, as this is required
by edns0.
2015-11-24 00:20:39 +01:00
Lennart Poettering 0e8eedbb49 dns-domain: add calls to join/split SRV/DNS-SD service domains
This adds dns_service_join() and dns_service_split() which may be used
to concatenate a DNS-SD service name, am SRV service type string, and a
domain name into a full resolvable DNS domain name string. If the
service name is specified as NULL, only the type and domain are
appended, to implement classic, non-DNS-SD SRV lookups.

The reverse is dns_service_split() which takes the full name, and split
it into the three components again.
2015-11-23 21:31:29 +01:00
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
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 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 df6cfeeff7 shared: add convenience function for validating dns names 2015-06-10 11:15:46 -07: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.h (Browse further)