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