OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package ssh | 5 package ssh |
6 | 6 |
7 import ( | 7 import ( |
8 "errors" | 8 "errors" |
9 "fmt" | 9 "fmt" |
10 "io" | 10 "io" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 PeersId uint32 | 286 PeersId uint32 |
287 PeersWindow uint32 | 287 PeersWindow uint32 |
288 MaxPacketSize uint32 | 288 MaxPacketSize uint32 |
289 raddr string | 289 raddr string |
290 rport uint32 | 290 rport uint32 |
291 laddr string | 291 laddr string |
292 lport uint32 | 292 lport uint32 |
293 } | 293 } |
294 | 294 |
295 // dial opens a direct-tcpip connection to the remote server. laddr and raddr ar
e passed as | 295 // dial opens a direct-tcpip connection to the remote server. laddr and raddr ar
e passed as |
296 // strings and are expected to be resolveable at the remote end. | 296 // strings and are expected to be resolvable at the remote end. |
297 func (c *ClientConn) dial(laddr string, lport int, raddr string, rport int) (*tc
pChan, error) { | 297 func (c *ClientConn) dial(laddr string, lport int, raddr string, rport int) (*tc
pChan, error) { |
298 ch := c.newChan(c.transport) | 298 ch := c.newChan(c.transport) |
299 if err := c.writePacket(marshal(msgChannelOpen, channelOpenDirectMsg{ | 299 if err := c.writePacket(marshal(msgChannelOpen, channelOpenDirectMsg{ |
300 ChanType: "direct-tcpip", | 300 ChanType: "direct-tcpip", |
301 PeersId: ch.localId, | 301 PeersId: ch.localId, |
302 PeersWindow: 1 << 14, | 302 PeersWindow: 1 << 14, |
303 MaxPacketSize: 1 << 15, // RFC 4253 6.1 | 303 MaxPacketSize: 1 << 15, // RFC 4253 6.1 |
304 raddr: raddr, | 304 raddr: raddr, |
305 rport: uint32(rport), | 305 rport: uint32(rport), |
306 laddr: laddr, | 306 laddr: laddr, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 // with Timeout() == true. | 358 // with Timeout() == true. |
359 func (t *tcpChanConn) SetReadDeadline(deadline time.Time) error { | 359 func (t *tcpChanConn) SetReadDeadline(deadline time.Time) error { |
360 return errors.New("ssh: tcpChan: deadline not supported") | 360 return errors.New("ssh: tcpChan: deadline not supported") |
361 } | 361 } |
362 | 362 |
363 // SetWriteDeadline exists to satisfy the net.Conn interface | 363 // SetWriteDeadline exists to satisfy the net.Conn interface |
364 // but is not implemented by this type. It always returns an error. | 364 // but is not implemented by this type. It always returns an error. |
365 func (t *tcpChanConn) SetWriteDeadline(deadline time.Time) error { | 365 func (t *tcpChanConn) SetWriteDeadline(deadline time.Time) error { |
366 return errors.New("ssh: tcpChan: deadline not supported") | 366 return errors.New("ssh: tcpChan: deadline not supported") |
367 } | 367 } |
OLD | NEW |