summaryrefslogtreecommitdiffstats
path: root/avahi-common
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-04 22:17:40 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-04 22:17:40 +0000
commit4499f8fb35edddcfb7ab666de78c78dd92da8eef (patch)
treeadbca2944c64c35b7f39b80d4b19f071980d1968 /avahi-common
parentc26e445b409215cd2fa380c8ba8e6c8f6115aec5 (diff)
define AVAHI_DOMAIN_NAME_MAX
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@699 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common')
-rw-r--r--avahi-common/domain.h11
1 files changed, 11 insertions, 0 deletions
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! */