1
0
forked from x/icebergs
icebergs/base/ssh/service_darwin.go
2021-06-03 16:35:26 +08:00

28 lines
767 B
Go

package ssh
import (
"encoding/binary"
"net"
"syscall"
"unsafe"
ice "github.com/shylinux/icebergs"
"golang.org/x/crypto/ssh"
)
type Winsize struct{ Height, Width, x, y uint16 }
func _ssh_size(fd uintptr, b []byte) {
w := binary.BigEndian.Uint32(b)
h := binary.BigEndian.Uint32(b[4:])
ws := &Winsize{Width: uint16(w), Height: uint16(h)}
syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))
}
func _ssh_sizes(fd uintptr, w, h int) {
ws := &Winsize{Width: uint16(w), Height: uint16(h)}
syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws)))
}
func _ssh_handle(m *ice.Message, meta map[string]string, c net.Conn, channel ssh.Channel, requests <-chan *ssh.Request) {
}