func: int main() int msglen , ret ; u_char * dp ; u_char * name = ( u_char * ) malloc ( 100 * sizeof ( u_char ) ) ; u_char * msg = ( u_char * ) malloc ( 1000 * sizeof ( u_char ) ) ; msglen = create_msg ( msg ); int create_msg(u_char *buf) char * temp , * temp1 ; u_char * comp_dn , * comp_dn2 ; char exp_dn [ 200 ] , exp_dn2 [ 200 ] ; u_char * * dnptrs , * * lastdnptr , * * dnptrs2 ; int i , len = 0 , comp_size ; dnptrs = ( unsigned char * * ) malloc ( 2 * sizeof ( unsigned char * ) ); dnptrs2 = ( unsigned char * * ) malloc ( 2 * sizeof ( unsigned char * ) ); comp_dn = ( unsigned char * ) malloc ( 200 * sizeof ( unsigned char ) ); comp_dn2 = ( unsigned char * ) malloc ( 200 * sizeof ( unsigned char ) ); temp1 = ( char * ) malloc ( 400 * sizeof ( char ) ); temp = temp1; strcpy ( temp , "HEADER JUNK:" ); len += strlen ( temp ); strcpy ( exp_dn , "lcs.mit.edu" ); * dnptrs ++ = ( u_char * ) exp_dn; * dnptrs -- = NULL; lastdnptr = NULL; comp_size = dn_comp ( ( const char * ) exp_dn , comp_dn , 200 , dnptrs , lastdnptr ); len += comp_size; len += 10; strcpy ( exp_dn2 , "sls.lcs.mit.edu" ); * dnptrs2 ++ = ( u_char * ) exp_dn2; * dnptrs2 -- = NULL; lastdnptr = NULL; comp_size = dn_comp ( ( const char * ) exp_dn2 , comp_dn2 , 200 , dnptrs2 , lastdnptr ); len += comp_size; len += 16; return ( len ) ; dp = msg + sizeof ( HEADER ); ret = rrextract ( msg , msglen , dp , name , 100 ); static rrextract(u_char *msg, int msglen, u_char *rrp, u_char *dname, int namelen) u_char * eom , * cp , * cp1 , * rdatap ; cp = rrp; eom = msg + msglen; if ( ( n = dn_expand ( msg , eom , cp , ( char * ) dname , namelen ) ) < 0 )  cp += n; cp += 2; cp += 2; cp += 4; cp += 2; switch ( type )  n = dn_expand ( msg , eom , cp , ( char * ) data , sizeof data ); cp += n; cp1 = data + strlen ( ( char * ) data ) + 1; memcpy ( cp1 , cp , dlen - n ); cp1 += ( dlen - n ); n = cp1 - ( u_char * ) data; if ( n > MAXDATA )  printf ( "update type %d: %d bytes is too much data" , type , n ); 