public TcpPcb(TcpFrame frame, ILayerLocator locator) { if (frame == null) { throw new ArgumentNullException(nameof(frame)); } this.Locator = locator ?? throw new ArgumentNullException(nameof(locator)); this.AcknowledgeNo = frame.AcknowledgeNo; this.SequenceNo = frame.SequenceNo; this.AddressFamily = frame.AddressFamily; this.Destination = frame.Destination; this.Source = frame.Source; this.Ttl = frame.Ttl; this.Aborted = false; this.Estableshed = false; this.SendBufferSize = frame.WindowSize; this.ReceiveBufferSize = frame.WindowSize; this.InputStream = new TcpInputStream(this); this.InputStream.Receive += (sender, e) => { uint ackNo = Convert.ToUInt32(e.SequenceNo + e.Payload.Length); uint seqNo = e.AcknowledgeNo; this.SequenceNo = ackNo; { this.Post(TcpFlags.TCP_ACK, ackNo, seqNo, 0); } this.OnMessage(e.Payload); }; }
public IPv4Layer(ILayerLocator locator) { this.Locator = locator ?? throw new ArgumentNullException(nameof(locator)); this.Tcp = locator.Tcp; this.Udp = locator.Udp; this.Icmp = locator.Icmp; }
public TcpLayer(ILayerLocator locator) { this.Locator = locator ?? throw new ArgumentNullException(nameof(locator)); new Thread(WorkThread) { IsBackground = true, Priority = ThreadPriority.Lowest }.Start(); }
public Layer3Netif(ILayerLocator locator, string componentId) { if (locator == null) { throw new ArgumentNullException(nameof(locator)); } this.Handle = OpenTunDev(componentId); if (IntPtr.Zero == this.Handle) { throw new SystemException("Unable to open netif specifying componentId"); } this.IPv4 = locator.IPv4; this.Index = GetAdapterIndex(componentId); this.Name = GetAdapterName(componentId); }
public TUN2SocksSocketScheduler(TUN2Socks tun2socks, ILayerLocator locator) : base(locator) { this.m_tun2socks = tun2socks ?? throw new ArgumentNullException(nameof(tun2socks)); }
public IcmpLayer(ILayerLocator locator) { this.Locator = locator ?? throw new ArgumentNullException(nameof(locator)); }
protected internal virtual TUN2SocksSocketScheduler CreateSocketScheduler(ILayerLocator locator) { return(new TUN2SocksSocketScheduler(this, locator)); }
public SocketScheduler(ILayerLocator locator) { this.Locator = locator ?? throw new ArgumentNullException(nameof(locator)); }