@comment The start of a comment is indicated by the following comment. This @comment syntax is used by the script funcstxh.sh: @comment function @comment function dn_comp @node dn_comp, resolver @findex dn_comp @c This file was originally a Linux man page - see the copyright below. It @c was modified for use in libsocket by Richard Dawe . @c Copyright 1993 David Metcalfe (david@prism.demon.co.uk) @c @c Permission is granted to make and distribute verbatim copies of this @c manual provided the copyright notice and this permission notice are @c preserved on all copies. @c @c Permission is granted to copy and distribute modified versions of this @c manual under the conditions for verbatim copying, provided that the @c entire resulting derived work is distributed under the terms of a @c permission notice identical to this one @c @c Since the Linux kernel and libraries are constantly changing, this @c manual page may be incorrect or out-of-date. The author(s) assume no @c responsibility for errors or omissions, or for damages resulting from @c the use of the information contained herein. The author(s) may not @c have taken the same level of care in the production of this manual, @c which is licensed free of charge, as they might when working @c professionally. @c @c Formatted or processed versions of this manual, if unaccompanied by @c the source, must acknowledge the copyright and authors of this work. @c @c References consulted: @c Linux libc source code @c Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) @c 386BSD man pages @c Modified Sun Jul 25 11:01:53 1993 by Rik Faith (faith@cs.unc.edu) @subheading Syntax @example #include int dn_comp (unsigned char *exp_dn, unsigned char *comp_dn, int length, unsigned char **dnptrs, unsigned char *exp_dn, unsigned char **lastdnptr); @end example @subheading Description The @code{dn_comp()} function compresses the domain name @var{exp_dn} and stores it in the buffer @var{comp_dn} of length @code{length}. The compression uses an array of pointers @code{dnptrs} to previously compressed names in the current message. The first pointer points to the beginning of the message and the list ends with NULL. The limit of the array is specified by @var{lastdnptr}. If @var{dnptr} is NULL, domain names are not compressed. If @var{lastdnptr} is NULL, the list of labels is not updated. @xref{dn_expand}. @subheading Return Value The @code{dn_comp()} function returns the length of the compressed name, or -1 if an error occurs. @subheading Portability This function is not portable. It is taken from Linux's libc 5 and so may be portable to Linux. @subheading Example @example @end example