summaryrefslogtreecommitdiff
path: root/utils/pos/directnet.pl
blob: efe4de0aa616e3a56c558de7bcd96d140533e25f (plain)
  1. #!/usr/bin/perl
  2. $host, $proto, $port ) = @ARGV;
  3. socket( SOCK, 2, 1, getprotobynumber($proto) );
  4. $dest = pack( 's n a4 x8', 2, $port, pack( 'CCCC', split( /\./, $host ) ) );
  5. connect( SOCK, $dest );
  6. open( 'STD', '-' );
  7. while ( $line = <STD> ) {
  8. print SOCK $line;
  9. }
  10. close STD;
  11. close SOCK;