diff options
author | Tom Gundersen <teg@jklm.no> | 2015-07-20 16:01:03 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-07-28 00:07:31 +0200 |
commit | 642900d3fa479c01d29ebe8268746d06d1c63703 (patch) | |
tree | 2f112bf1234f9cd05b24b652cbb181c721cb07d5 /src/shared/dns-domain.h | |
parent | 37d54b938faeefd0a5a74f9197a33d78bbb8d6bf (diff) |
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.
Diffstat (limited to 'src/shared/dns-domain.h')
-rw-r--r-- | src/shared/dns-domain.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/dns-domain.h b/src/shared/dns-domain.h index 00caf5d700..5728ce34bb 100644 --- a/src/shared/dns-domain.h +++ b/src/shared/dns-domain.h @@ -29,6 +29,7 @@ #define DNS_NAME_MAX 255 int dns_label_unescape(const char **name, char *dest, size_t sz); +int dns_label_unescape_suffix(const char *name, const char **label_end, char *dest, size_t sz); int dns_label_escape(const char *p, size_t l, char **ret); int dns_label_apply_idna(const char *encoded, size_t encoded_size, char *decoded, size_t decoded_max); |