Logo Search packages:      
Sourcecode: ldns version File versions  Download package

bool ldns_rr_list_contains_rr ( ldns_rr_list rr_list,
ldns_rr rr 
)

returns true if the given rr is one of the rrs in the list, or if it is equal to one

Parameters:
[in] rr_list the rr_list to check
[in] rr the rr to check
Returns:
true if rr_list contains rr, false otherwise

Definition at line 968 of file rr.c.

References ldns_rr_compare(), ldns_rr_list_contains_rr(), ldns_rr_list_rr(), and ldns_rr_list_rr_count().

Referenced by ldns_rr_list_contains_rr().

{
      size_t i;
      
      if (!rr_list || !rr || ldns_rr_list_rr_count(rr_list) == 0) {
            return false;
      }

      for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
            if (rr == ldns_rr_list_rr(rr_list, i)) {
                  return true;
            } else if (ldns_rr_compare(rr, ldns_rr_list_rr(rr_list, i)) == 0) {
                  return true;
            }
      }
      return false;
}


Generated by  Doxygen 1.6.0   Back to index