Ejemplo n.º 1
0
        public void ReadMasqConfig()
        {
            String filename = "default.conf";

            if (!File.Exists(Path.Combine(config_dir, filename)))
            {
                this.AddMasq("www.contoso.gack", "127.0.0.1", "::1");
                this.AddMasq("contoso.gack", "127.0.0.2");
                this.AddMasq("test.mod0.de", "10.42.1.23");
                this.SaveMasq(Path.Combine(config_dir, filename));
                return;
            }

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(DNSMasqConfig));
                using (StreamReader sr = new StreamReader(Path.Combine(config_dir, filename)))
                {
                    m_masq_config = (DNSMasqConfig)serializer.Deserialize(sr);
                }
            }
            catch (Exception e)
            {
                m_log.WriteLine("[e] ReadMasqConfig error: " + e.Message);
                throw;
            }
        }
Ejemplo n.º 2
0
 public UmleitungServer(UmleitungProperties up, IPAddress listen)
 {
     m_props       = up;
     m_masq_config = new DNSMasqConfig();
     m_masq_config.DNSMasqEntries = new List <DNSMasqHost>();
     m_listen_ip = listen;
     init_umleitung_server();
 }
Ejemplo n.º 3
0
        public UmleitungServer()
        {
            m_props                  = new UmleitungProperties();
            m_props.DebugLevel       = 1;
            m_props.UseCustomDns     = false;
            m_props.CustomDnsServers = new List <IPAddress>();

            m_masq_config = new DNSMasqConfig();
            m_masq_config.DNSMasqEntries = new List <DNSMasqHost>();
            m_listen_ip = IPAddress.Any;
            init_umleitung_server();
        }
Ejemplo n.º 4
0
 public void ReadMasqConfig(String filename)
 {
     try
     {
         XmlSerializer serializer = new XmlSerializer(typeof(DNSMasqConfig));
         using (StreamReader sr = new StreamReader(filename))
         {
             m_masq_config = (DNSMasqConfig)serializer.Deserialize(sr);
         }
     }
     catch (Exception e)
     {
         m_log.WriteLine("[e] ReadMasqConfig error: " + e.Message);
         throw;
     }
 }