Commit Graph

7 Commits

Author SHA1 Message Date
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Sergey Bugaev
e9387e43db LookupServer: Store DNSName's in HashMap's directly
DNSName can now take care of case conversion when comparing using traits.
It still intentionally doesn't implement operator ==; you have to explicitly
decide whether you want case-sensitive or case-insensitive comparison.

This change makes caches (and /etc/hosts) case-transparent: we will now match
domains if they're the same except for the case.
2021-02-15 09:14:42 +01:00
Sergey Bugaev
bacbde31f3 LookupServer: Move case randomization into DNSName
* DNSName knows how to randomize itself
* DNSPacket no longer constructs DNSQuestion instances, it receives an already
  built DNSQuestion and just adds it to the list
* LookupServer::lookup() explicitly calls randomize_case() if it needs to
  randomize the case.
2021-02-15 09:14:42 +01:00
Sergey Bugaev
80f7489df0 LookupServer: Fix serializing name data in DNS answers
When serializing a RR of type PTR, we should use the DNS name serialization
format, not a raw string.
2021-02-15 09:14:42 +01:00
Sergey Bugaev
d6f7ced4f1 LookupServer: Move DNS name serialization to DNSName class 2021-02-15 09:14:42 +01:00
Sergey Bugaev
42bc5f2cc1 LookupServer: Move parse_dns_name() -> DNSName::parse()
While at it, refactor it slightly.
2021-02-15 09:14:42 +01:00
Sergey Bugaev
ae1e82fd2f LookupServer: Introduce DNSName
This is a wrapper around a string representing a domain name (such as
"example.com"). It never has a trailing dot.

For now, this class doesn't do much except wrap the raw string. Subsequent
commits will add or move more functionality to it.
2021-02-15 09:14:42 +01:00