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

void ldns_rr2canonical ( ldns_rr rr  ) 

converts each dname in a rr to its canonical form.

Parameters:
[in] rr the rr to work on
Returns:
void

Definition at line 1485 of file rr.c.

References ldns_rr2canonical(), ldns_rr_get_type(), ldns_rr_owner(), ldns_rr_rd_count(), ldns_rr_rdf(), LDNS_RR_TYPE_A6, LDNS_RR_TYPE_AFSDB, LDNS_RR_TYPE_CNAME, LDNS_RR_TYPE_DNAME, LDNS_RR_TYPE_HINFO, LDNS_RR_TYPE_KX, LDNS_RR_TYPE_MB, LDNS_RR_TYPE_MD, LDNS_RR_TYPE_MF, LDNS_RR_TYPE_MG, LDNS_RR_TYPE_MINFO, LDNS_RR_TYPE_MR, LDNS_RR_TYPE_MX, LDNS_RR_TYPE_NAPTR, LDNS_RR_TYPE_NS, LDNS_RR_TYPE_NXT, LDNS_RR_TYPE_PTR, LDNS_RR_TYPE_PX, LDNS_RR_TYPE_RP, LDNS_RR_TYPE_RT, LDNS_RR_TYPE_SIG, LDNS_RR_TYPE_SOA, and LDNS_RR_TYPE_SRV.

Referenced by ldns_rr2canonical(), and ldns_rr_list2canonical().

{
      uint16_t i;
      
      if (!rr) {
        return;
        }

        ldns_dname2canonical(ldns_rr_owner(rr));

      /*
       * lowercase the rdata dnames if the rr type is one
       * of the list in chapter 7 of RFC3597
       */
      switch(ldns_rr_get_type(rr)) {
            case LDNS_RR_TYPE_NS:
            case LDNS_RR_TYPE_MD:
            case LDNS_RR_TYPE_MF:
            case LDNS_RR_TYPE_CNAME:
            case LDNS_RR_TYPE_SOA:
            case LDNS_RR_TYPE_MB:
            case LDNS_RR_TYPE_MG:
            case LDNS_RR_TYPE_MR:
            case LDNS_RR_TYPE_PTR:
            case LDNS_RR_TYPE_HINFO:
            case LDNS_RR_TYPE_MINFO:
            case LDNS_RR_TYPE_MX:
            case LDNS_RR_TYPE_RP:
            case LDNS_RR_TYPE_AFSDB:
            case LDNS_RR_TYPE_RT:
            case LDNS_RR_TYPE_SIG:
            case LDNS_RR_TYPE_PX:
            case LDNS_RR_TYPE_NXT:
            case LDNS_RR_TYPE_NAPTR:
            case LDNS_RR_TYPE_KX:
            case LDNS_RR_TYPE_SRV:
            case LDNS_RR_TYPE_DNAME:
            case LDNS_RR_TYPE_A6:
                  for (i = 0; i < ldns_rr_rd_count(rr); i++) {
                        ldns_dname2canonical(ldns_rr_rdf(rr, i));
                  }
                  return;
            default:
                  /* do nothing */
                  return;
      }
}


Generated by  Doxygen 1.6.0   Back to index