Add -P source port option to connect

git-svn-id: file:///home/svn/framework3/trunk@6184 4d416f70-5f16-0410-b530-b9f4589650da
unstable
kris 2009-01-26 03:06:58 +00:00
parent b321790c04
commit 13cc54cbe5
1 changed files with 9 additions and 3 deletions

View File

@ -45,6 +45,7 @@ class Core
"-C" => [ false, "Try to use CRLF for EOL sequence." ], "-C" => [ false, "Try to use CRLF for EOL sequence." ],
"-c" => [ true, "Specify which Comm to use." ], "-c" => [ true, "Specify which Comm to use." ],
"-i" => [ true, "Send the contents of a file." ], "-i" => [ true, "Send the contents of a file." ],
"-P" => [ true, "Specify source port." ],
"-S" => [ true, "Specify source address." ], "-S" => [ true, "Specify source address." ],
"-s" => [ false, "Connect with SSL." ], "-s" => [ false, "Connect with SSL." ],
"-w" => [ true, "Specify connect timeout." ]) "-w" => [ true, "Specify connect timeout." ])
@ -197,7 +198,8 @@ class Core
commval = nil commval = nil
fileval = nil fileval = nil
proxies = nil proxies = nil
source = nil srcaddr = nil
srcport = nil
ssl = false ssl = false
cto = nil cto = nil
aidx = 0 aidx = 0
@ -213,11 +215,14 @@ class Core
when "-i" when "-i"
fileval = val fileval = val
aidx = idx + 2 aidx = idx + 2
when "-P"
srcport = val
aidx = idx + 2
when "-p" when "-p"
proxies = val proxies = val
aidx = idx + 2 aidx = idx + 2
when "-S" when "-S"
source = val srcaddr = val
aidx = idx + 2 aidx = idx + 2
when "-s" when "-s"
ssl = true ssl = true
@ -281,7 +286,8 @@ class Core
'SSL' => ssl, 'SSL' => ssl,
'PeerHost' => host, 'PeerHost' => host,
'PeerPort' => port, 'PeerPort' => port,
'LocalHost' => source, 'LocalHost' => srcaddr,
'LocalPort' => srcport,
'Timeout' => cto 'Timeout' => cto
}) })
rescue rescue