#include #include #include #include "dns_sd_print.h" #include "dns_sd_const.h" unsigned _print_name( const char* s, const char* buf ) { unsigned n = 0; // track allocated length of the name in this record bool incrFl = true; // do not incrmement 'n' if the name switches to a ptr segment while( *s ) { if( (*s & 0xc0) == 0xc0 ) { if( incrFl ) n += 2; incrFl = false; s = buf + s[1]; } else { for(char i=0; i 0x%2x",ntohs(u[0])); break; } if( ntohs(u[1]) & 0x80 ) printf("flush "); printf("\n"); }