mirrored_repositories/networkarch-flutter/lib/dns_lookup
// Project imports:
import 'package:network_arch/dns_lookup/utils/rr_code_name.dart';

int nameToRrCode(RrCodeName name) {
  switch (name) {
    case RrCodeName.A:
      return 1;
    case RrCodeName.NULL:
      return 10;
    case RrCodeName.AAAA:
      return 28;
    case RrCodeName.AFSDB:
      return 18;
    case RrCodeName.APL:
      return 42;
    case RrCodeName.CAA:
      return 257;
    case RrCodeName.CDNSKEY:
      return 60;
    case RrCodeName.CDS:
      return 59;
    case RrCodeName.CERT:
      return 37;
    case RrCodeName.CNAME:
      return 5;
    case RrCodeName.DHCID:
      return 49;
    case RrCodeName.DLV:
      return 32769;
    case RrCodeName.DNAME:
      return 39;
    case RrCodeName.DNSKEY:
      return 48;
    case RrCodeName.DS:
      return 43;
    case RrCodeName.HIP:
      return 55;
    case RrCodeName.HINFO:
      return 13;
    case RrCodeName.IPSECKEY:
      return 45;
    case RrCodeName.KEY:
      return 25;
    case RrCodeName.KX:
      return 36;
    case RrCodeName.LOC:
      return 29;
    case RrCodeName.MX:
      return 15;
    case RrCodeName.NAPTR:
      return 35;
    case RrCodeName.NS:
      return 2;
    case RrCodeName.NSEC:
      return 47;
    case RrCodeName.NSEC3:
      return 50;
    case RrCodeName.NSEC3PARAM:
      return 51;
    case RrCodeName.PTR:
      return 12;
    case RrCodeName.RRSIG:
      return 46;
    case RrCodeName.RP:
      return 17;
    case RrCodeName.SIG:
      return 24;
    case RrCodeName.SOA:
      return 6;
    case RrCodeName.SPF:
      return 99;
    case RrCodeName.SRV:
      return 33;
    case RrCodeName.SSHFP:
      return 44;
    case RrCodeName.TA:
      return 32768;
    case RrCodeName.TKEY:
      return 249;
    case RrCodeName.TLSA:
      return 52;
    case RrCodeName.TSIG:
      return 250;
    case RrCodeName.TXT:
      return 16;
    case RrCodeName.AXFR:
      return 252;
    case RrCodeName.IXFR:
      return 251;
    case RrCodeName.OPT:
      return 41;
    case RrCodeName.ANY:
      return 255;
    case RrCodeName.UNKNOWN:
      return -1;
  }
}
