note 44425 deleted from function.fsockopen by tomsommer
| From: | tomsommer@php.net | Date: | Thu, 05 Aug 2004 13:46:52 +0000 |
| Subject: | note 44425 deleted from function.fsockopen by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74014@lists.php.net to get a copy of this message | ||
Note Submitter: edgar.ayllon@telefonica.net
----
There's a code that I wrote based on a telnet RFC, used to establish a conection between XP
--> Linux Mandrake machines. Ethereal was used to catch the transmision data.
<?php
//------------------------------ VARS BEGIN-----------------------
//HEAD
$IAC=chr(0xff); // IAC Interpret as a command
// NEGOTIATIONS
$WILL=$IAC.chr(0xfb); // will Indicates the desire to begin performing, or confirmation that you
are now performing, the indicated option.
$WONT=$IAC.chr(0xfc); // wont Indicates the refusal to perform, or continue performing, the
indicated option.
$DO=$IAC.chr(0xfd); // do Indicates the request that the other party perform, or confirmation
that you are expecting the other party to perform, the indicated option.
$DONT=$IAC.chr(0xfe); // dont 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.
$SB=$IAC.chr(0xfa); // Subnegotiation Subnegotiation of the indicated option follows.
$SE=$IAC.chr(0xf0); // End of subnegotiation parameters
// NEGOTIATION OPTIONS (MORE USUAL)
$TOPT_NULL=chr(0x00); // NULL EMPTY
$TOPT_ECHO=chr(0x01); // echo
$TOPT_RECO=chr(0x02); // Reconection
$TOPT_SUPP=chr(0x03); // suppress go ahead
$TOPT_STAT=chr(0x05); // status
$TOPT_TIM=chr(0x06); // timing mark
$TOPT_TERM=chr(0x18); // terminal type
$TOPT_TS=chr(0x20); // terminal speed
$TOPT_RFC=chr(0x21); // remote flow control
$TOPT_LINE=chr(0x22); // linemode
$TOPT_XDL=chr(0x23); // X Display Location
$TOPT_ENVIR=chr(0x24); // Environment variables
$TOPT_AUTH=chr(0x25); // Authentication
$TOPT_ENCR=chr(0x26); // Encription
$TOPT_NENVIR=chr(0x27); // New environment
$TOPT_NAWS=chr(0x1f); // window size
// COMMANDS
$DM=chr(0xf2); // Data mark Indicates the position of a Synch event within the data stream.
// This should always be accompanied by a TCP urgent notification.
$BRK=chr(0xf3); // Break Indicates that the "break" or "attention" key
was hi.
$IP=chr(0xf4); // Suspend Interrupt or abort the process to which the NVT is connected.
$AO=chr(0xf5); // Abort output Allows the current process to run to completion but does not
send its output to the user.
$AYT=chr(0xf6); // Are you there Send back to the NVT some visible evidence that the AYT was
received.
$EC=chr(0xf7); // Erase character The receiver should delete the last preceding undeleted
character from the data stream.
$EL=chr(0xf8); // Erase line Delete characters from the data stream back to but not including
the previous CRLF.
$GA=chr(0xf9); // Go ahead Under certain circumstances used to tell the other end that it can
transmit.
$NOP=chr(0xf1); // No operation
// RESPONSES
$respWILL=$WILL; //Sender wants to do something.
$respDO=$DO ; //Sender wants the other end to do something.
$respWONT=$WONT; //Sender does not want to do something.
$respDONT=$DONT; //Sender wants the other not to do something.
// TERMINAL types and Windows Sizes
$VT100=$TOPT_NULL.chr(0x56).chr(0X54).chr(0x31).chr(0x30).chr(0x30); // VT100
$WS80_25=$TOPT_NULL.chr(0x50).$TOPT_NULL.chr(0x19); // Window size 80 cols 25 rows
$WS80_24=$TOPT_NULL.chr(0x50).$TOPT_NULL.chr(0x18); // Window size 80 cols 24 rows
//------------------------------ END VARS -----------------------
?>