diff options
Diffstat (limited to 'utils/pos/directnet.pl')
-rwxr-xr-x | utils/pos/directnet.pl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/utils/pos/directnet.pl b/utils/pos/directnet.pl new file mode 100755 index 00000000..3bdd2e51 --- /dev/null +++ b/utils/pos/directnet.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +($host, $proto, $port) = @ARGV; + +socket(SOCK, 2, 1, getprotobynumber($proto)); + +$dest=pack( + 's n a4 x8', 2, $port, + pack('CCCC', split(/\./, $host)) +); + +connect (SOCK, $dest); + +open ('STD', '-'); +while ($line = <STD>){ + print SOCK $line; +} +close STD; +close SOCK; + |