예제 #1
0
파일: Program.cs 프로젝트: fcccode/Sentro
        private async static void CleanUpSentro()
        {
            var arp   = ArpSpoofer.GetInstance();
            var state = arp.State();

            if (state == ArpSpoofer.Status.Started ||
                state == ArpSpoofer.Status.Starting ||
                state == ArpSpoofer.Status.Paused)
            {
                await Task.Run(() => ArpSpoofer.GetInstance().Stop());
            }

            TrafficManager.GetInstance().Stop();
        }
예제 #2
0
        public static void Traffic(string command)
        {
            #region traffic command regex
            const string trafficStart = @"^traffic start$";
            const string trafficStop  = @"^traffic stop$";
            #endregion

            #region expression evaluation against command
            if (Regex.IsMatch(command, trafficStart))
            {
                TrafficManager.GetInstance().Start();
            }

            else if (Regex.IsMatch(command, trafficStop))
            {
                TrafficManager.GetInstance().Stop();
            }
            #endregion
        }