public static void AddressCheckResponse(NatNegServer server, UDPPacket packet) { InitPacket initPacket = new InitPacket(packet.BytesRecieved); byte[] sendingBuffer = initPacket.CreateReplyPacket(); server.Send(packet, sendingBuffer); }
public static void NatifyResponse(NatNegServer server, byte[] recv) { InitPacket initPacket = new InitPacket(recv); byte[] sendingBuffer = initPacket.CreateReplyPacket(); server.SendAsync(server.Socket.RemoteEndPoint, sendingBuffer); }
public void Parse(InitPacket init) { Version = init.Version; Cookie = init.Cookie; PortType = init.PortType; ClientIndex = init.ClientIndex; }
protected override void CheckRequest() { _initPacket = new InitPacket(); _initPacket.Parse(_recv); string key = _session.RemoteEndPoint.ToString() + "-" + _initPacket.PortType.ToString(); if (!NatNegotiatorPool.Sessions.TryGetValue(key, out _)) { NatNegotiatorPool.Sessions.TryAdd(key, _session); } }
private void HandlePacket(InitPacket packet) { logger.LogDebug("Processing Init SFTP packet, version={Version}.", packet.Version); var version = new VersionPacket { // Version = Math.Min(packet.Version, 3) Version = 3 }; Send(version); }
protected override void CheckRequest() { _initPacket = new InitPacket(); _initPacket.Parse(_recv); }