Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi Frage zu Telnet (https://www.delphipraxis.net/170508-frage-zu-telnet.html)

DelTurbo 20. Sep 2012 15:11

Frage zu Telnet
 
Hi,
ich habe einen einfachen TCPServer genommen und connecte dort mit Telnet drauf. Nun ist mir aufgefallen das die Client´s "irgendwas" beim Connecten senden.

Nun zu meiner frage. Was senden die? Wie muss ich antworten? Kann man dem Client sagen das er z.b. in den Active mode gehen soll? Oder sein lokales Echo abschaltet? Mit der Indy-Telnet komponente habe ich das nicht hinbekommen, deswegen ein "dummer" TCP-Server. Der lässt den Client so wie er eingestellt ist.

Oder kann man das mit dem IndyTelnet machen? Wenn ja wie? Ich habe das "handshake" mal mitgesnifft. Aber so richtig schlau bin ich daraus auchnicht geworden.

Danke im voraus

DelTurbo 21. Sep 2012 11:03

AW: Frage zu Telnet
 
Scheint wohl keiner zu wissen... schade. Also ich habe mal geloggt. Folgendes sendet der Client.

255,251,31,255,251,24,255,251,35,255,253,3,255,253 ,1,255,254,31,255,254,24,255,254,35,255,252,3,255, 252,1

Gruss

Union 21. Sep 2012 11:11

AW: Frage zu Telnet
 
http://tools.ietf.org/html/rfc854 Seite 14.
z.b. 255 - Data byte, 251 - WILL (option code)

http://pcmicro.com/netfoss/telnet.html
z.b. 31 - Window Size (RFC 1073)

DelTurbo 21. Sep 2012 11:20

AW: Frage zu Telnet
 
Goil,
danke dir. Ich hatte auch schon nach Telnet gesucht. Aber nur Tausende seiten mit "mist" gefunden. Ich hatte es grade gesehen das es immer 3er blöcke sind. Als ich am rätseln war, kam deine antwort.

Nochmal, vielen dank!!!

DelTurbo 21. Sep 2012 11:41

AW: Frage zu Telnet
 
Öhm, noch ne "dumme" frage hinterher. Das IndyTelnet kann das alles nicht, oder? Da müsste ich das denn auch "zufuss" machen, richtig?

taveuni 21. Sep 2012 12:26

AW: Frage zu Telnet
 
AsyncPro hat eine Telnet Komponente dabei die alles kapselt.

DelTurbo 21. Sep 2012 12:36

AW: Frage zu Telnet
 
Thx...

mjustin 21. Sep 2012 13:01

AW: Frage zu Telnet
 
Zitat:

Zitat von DelTurbo (Beitrag 1183865)
Öhm, noch ne "dumme" frage hinterher. Das IndyTelnet kann das alles nicht, oder? Da müsste ich das denn auch "zufuss" machen, richtig?

Definiere "alles" :wink:

In IdTelnet.pas sehe ich einige Konstanten, die das Protokoll betreffen. Indy Telnet liefert aber keine GUI mit, daher werden Optionen wie "Window Size" in der Komponente nicht behandelt.

Es ist aber eine komplette "Verhandlung" (Negotiation) der Sitzungsparameter vorhanden, in die man sich einklinken kann.


Delphi-Quellcode:
{ These are the telnet command constansts from RFC 854 }
  TNC_EOR               = $EF;  // End of Record RFC 885
  TNC_SE                = $F0;  // End of subnegotiation parameters.
  TNC_NOP               = $F1;  // No operation.
  TNC_DATA_MARK         = $F2;  // The data stream portion of a Synch.
                                  // This should always be accompanied
                                  // by a TCP Urgent notification.
  TNC_BREAK             = $F3;  // NVT character BRK.
  TNC_IP                = $F4;  // The function IP.
  TNC_AO                = $F5;  // The function ABORT OUTPUT.
  TNC_AYT               = $F6;  // The function ARE YOU THERE.
  TNC_EC                = $F7;  // The function ERASE CHARACTER.
  TNC_EL                = $F8;  // The function ERASE LINE.
  TNC_GA                = $F9;  // The GO AHEAD signal.
  TNC_SB                = $FA;  // Indicates that what follows is
                                  // subnegotiation of the indicated
                                  // option.
  TNC_WILL              = $FB;  // Indicates the desire to begin
                                  // performing, or confirmation that
                                  // you are now performing, the
                                  // indicated option.
  TNC_WONT              = $FC;  // Indicates the refusal to perform,
                                  // or continue performing, the
                                  // indicated option.
  TNC_DO                = $FD;  // Indicates the request that the
                                  // other party perform, or
                                  // confirmation that you are expecting
                                  // the other party to perform, the
                                  // indicated option.
  TNC_DONT              = $FE;  // Indicates the demand that the
                                  // other party stop performing,
                                  // or confirmation that you are no
                                  // longer expecting the other party
                                  // to perform, the indicated option.
  TNC_IAC               = $FF;  // Data Byte 255.

...

DelTurbo 21. Sep 2012 13:17

AW: Frage zu Telnet
 
In die Negotiation hab ich mich eben mal eingeklinkt. Der springt da nur einmal durch, obwohl der client mehr als eine sache schickt. Der schickt folgendes:

SENT WILL NAWS
SENT WILL TERMTYPE
SENT WILL XDISPLOC
SENT DO SGA
SENT DO ECHO

Aber ich werde mich gleich mal damit bissl mehr beschäftigen. Ich wollte das nun erst "zu fuss" über einen normalen TCPServer machen. Aber das ist mehr arbeit als ich dachte :roll:

NACHTRAG:
Es klappt. Ich kann endlich dem Client sagen das er kein lokales echo macht. Nun muss ich ihm noch "sagen" das er Active ist. Sollte aber auch kein prob sein.

Danke an alle

Delphi-Quellcode:
procedure TForm1.IdTelnetServer1Negotiate(AContext: TIdContext);
begin
    AContext.Connection.IOHandler.Write(255);
    AContext.Connection.IOHandler.Write(254);
    AContext.Connection.IOHandler.Write(1);
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:37 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz