Commit Graph

5 Commits

Author SHA1 Message Date
Lennart Poettering ae2a15bc14 macro: introduce TAKE_PTR() macro
This macro will read a pointer of any type, return it, and set the
pointer to NULL. This is useful as an explicit concept of passing
ownership of a memory area between pointers.

This takes inspiration from Rust:

https://doc.rust-lang.org/std/option/enum.Option.html#method.take

and was suggested by Alan Jenkins (@sourcejedi).

It drops ~160 lines of code from our codebase, which makes me like it.
Also, I think it clarifies passing of ownership, and thus helps
readability a bit (at least for the initiated who know the new macro)
2018-03-22 20:21:42 +01:00
Dmitry Rozhkov 400f54fb36 resolved: support multiple TXT RRs per DNS-SD service
Section 6.8 of RFC 6763 allows having service instances with
multiple TXT resource records.
2017-12-08 14:29:27 +02:00
Dmitry Rozhkov c3036641f0 resolved: implement D-Bus API for DNS-SD 2017-12-08 14:29:27 +02:00
Dmitry Rozhkov 6db6a4642e resolved: put DNS-SD records to mDNS-enabled zones. 2017-12-08 14:29:27 +02:00
Dmitry Rozhkov 6501dd31a7 resolved: add enablers for DNS-SD
Introduce network services loaded from .dnssd files that
can be used for server-side DNS-SD implementation in systemd-resolved.
2017-12-08 14:29:27 +02:00