Ejemplo n.º 1
0
 public DnsAgent(Options options, Rules rules, string listenOn, DnsMessageCache cache)
 {
     Options = options ?? new Options();
     Rules = rules ?? new Rules();
     _listenOn = listenOn;
     Cache = cache ?? new DnsMessageCache();
 }
Ejemplo n.º 2
0
 private static Options ReadOptions()
 {
     Options options;
     if (File.Exists(Path.Combine(Environment.CurrentDirectory, OptionsFileName)))
     {
         options = JsonConvert.DeserializeObject<Options>(
             File.ReadAllText(Path.Combine(Environment.CurrentDirectory, OptionsFileName)));
     }
     else
     {
         options = new Options();
         File.WriteAllText(Path.Combine(Environment.CurrentDirectory, OptionsFileName),
             JsonConvert.SerializeObject(options, Formatting.Indented));
     }
     return options;
 }
Ejemplo n.º 3
0
 public DnsAgent(Options options, Rules rules)
 {
     Options = options ?? new Options();
     Rules = rules ?? new Rules();
     Cache = new DnsMessageCache();
 }