From 4499f8fb35edddcfb7ab666de78c78dd92da8eef Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 4 Oct 2005 22:17:40 +0000 Subject: define AVAHI_DOMAIN_NAME_MAX git-svn-id: file:///home/lennart/svn/public/avahi/trunk@699 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/domain.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'avahi-common') diff --git a/avahi-common/domain.h b/avahi-common/domain.h index 34f0681..59765ef 100644 --- a/avahi-common/domain.h +++ b/avahi-common/domain.h @@ -33,6 +33,17 @@ AVAHI_C_DECL_BEGIN #endif +/** The maximum length of a a fully escaped domain name C string. This + * is calculated like this: RFC1034 mandates maximum length of FQDNs + * is 255. The maximum label length is 63. To minimize the number of + * (non-escaped) dots, we comprise our maximum-length domain name of + * four labels á 63 characters plus three inner dots. Escaping the + * four labels quadruples their length at maximum. An escaped domain + * name has the therefore the maximum length of 63*4*4+3=1011. A + * trailing NUL and perhaps two unnecessary dots leading and trailing + * the string brings us to 1014. */ +#define AVAHI_DOMAIN_NAME_MAX 1014 + /** Normalize a domain name into canonical form. This drops trailing * dots and removes useless backslash escapes. avahi_free() the * result! */ -- cgit