home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
ircd4652.zip
/
ircd-df-4.6.5-os2
/
src
/
res_skipname.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-12-28
|
540b
|
33 lines
#include <sys/types.h>
#include <stdio.h>
#include "nameser.h"
/*
* Skip over a compressed domain name. Return the size or -1.
*/
dn_skipname(comp_dn, eom)
u_char *comp_dn, *eom;
{
register u_char *cp;
register int n;
cp = comp_dn;
while (cp < eom && (n = *cp++)) {
/*
* check for indirection
*/
switch (n & INDIR_MASK) {
case 0: /* normal case, n == len */
cp += n;
continue;
default: /* illegal type */
return (-1);
case INDIR_MASK: /* indirection */
cp++;
}
break;
}
return (cp - comp_dn);
}