Ejemplo n.º 1
0
        /// <summary>
        /// Factory for DnsResourceRecord objects
        /// </summary>
        /// <param name="recordType"></param>
        /// <returns></returns>
        public static DnsResourceRecord CreateRecordObject(DnsStandard.RecordType recordType)
        {
            DnsResourceRecord record;

            switch (recordType)
            {
            default:
                record = new RawRecord();
                break;

            case DnsStandard.RecordType.ANAME:
                record = new AddressRecord();
                break;

            case DnsStandard.RecordType.NS:
                record = new NSRecord();
                break;

            case DnsStandard.RecordType.CNAME:
                record = new CNameRecord();
                break;

            case DnsStandard.RecordType.SOA:
                record = new SOARecord();
                break;

            case DnsStandard.RecordType.TXT:
                record = new TextRecord();
                break;

            case DnsStandard.RecordType.MX:
                record = new MXRecord();
                break;

            case DnsStandard.RecordType.PTR:
                record = new PtrRecord();
                break;

            case DnsStandard.RecordType.CERT:
                record = new CertRecord();
                break;

            case DnsStandard.RecordType.SRV:
                record = new SRVRecord();
                break;
            }

            return(record);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Factory for DnsResourceRecord objects
        /// </summary>
        /// <param name="recordType"></param>
        /// <returns></returns>
        public static DnsResourceRecord CreateRecordObject(DnsStandard.RecordType recordType)
        {
            DnsResourceRecord record;
            switch (recordType)
            {
                default:
                    record = new RawRecord();
                    break;

                case DnsStandard.RecordType.ANAME:
                    record = new AddressRecord();
                    break;

                case DnsStandard.RecordType.NS:
                    record = new NSRecord();
                    break;

                case DnsStandard.RecordType.CNAME:
                    record = new CNameRecord();
                    break;

                case DnsStandard.RecordType.SOA:
                    record = new SOARecord();
                    break;

                case DnsStandard.RecordType.TXT:
                    record = new TextRecord();
                    break;

                case DnsStandard.RecordType.MX:
                    record = new MXRecord();
                    break;
                
                case DnsStandard.RecordType.PTR:
                    record = new PtrRecord();
                    break;
                    
                case DnsStandard.RecordType.CERT:
                    record = new CertRecord();
                    break;
                
                case DnsStandard.RecordType.SRV:
                    record = new SRVRecord();
                    break;
            }
            
            return record;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Prints a PTR RR
 /// </summary>
 /// <param name="ptr">The RR to print</param>
 void Print(PtrRecord ptr)
 {
     this.Print(ptr.Domain);
 }