Ejemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 private DomainFacade(IPAccountingConfig pConfig, IPlugin pPlugin)
 {
     cPlugin = pPlugin;
       cRecordList = new List<AccountingItem>();
       cObserverList = new List<IObserver>();
       cInfrastructure = InfrastructureFacade.getInstance(pConfig, pPlugin, ref cRecordList);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Create single instance
        /// </summary>
        /// <returns></returns>
        public static DomainFacade getInstance(IPAccountingConfig pConfig, IPlugin pPlugin)
        {
            if (cInstance == null)
            cInstance = new DomainFacade(pConfig, pPlugin);

              return (cInstance);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 public void onStart(IPAccountingConfig pConfig)
 {
     cInfrastructure.onStart(pConfig);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 private TaskFacade(IPAccountingConfig pConfig, IPlugin pPlugin)
 {
     cPlugin = pPlugin;
       cDomain = DomainFacade.getInstance(pConfig, pPlugin);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 public void onStart(IPAccountingConfig pConfig)
 {
     cDomain.onStart(pConfig);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 
        /// </summary>
        public PluginIPAccountingUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              /*
               * Set DGV double buffer on
               */
              Type dgvType = DGV_TrafficData.GetType();
              PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
              pi.SetValue(DGV_TrafficData, true, null);

              /*
               * Plugin configuration
               */
              cPluginParams = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "IP accounting",
            PluginDescription = "Listing data traffic statistics.",
            PluginVersion = "0.8",
            Ports = "",
            IsActive = true
              };

              /*
               * Initialisation
               */
              RB_Service_Click(null, null);

              cAccountingRecords = new BindingList<AccountingItem>();
              DGV_TrafficData.DataSource = cAccountingRecords;

              IPAccountingConfig lConfig = new IPAccountingConfig()
                                       {
                                         BasisDirectory = Config.BaseDir,
                                         isDebuggingOn = false, //cPluginParams.HostApplication.IsDebuggingOn(),
                                         Interface = null, //cPluginParams.HostApplication.GetInterface(),
                                         onUpdateList = update,
                                         onIPAccountingExit = null
                                       };
              cTask = TaskFacade.getInstance(lConfig, this);
              DomainFacade.getInstance(lConfig, this).addObserver(this);
        }
Ejemplo n.º 7
0
        public void onStartAttack()
        {
            if (Config.IsActive)
              {
            if (InvokeRequired)
            {
              BeginInvoke(new onStartAttackDelegate(onStartAttack), new object[] { });
              return;
            } // if (InvokeRequired)

            /*
             * Start accounting application.
             */

            try
            {
              cTask.onInit();
            //          setGUIInactive();

              IPAccountingConfig lConfig = new IPAccountingConfig
              {
            BasisDirectory = Config.BaseDir,
            isDebuggingOn = cPluginParams.HostApplication.IsDebuggingOn(),
            onUpdateList = update,
            onIPAccountingExit = onIPAccountingExited,
            Interface = cPluginParams.HostApplication.GetInterface(),
            StructureParameter = cAccountingBasis
              };

              cTask.onStart(lConfig);
              cPluginParams.HostApplication.PluginSetStatus(this, "green");
            }
            catch (Exception lEx)
            {
              cTask.onStop();
              cPluginParams.HostApplication.PluginSetStatus(this, "red");

              cPluginParams.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
            }
              } // if (cIsActi...
        }