Initial import

This commit is contained in:
2025-10-10 10:05:13 +02:00
parent 3effc1597b
commit b96b6e7f8f
164 changed files with 5473 additions and 0 deletions

47
ssh/sshutil/request.go Normal file
View File

@@ -0,0 +1,47 @@
package sshutil
import "golang.org/x/crypto/ssh"
type EnvRequest struct {
Key, Value string
}
func ParseEnvRequest(data []byte) (*EnvRequest, error) {
r := new(EnvRequest)
if err := ssh.Unmarshal(data, r); err != nil {
return nil, err
}
return r, nil
}
type PTYRequest struct {
Term string
Columns uint32
Rows uint32
Width uint32
Height uint32
ModeList []byte
}
func ParsePTYRequest(data []byte) (*PTYRequest, error) {
r := new(PTYRequest)
if err := ssh.Unmarshal(data, r); err != nil {
return nil, err
}
return r, nil
}
type WindowChangeRequest struct {
Columns uint32
Rows uint32
Width uint32
Height uint32
}
func ParseWindowChangeRequest(data []byte) (*WindowChangeRequest, error) {
r := new(WindowChangeRequest)
if err := ssh.Unmarshal(data, r); err != nil {
return nil, err
}
return r, nil
}