* Tests if one result record is "greater" that the other. Non-NAPTR records * greater that NAPTR record. An invalid NAPTR record is greater than a * valid one. Valid NAPTR records are compared based on their * (order,preference). */
| 471 | * (order,preference). |
| 472 | */ |
| 473 | static inline int naptr_greater(struct rdata* a, struct rdata* b) |
| 474 | { |
| 475 | struct naptr_rdata *na, *nb; |
| 476 | |
| 477 | if (a->type != T_NAPTR) return 1; |
| 478 | if (b->type != T_NAPTR) return 0; |
| 479 | |
| 480 | na = (struct naptr_rdata*)a->rdata; |
| 481 | if (na == 0) return 1; |
| 482 | |
| 483 | nb = (struct naptr_rdata*)b->rdata; |
| 484 | if (nb == 0) return 0; |
| 485 | |
| 486 | return (((na->order) << 16) + na->pref) > |
| 487 | (((nb->order) << 16) + nb->pref); |
| 488 | } |
| 489 | |
| 490 | |
| 491 | /* |