bind/bind-9.9.9-P3/lib/dns/masterdump.c
/*
 * Define the order in which rdatasets should be printed in zone
 * files.  We will print SOA and NS records before others, SIGs
 * immediately following the things they sign, and order everything
 * else by RR number.  This is all just for aesthetics and
 * compatibility with buggy software that expects the SOA to be first;
 * the DNS specifications allow any order.
 */
Define the order in which rdatasets should be printed in zone
files.  We will print SOA and NS records before others, SIGs
immediately following the things they sign, and order everything
else by RR number.  This is all just for aesthetics and
compatibility with buggy software that expects the SOA to be first;
the DNS specifications allow any order.
Define the order in which rdatasets should be printed in zone files . We will print SOA and NS records before others SIGs immediately following the things they sign and order everything else by RR number . This is all just for aesthetics and compatibility with buggy software that expects the SOA to be first ; the DNS specifications allow any order .
static int
dump_order(const dns_rdataset_t *rds) {
	int t;
	int sig;
	if (rds->type == dns_rdatatype_rrsig) {
		t = rds->covers;
		sig = 1;
	} else {
		t = rds->type;
		sig = 0;
	}
	switch (t) {
	case dns_rdatatype_soa:
		t = 0;
		break;
	case dns_rdatatype_ns:
		t = 1;
		break;
	default:
		t += 2;
		break;
	}
	return (t << 1) + sig;
}
static int dump_order ( const dns_rdataset_t * rds ) { int t ; int sig ; if ( rds -> type == dns_rdatatype_rrsig ) { t = rds -> covers ; sig = 1 ; } else { t = rds -> type ; sig = 0 ; } switch ( t ) { case dns_rdatatype_soa : t = 0 ; break ; case dns_rdatatype_ns : t = 1 ; break ; default : t += 2 ; break ; } return ( t << 1 ) + sig ; }
Define the order in which rdatasets should be printed in zone
 files.
Define the order in which rdatasets should be printed in zone files .