public virtual void setUp() { // get link layer length int linkLayerLen = LinkLayer.getLinkLayerLength(Packets.LinkLayers.EN10MB); // create syn-ack packet _synAck = new TCPPacket(linkLayerLen, SYN_ACK_PACKET); // create psh-ack packet _pshAck = new TCPPacket(linkLayerLen, PSH_ACK_PACKET); // create packet with random garbage while(true) { try { byte[] badBytes = new byte[SYN_ACK_PACKET.Length]; (new System.Random()).NextBytes((badBytes)); _baddie = new TCPPacket(linkLayerLen, badBytes); break; } catch{} } }
public virtual void setUp() { // get link layer length int linkLayerLen = LinkLayer.getLinkLayerLength(Packets.LinkLayers.EN10MB); // create syn-ack packet _synAck = new TCPPacket(linkLayerLen, SYN_ACK_PACKET); // create psh-ack packet _pshAck = new TCPPacket(linkLayerLen, PSH_ACK_PACKET); // create packet with random garbage while (true) { try { byte[] badBytes = new byte[SYN_ACK_PACKET.Length]; (new System.Random()).NextBytes((badBytes)); _baddie = new TCPPacket(linkLayerLen, badBytes); break; } catch {} } }