Changeset 1098


Ignore:
Timestamp:
Jan 20, 2010, 3:09:12 PM (12 years ago)
Author:
arnold
Message:

Updated all P2PProjects - inclusive DLLs and PDBs

The lib is required by all developers, so I'm adding it explicitly to the repository.

override-bad-extension: Bootstrapper.dll
override-bad-extension: Bootstrapper.pdb
override-bad-extension: CertServices.dll
override-bad-extension: CertServices.pdb
override-bad-extension: FullMeshDHT.dll
override-bad-extension: FullMeshDHT.pdb
override-bad-extension: FullMeshOverlay.dll
override-bad-extension: FullMeshOverlay.pdb
override-bad-extension: Gears4Net.dll
override-bad-extension: Gears4Net.pdb
override-bad-extension: NetGearsTCP.dll
override-bad-extension: NetGearsTCP.pdb
override-bad-extension: PeersAtPlayBase.dll
override-bad-extension: PeersAtPlayBase.pdb
override-bad-extension: SimpleSnalNG.dll
override-bad-extension: SimpleSnalNG.pdb
override-bad-extension: Stun.dll
override-bad-extension: Stun.pdb
override-bad-extension: Util.dll
override-bad-extension: Util.pdb

Location:
trunk
Files:
5 added
4 deleted
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher_IControl/KeySearcher_IControl.cs

    r1090 r1098  
    9797         * Encryption Control isn't initialized already.
    9898         */
    99         public delegate void IsReadyForExecution();
    100         public event IsReadyForExecution OnAllMasterControlsInitialized;
    101 
    102         public override void  Execute()
    103         {
    104             if(this.ControlMaster != null)
    105             {
    106                 if (OnAllMasterControlsInitialized != null)
    107                     OnAllMasterControlsInitialized();
    108             }
     99        //public delegate void IsReadyForExecution();
     100        //public event IsReadyForExecution OnAllMasterControlsInitialized;
     101
     102        public override void Execute()
     103        {
     104            //if(this.ControlMaster != null)
     105            //{
     106            //    if (OnAllMasterControlsInitialized != null)
     107            //        OnAllMasterControlsInitialized();
     108            //}
    109109        }
    110110    }
     
    137137        {
    138138            this.keySearcher = keysearcher;
    139            // this.keySearcher.OnBruteforcingEnded +=new KeySearcher.KeySearcher.BruteforcingEnded(keySearcher_OnBruteforcingEnded);
     139            // this.keySearcher.OnBruteforcingEnded +=new KeySearcher.KeySearcher.BruteforcingEnded(keySearcher_OnBruteforcingEnded);
    140140            // subscribe to event before any bruteforcing has started, so we make sure that this event will thrown in every case
    141141            this.keySearcher.OnBruteforcingEnded += new KeySearcher.KeySearcher.BruteforcingEnded(keySearcher_OnBruteforcingEnded);
    142             this.keySearcher.OnAllMasterControlsInitialized += new KeySearcher_IControl.IsReadyForExecution(keySearcher_OnAllMasterControlsInitialized);
     142            //this.keySearcher.OnAllMasterControlsInitialized += new KeySearcher_IControl.IsReadyForExecution(keySearcher_OnAllMasterControlsInitialized);
    143143        }
    144144
     
    159159            // if not all MasterControls are initialized, store the actual
    160160            // pattern and wait for throwing the OnMasterControlsInitialized-Event
    161             if (!allMasterControlsInitialized)
    162             {
    163                 tryBruteforcingBeforeMastersInitialized = true;
    164                 this.actualKeyPattern = pattern;
    165                 this.encryptedData = encryptedData;
    166                 this.initVector = initVector;
    167                 return;
    168             }
     161            //if (!allMasterControlsInitialized)
     162            //{
     163            //    tryBruteforcingBeforeMastersInitialized = true;
     164            //    this.actualKeyPattern = pattern;
     165            //    this.encryptedData = encryptedData;
     166            //    this.initVector = initVector;
     167            //    return;
     168            //}
    169169            Bruteforcing(pattern, encryptedData, initVector);
    170170        }
     
    175175         * initialized, in this case the pattern will be stored and processed
    176176         * after this event was thrown. */
    177         private void keySearcher_OnAllMasterControlsInitialized()
    178         {
    179             this.allMasterControlsInitialized = true;
    180             if (this.tryBruteforcingBeforeMastersInitialized)
    181             {
    182                 Bruteforcing(this.actualKeyPattern, this.encryptedData, this.initVector);
    183                 this.actualKeyPattern = null;
    184                 this.encryptedData = null;
    185                 this.initVector = null;
    186 
    187                 this.tryBruteforcingBeforeMastersInitialized = false;
    188             }
    189         }
     177        //private void keySearcher_OnAllMasterControlsInitialized()
     178        //{
     179        //    this.allMasterControlsInitialized = true;
     180        //    if (this.tryBruteforcingBeforeMastersInitialized)
     181        //    {
     182        //        Bruteforcing(this.actualKeyPattern, this.encryptedData, this.initVector);
     183        //        this.actualKeyPattern = null;
     184        //        this.encryptedData = null;
     185        //        this.initVector = null;
     186
     187        //        this.tryBruteforcingBeforeMastersInitialized = false;
     188        //    }
     189        //}
    190190
    191191        private void Bruteforcing(KeyPattern actualKeyPattern, byte[] encryptedData, byte[] initVector)
     
    210210        public void StopBruteforcing()
    211211        {
    212             this.keySearcher.OnAllMasterControlsInitialized -= keySearcher_OnAllMasterControlsInitialized;
     212            //this.keySearcher.OnAllMasterControlsInitialized -= keySearcher_OnAllMasterControlsInitialized;
    213213        }
    214214
  • trunk/CrypPlugins/PeerToPeerBase/PeerToPeerBase.cs

    r1067 r1098  
    9999        #region Variables
    100100
    101         /// <summary>
    102         /// If you want to ignore the integrated Versioning System of PeersAtPlay,
    103         /// set this flag to true.
    104         /// The DHT has an integrated VERSIONING SYSTEM. When a peer wants
    105         /// to store data in an entry, which already holds data, the version
    106         /// number will be compared with the peers' version number. If the
    107         /// peer hasn't read/write the entry the last time, the storing instruction
    108         /// will be rejected. You must first read the actual data and than you can
    109         /// store your data in this entry...
    110         /// </summary>
    111         private const bool IGNORE_DHT_VERSIONING_SYSTEM = true;
    112 
    113101        private bool started = false;
    114102        /// <summary>
     
    365353        public void AsynchStore(string sKey, string sValue)
    366354        {
    367             this.dht.Store(OnAsynchStore_Completed, sKey, UTF8Encoding.UTF8.GetBytes(sValue), IGNORE_DHT_VERSIONING_SYSTEM);
     355            //this.dht.Store(OnAsynchStore_Completed, sKey, UTF8Encoding.UTF8.GetBytes(sValue), IGNORE_DHT_VERSIONING_SYSTEM);
     356            this.dht.Store(OnAsynchStore_Completed, sKey, UTF8Encoding.UTF8.GetBytes(sValue));
    368357        }
    369358
     
    387376        public void AsynchRemove(string sKey)
    388377        {
    389             this.dht.Remove(OnAsynchRemove_Completed, sKey, IGNORE_DHT_VERSIONING_SYSTEM);
     378            //this.dht.Remove(OnAsynchRemove_Completed, sKey, IGNORE_DHT_VERSIONING_SYSTEM);
     379            this.dht.Remove(OnAsynchRemove_Completed, sKey);
    390380        }
    391381        private void OnAsynchRemove_Completed(RemoveResult rr)
     
    416406            AutoResetEvent are = new AutoResetEvent(false);
    417407            // this method returns always a GUID to distinguish between asynchronous actions
    418             Guid g = this.dht.Store(OnSynchStoreCompleted, sKey, byteData, IGNORE_DHT_VERSIONING_SYSTEM);
     408            Guid g = this.dht.Store(OnSynchStoreCompleted, sKey, byteData);
     409            //Guid g = this.dht.Store(OnSynchStoreCompleted, sKey, byteData, IGNORE_DHT_VERSIONING_SYSTEM);
    419410
    420411            ResponseWait rw = new ResponseWait() { WaitHandle = are, key=sKey , value = byteData };
     
    561552            AutoResetEvent are = new AutoResetEvent(false);
    562553            // this method returns always a GUID to distinguish between asynchronous actions
    563             Guid g = this.dht.Remove(OnSynchRemoveCompleted, sKey, IGNORE_DHT_VERSIONING_SYSTEM);
     554            Guid g = this.dht.Remove(OnSynchRemoveCompleted, sKey);
     555            //Guid g = this.dht.Remove(OnSynchRemoveCompleted, sKey, IGNORE_DHT_VERSIONING_SYSTEM);
    564556
    565557            ResponseWait rw = new ResponseWait() { WaitHandle = are };
  • trunk/CrypPlugins/PeerToPeerManager/P2PManagerBase.cs

    r1090 r1098  
    1212using Cryptool.PluginBase.IO;
    1313
     14/* Nice to have:
     15 * - Enable processing incoming intermediate results
     16 *      - Compare PatternResults and only take the top 10 */
     17
    1418namespace Cryptool.Plugins.PeerToPeer
    1519{
     
    3842
    3943        private const int MAX_IN_TOP_LIST = 10;
    40         //private const string DHT_ENCRYPTED_TEXT = "EncryptedText";
    41         //private const string DHT_INIT_VECTOR = "InitializationVector";
    4244
    4345        private bool managerStarted = false;
     
    4850        }
    4951
    50         // 10.000 = 2048 Keys; 100.000 = 256 Keys; 400.000 = 64 Keys; 1.000.000 = 32 Keys - Angaben je für AES und 6 Wildcards...
    5152        private BigInteger keyPatternPartSize = 1000000;
    5253        /// <summary>
     
    229230            foreach (PeerId subscriber in lstSubscribers)
    230231            {
     232                if (this.allocatedPatterns.ContainsKey(subscriber))
     233                {
     234                    GuiLogging("WARNING: Dispersing a new pattern to an already working peer was canceled.", NotificationLevel.Debug);
     235                    break;
     236                }
     237
    231238                if (iCycle <= iFreePatternAmount)
    232239                {
  • trunk/CrypPlugins/PeerToPeerManager/WorkersManagement.cs

    r1068 r1098  
    44using System.Text;
    55
    6 /*
    7  * CLASS INFORMATION
     6/* CLASS INFORMATION
    87 * This class is derived from SubscriberManagement. The whole availability- and update-functionality
    9  * is assumed unchanged. Only Adding- and Removing-functionalities for subscriber/worker are extended,
    10  * because of an easier management it must handle the two lists freeWorkers and busyWorkers.
    11  */
     8 * is assumed unchanged. Only Adding- and Removing-functionalities for subscriber/worker were extended,
     9 * because of an easier management, it must handle the two lists freeWorkers and busyWorkers. */
    1210
    1311namespace Cryptool.Plugins.PeerToPeer
     
    117115
    118116            // fill freeWorker-List with new Worker too
    119             if(!this.freeWorkers.Contains(subscriberId))
     117            if (!this.freeWorkers.Contains(subscriberId))
     118            {
    120119                this.freeWorkers.Add(subscriberId);
    121 
    122             CheckAvailabilityOfFreeWorkers();
     120                CheckAvailabilityOfFreeWorkers();
     121            }
    123122
    124123            return bolBaseAdd;
     
    127126        public override bool Remove(PeerId subscriberId)
    128127        {
     128            RemoveWorker(subscriberId);
     129            // execute base method here, because the OnPeerRemoved-Event
     130            // will be fired in this method - catched and handled by
     131            // the Manager
    129132            bool baseResult = base.Remove(subscriberId);
    130133
    131             RemoveWorker(subscriberId);
    132 
    133134            return baseResult;
    134         }
    135 
    136         protected override bool RemoveSubscriberEverywhere(PeerId subId)
    137         {
    138             bool result = base.RemoveSubscriberEverywhere(subId);
    139 
    140             RemoveWorker(subId);
    141 
    142             return result;
    143135        }
    144136
  • trunk/CrypPlugins/PeerToPeerPublisher/P2PPublisherBase.cs

    r1090 r1098  
    175175                    if (this.peerManagement.Add(sender))
    176176                    {
    177                         GuiLogging("REGISTERED: Peer with ID " + sender, NotificationLevel.Info);
     177                        GuiLogging("REGISTERED: Peer with ID " + sender + "- RegExepted Msg was sent.", NotificationLevel.Info);
    178178                        this.p2pControl.SendToPeer(PubSubMessageType.RegisteringAccepted, sender);
    179179                    }
  • trunk/CrypPlugins/PeerToPeerPublisher/SubscribersManagement.cs

    r1068 r1098  
    9090
    9191        /// <summary>
    92         /// Removes Subscriber from list
     92        /// Removes Subscriber/Worker from all managment lists
    9393        /// </summary>
    94         /// <param name="subscriberId"></param>
     94        /// <param name="subscriberId">ID of the removed subscriber/worker</param>
    9595        /// <returns></returns>
    9696        public virtual bool Remove(PeerId subscriberId)
    9797        {
    98             return RemoveSubscriberEverywhere(subscriberId);
    99         }
    100 
    101         protected virtual bool RemoveSubscriberEverywhere(PeerId subId)
    102         {
    10398            bool result = false;
    104             lock(this.checkList)
     99            lock (this.checkList)
    105100            {
    106                 if(this.secondChanceList.Contains(subId))
    107                     this.secondChanceList.Remove(subId);
    108                 if (this.checkList.ContainsKey(subId))
     101                if (this.secondChanceList.Contains(subscriberId))
     102                    this.secondChanceList.Remove(subscriberId);
     103                if (this.checkList.ContainsKey(subscriberId))
    109104                {
    110                     this.checkList.Remove(subId);
     105                    this.checkList.Remove(subscriberId);
    111106                    result = true;
    112107                }
    113108
    114109                if (result && OnSubscriberRemoved != null)
    115                     OnSubscriberRemoved(subId);
     110                    OnSubscriberRemoved(subscriberId);
    116111            }
    117112            return result;
     
    149144            foreach (PeerId removeSub in removeSubscribersFromDict)
    150145            {
    151                 // functionality swapped for inheritance matters
    152                 RemoveSubscriberEverywhere(removeSub);
     146                Remove(removeSub);
    153147            }
    154148
  • trunk/CrypPlugins/PeerToPeerWorker/P2PWorkerBase.cs

    r1090 r1098  
    88using KeySearcher;
    99
     10/* Nice to have:
     11 * - Enable sending intermediate results in a user-defined interval */
     12
    1013namespace Cryptool.Plugins.PeerToPeer
    1114{
     
    138141            if (receivedKeyPattern != null)
    139142            {
    140                 // only one Pattern can be bruteforced concurrently,
    141                 // so other incoming Patterns have to wait
     143                /* only one Pattern can be bruteforced concurrently,
     144                 * so other incoming Patterns will be admitted to the
     145                 * waitingJobList, will be processed immediately at
     146                 * the end of the current bruteforce-Job */
    142147                if (this.currentlyWorking)
    143148                {
     
    146151                else
    147152                {
    148                     //Thread processingThread = new Thread(new ParameterizedThreadStart(this.StartProcessing));
    149                     //processingThread.Start(receivedKeyPattern);
    150                     StartProcessing(receivedKeyPattern);
     153                    Thread processingThread = new Thread(new ParameterizedThreadStart(this.StartProcessing));
     154                    processingThread.Start(receivedKeyPattern);
     155                    //StartProcessing(receivedKeyPattern);
    151156                }
    152157            }
     
    158163
    159164        // necessary, because Thread-starting doesn't allow other parameters than object
    160         //private void StartProcessing(object receivedKeyPattern)
    161         //{
    162         //    if (receivedKeyPattern is KeyPattern)
    163         //        StartProcessing(receivedKeyPattern as KeyPattern);
    164         //}
     165        private void StartProcessing(object receivedKeyPattern)
     166        {
     167            if (receivedKeyPattern is KeyPattern)
     168                StartProcessing(receivedKeyPattern as KeyPattern);
     169        }
    165170
    166171        /// <summary>
     
    179184
    180185            /* Begin: New stuff because of changing the IControl data flow - Arnie 2010.01.18 */
    181             byte[] encryptedData = this.p2pControl.DHTload(sTopicName + "EncryptedText");
    182             byte[] initVector = this.p2pControl.DHTload(sTopicName + "InitializationVector");
    183             //byte[] encryptedData = DHT_CommonManagement.GetEncryptedData(ref this.p2pControl, sTopicName);
    184             //byte[] initVector = DHT_CommonManagement.GetInitializationVector(ref this.p2pControl, sTopicName);
     186
     187            GuiLogging("BEGIN: Retrieving encryption information from the DHT.", NotificationLevel.Debug);
     188            //byte[] encryptedData = this.p2pControl.DHTload(sTopicName + "EncryptedText");
     189            //byte[] initVector = this.p2pControl.DHTload(sTopicName + "InitializationVector");
     190            byte[] encryptedData = DHT_CommonManagement.GetEncryptedData(ref this.p2pControl, sTopicName);
     191            byte[] initVector = DHT_CommonManagement.GetInitializationVector(ref this.p2pControl, sTopicName);
     192            GuiLogging("END: Retrieving encryption information from the DHT.", NotificationLevel.Debug);
     193
    185194            /* End: New stuff because of changing the IControl data flow */
    186195
Note: See TracChangeset for help on using the changeset viewer.