home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 June
/
ccd0605.iso
/
Software
/
Shareware
/
Comunicatii
/
nat32
/
ident
< prev
next >
Wrap
Text File
|
2001-10-13
|
446b
|
33 lines
#!tcl
#
# IDENT Client - useful for testing
#
if {$argc != 3} {
error {Usage: ident address src dst}
}
set addr [lindex $argv 0]
set src [lindex $argv 1]
set dst [lindex $argv 2]
set cs [socket $addr 113]
if {[lindex $cs 0] == "can't"} {
error "Connect failed"
}
# send the request
$cs puts "$src, $dst\n"
# read the response
set data [$cs gets 512]
echo $data
# close the socket
rename $cs {}