summaryrefslogtreecommitdiff
path: root/src/shared/dns-domain.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-12-18 14:16:03 +0100
committerLennart Poettering <lennart@poettering.net>2015-12-18 14:48:49 +0100
commitf7455baa01805f2f0904de8cfe51362dc220be49 (patch)
tree79536f8939924f42befc56c1f04626b1d648b520 /src/shared/dns-domain.h
parent47260caf023c93840b9dbc58305bcc2e2992f79b (diff)
shared: add dns_name_parent() call to determine parent domain of a domain
Diffstat (limited to 'src/shared/dns-domain.h')
-rw-r--r--src/shared/dns-domain.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/dns-domain.h b/src/shared/dns-domain.h
index 3f8f621802..02b51832b6 100644
--- a/src/shared/dns-domain.h
+++ b/src/shared/dns-domain.h
@@ -47,6 +47,10 @@ int dns_label_unescape_suffix(const char *name, const char **label_end, char *de
int dns_label_escape(const char *p, size_t l, char *dest, size_t sz);
int dns_label_escape_new(const char *p, size_t l, char **ret);
+static inline int dns_name_parent(const char **name) {
+ return dns_label_unescape(name, NULL, DNS_LABEL_MAX);
+}
+
int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max);
int dns_label_undo_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max);