Beispiel #1
0
        private void InitApplications()
        {
            List <string> applicationsList = settingsManager.SystemApplicationFilterList;

            if (applicationsList.Count == 0)
            {
                return;
            }

            string filterType = settingsManager.SystemApplicationFilterType;

            if (filterType == SettingsManager.SYSTEM_OPTION_APPLICATION_FILTER_TYPE_NONE)
            {
                return;
            }

            if (filterType == SettingsManager.SYSTEM_OPTION_APPLICATION_FILTER_TYPE_WHITELIST)
            {
                // Only the specified applications will be inside the tunnel

                foreach (string app in applicationsList)
                {
                    EddieLogger.Debug(string.Format("Adding '{0}' to whitelisted applications. Traffic and data will be encapsuleted inside the tunnel.", app));

                    vpnServiceBuilder.AddAllowedApplication(app);
                }
            }
            else if (filterType == SettingsManager.SYSTEM_OPTION_APPLICATION_FILTER_TYPE_BLACKLIST)
            {
                // The specified applications will be outside the tunnel

                foreach (string app in applicationsList)
                {
                    EddieLogger.Debug(string.Format("Adding '{0}' to blacklisted applications. Traffic and data will be outside of the tunnel control.", app));

                    vpnServiceBuilder.AddDisallowedApplication(app);
                }
            }
            else
            {
                throw new Exception(string.Format("Unknown application's filter type '{0}'", filterType));
            }
        }
Beispiel #2
0
        private void InitApplications()
        {
            List <string> applicationsList = settingsManager.SystemApplicationFilterList;

            if (applicationsList.Count == 0)
            {
                return;
            }

            string filterType = settingsManager.SystemApplicationFilterType;

            if (filterType == SettingsManager.SYSTEM_OPTION_APPLICATION_FILTER_TYPE_NONE)
            {
                return;
            }

            if (filterType == SettingsManager.SYSTEM_OPTION_APPLICATION_FILTER_TYPE_WHITELIST)
            {
                // Only the specified applications will be inside the tunnel

                foreach (string app in applicationsList)
                {
                    LogsManager.Instance.Debug(string.Format("Application '{0}' will be added to allowed list (inside tunnel)", app));

                    m_builder.AddAllowedApplication(app);
                }
            }
            else if (filterType == SettingsManager.SYSTEM_OPTION_APPLICATION_FILTER_TYPE_BLACKLIST)
            {
                // The specified applications will be outside the tunnel

                foreach (string app in applicationsList)
                {
                    LogsManager.Instance.Debug(string.Format("Application '{0}' will be added to disallowed list (outside tunnel)", app));

                    m_builder.AddDisallowedApplication(app);
                }
            }
            else
            {
                throw new Exception(string.Format("unknown application's filter type '{0}'", filterType));
            }
        }