home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Shareware / Comunicatii / nat32 / ident < prev    next >
Text File  |  2001-10-13  |  446b  |  33 lines

  1. #!tcl
  2.  
  3. #
  4. # IDENT Client - useful for testing 
  5. #
  6.  
  7. if {$argc != 3} {
  8.     error {Usage: ident address src dst}
  9. }
  10.  
  11. set addr [lindex $argv 0]
  12. set src [lindex $argv 1]
  13. set dst [lindex $argv 2]
  14.  
  15. set cs [socket $addr 113]
  16.  
  17. if {[lindex $cs 0] == "can't"} {
  18.     error "Connect failed"
  19. }
  20.  
  21. # send the request
  22.  
  23. $cs puts "$src, $dst\n"
  24.  
  25. # read the response
  26.  
  27. set data [$cs gets 512]
  28. echo $data
  29.  
  30. # close the socket
  31.  
  32. rename $cs {}
  33.