MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / naptr_greater

Function naptr_greater

modules/enum/enum.c:473–488  ·  view source on GitHub ↗

* 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). */

Source from the content-addressed store, hash-verified

471 * (order,preference).
472 */
473static 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/*

Callers 1

naptr_sortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected