Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 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
        }