Beispiel #1
0
 public SimulatorPacket(SimulatorPacket pack)
 {
     Type t = typeof(SimulatorPacket);
     PropertyInfo[] properties = t.GetProperties();
     foreach (PropertyInfo pi in properties)
     {
         pi.SetValue(this, pi.GetValue(pack, null), null);
     }
 }
Beispiel #2
0
        // TODO check if this work corectlly
        public KeepAlive(SimulatorPacket pack)
        {
            Type t = typeof(SimulatorPacket);

            PropertyInfo[] properties = t.GetProperties();
            foreach (PropertyInfo pi in properties)
            {
                pi.SetValue(this, pi.GetValue(pack, null), null);
            }
        }
Beispiel #3
0
 //=====================================================================
 public virtual void ParseReceivedPacket(SimulatorPacket pack)
 {
 }
Beispiel #4
0
 public NullDataAck(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #5
0
 public Connect(SimulatorPacket pack) : base(pack)
 {
 }
 public TDLSTearDown(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #7
0
 public ConnectionACK(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #8
0
 public ConnectionACK(SimulatorPacket pack)
     : base(pack)
 {
 }
 // TODO check if this work corectlly
 public KeepAlive(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #10
0
 public TDLSSetupConfirm(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #11
0
 public Beacon(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #12
0
 public Beacon(SimulatorPacket pack) : base(pack)
 {
 }
 public TDLSChannelSwitchRequest(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #14
0
 public TDLSSetupRequest(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #15
0
        //*********************************************************************
        public void SendData(SimulatorPacket pack)
        {
            CheckScanConditionOnSend();
            int Rate = pack.getTransmitRate();
            int sleep = (int)(600 / Rate);
            lock (RfSync)
            {
                try{
                    RF_STATUS = RFStatus.Tx;
                    short OperateChannel = this.getOperateChannel();
                    int try_counter = 0;
                    while (!Medium.Registration(this.Freq, OperateChannel, this.x, this.y, sleep))
                    {
                        Thread.Sleep(new TimeSpan(randomWait.Next(20, 50)));
                        if (try_counter++ > 200)
                            return;
                    }
                    this.MACLastTrnsmitRate = pack.getTransmitRate();
                    Medium.SendData(pack);
                }
                catch(Exception ex){
                    AddToLog("SendData:[" + this.GetType() + "] " + ex.Message);
                    MessageBox.Show("SendData :" + ex.Message);
                }

                RF_STATUS = RFStatus.None;
            }
            if (pack.GetType() == typeof(Data)){
                _DataSent++;
            }
        }
Beispiel #16
0
 public TDLSChannelSwitchResponse(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #17
0
        //=====================================================================
        //[MethodImpl(MethodImplOptions.Synchronized)]
        /// <summary>
        /// Function for parse received packet
        /// </summary>
        /// <param name="pack">SimulatorPacket</param>
        public override void ParseReceivedPacket(SimulatorPacket pack)
        {
            Type pt = pack.GetType();

            if (pt == typeof(Connect))
                ConnectRoutine(pack.Source);
            else if (pt == typeof(Disconnect))
                DisonnectRoutine(pack.Source);
            else if (pt == typeof(KeepAlive))
            {
                var newThread = new Thread(() => UpdateSTAKeepAliveInfoOnReceive(pack.Source));
                newThread.Start();
            }
            else if (pt == typeof(Data))
                DataRoutine((Data) pack);
            else if (pt == typeof(DataAck))
                DataAckRoutine((DataAck)pack);
            else
                OtherPacketsRoutine(pack);
        }
Beispiel #18
0
 public TDLSSetupRequest(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #19
0
 //=====================================================================
 /// <summary>
 /// This function work with all others packets which don't have special Routines
 /// </summary>
 /// <param name="pack">Simulator Packet </param>
 private void OtherPacketsRoutine(SimulatorPacket pack)
 {
     //  Generic Packet retransmitter
     //  This code will create new packet by him type
     var instance = (SimulatorPacket)Activator.CreateInstance(pack.GetType(), pack);
     instance.X              = this.x;
     instance.Y              = this.y;
     instance.Destination    = pack.Reciver;
     SendData(instance);
 }
Beispiel #20
0
 public Disconnect(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #21
0
 public TDLSSetupConfirm(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #22
0
 public NullData(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #23
0
 public TDLSSetupResponse(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #24
0
 public Data(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #25
0
 // TODO check if this work corectlly
 public KeepAlive(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #26
0
 public TDLSSetupResponse(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #27
0
 public TDLSTearDown(SimulatorPacket pack)
     : base(pack)
 {
 }
 public TDLSChannelSwitchResponse(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #29
0
 public SimulatorPacket CreatePacket(bool inTDLS)
 {
     SimulatorPacket pack = new SimulatorPacket(this.getOperateChannel())
     {
         SSID                = this.SSID,
         Source              = getMACAddress(),
         X                   = this.x,
         Y                   = this.y,
         PacketFrequency     = this.Freq,
         PacketStandart      = this.Stand80211,
         PacketBandWith      = this.BandWidth,
     };
     return (pack);
 }
Beispiel #30
0
 public TDLSChannelSwitchRequest(SimulatorPacket pack)
     : base(pack)
 {
 }
Beispiel #31
0
 public DataAck(SimulatorPacket pack)
     : base(pack)
 {
 }