public override ILayer GetProtocolDataUnit()
        {
            var compressionMode = (DnsDomainNameCompressionMode)Enum.Parse(typeof(DnsDomainNameCompressionMode), this.SelectedCompressionMode);
            var opCode          = (DnsOpCode)Enum.Parse(typeof(DnsOpCode), this.SelectedOpCode);
            var responseCode    = (DnsResponseCode)Enum.Parse(typeof(DnsResponseCode), this.SelectedResponseCode);

            var additionals = new List <DnsDataResourceRecord>();
            var answers     = new List <DnsDataResourceRecord>();
            var authorities = new List <DnsDataResourceRecord>();

            var dnsLayer = new DnsLayer()
            {
                Additionals = additionals,
                Answers     = answers,
                Authorities = authorities,
                DomainNameCompressionMode = compressionMode,
                FutureUse             = this.FutureUse,
                Id                    = this.Id,
                IsAuthenticData       = this.IsAuthenticData,
                IsAuthoritativeAnswer = this.IsAuthenticAnswer,
                IsCheckingDisabled    = this.IsCheckingDisabled,
                IsQuery               = this.IsQuery,
                IsRecursionAvailable  = this.IsRecursionAvailable,
                IsRecursionDesired    = this.IsRecursionDesired,
                IsResponse            = this.IsResponse,
                IsTruncated           = this.IsTruncated,
                OpCode                = opCode,
                Queries               = DNSModel.GetDnsQueryRecords(this.Queries),
                ResponseCode          = responseCode
            };

            return(dnsLayer);
        }
Пример #2
0
        public ActionResult DNS()
        {
            CloudFlareAPI.Instance.WaitForFirstPoll(10000);
            var vd = new DNSModel
            {
                View        = DashboardModel.Views.DNS,
                Zones       = CloudFlareAPI.Instance.Zones.SafeData(true),
                DNSRecords  = CloudFlareAPI.Instance.DNSRecords.Data,
                DataCenters = DataCenters.All
            };

            return(View(vd));
        }
        public async Task <ActionResult> DNS()
        {
            await CloudFlareAPI.Instance.PollAsync().ConfigureAwait(false);

            var vd = new DNSModel
            {
                View        = DashboardModel.Views.DNS,
                Zones       = CloudFlareAPI.Instance.Zones.SafeData(true),
                DNSRecords  = CloudFlareAPI.Instance.DNSRecords.Data,
                DataCenters = DataCenters.All
            };

            return(View(vd));
        }
Пример #4
0
        public async Task <ActionResult> DNS()
        {
            await Module.API.PollAsync();

            var vd = new DNSModel
            {
                View        = DashboardModel.Views.DNS,
                Zones       = Module.API.Zones.SafeData(true),
                DNSRecords  = Module.API.DNSRecords.Data,
                DataCenters = Module.AllDatacenters
            };

            return(View(vd));
        }
        public DNSViewModel()
        {
            this.compressionModes        = DNSModel.GetCompressionModes();
            this.selectedCompressionMode = nameof(DnsDomainNameCompressionMode.Nothing);

            this.opCodes        = DNSModel.GetOpCodes();
            this.selectedOpCode = nameof(DnsOpCode.Query);

            this.responseCodes        = DNSModel.GetResponseCodes();
            this.selectedResponseCode = nameof(DnsResponseCode.NoError);

            this.dnsTypes   = DNSModel.GetDNSTypes();
            this.dnsClasses = DNSModel.GetDNSClasses();

            this.isQuery            = true;
            this.isRecursionDesired = true;

            this.Queries = new ObservableCollection <DNSQuery>();

            this.AddQueryCommand     = new RelayCommand <object>(this.AddQuery);
            this.ClearQueriesCommand = new RelayCommand <object>(this.ClearQueries);
        }
Пример #6
0
 public string updateDNS([FromBody] DNSModel inparam)
 {
     UpdateFile(inparam, "DNS");
     Utils.SetDnsModel();
     return("true");
 }