forked from yankeguo-deprecated/bastion-ae6ab0f8
/
types.go
67 lines (56 loc) · 1.33 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package sshd
// this package contains SSH protocol specified constants and structures
// see https://www.iana.org/assignments/ssh-parameters/ssh-parameters.xhtml
// see https://tools.ietf.org/html/rfc4254
const (
ChannelTypeDirectTCPIP = "direct-tcpip"
ChannelTypeSession = "session"
RequestTypePtyReq = "pty-req"
RequestTypeX11Req = "x11-req"
RequestTypeEnv = "env"
RequestTypeShell = "shell"
RequestTypeExec = "exec"
RequestTypeSubsystem = "subsystem"
RequestTypeWindowChange = "window-change"
RequestTypeExitStatus = "exit-status"
)
const (
extKeyStage = "bastion-mode"
extKeyAccount = "bastion-account"
extKeyHostname = "bastion-hostname"
extKeyUser = "bastion-user"
extKeyAddress = "bastion-address"
stagePre = "pre"
stageLv1 = "lv1"
stageLv2 = "lv2"
)
type DirectTCPIPExtraData struct {
Host string
Port uint32
OriginatorIP string
OriginatorPort uint32
}
type PtyRequestPayload struct {
Term string
Cols uint32
Rows uint32
Width uint32
Height uint32
Modes string
}
type EnvRequestPayload struct {
Name string
Value string
}
type ExecRequestPayload struct {
Command string
}
type WindowChangeRequestPayload struct {
Cols uint32
Rows uint32
Width uint32
Height uint32
}
type ExitStatusRequestPayload struct {
Code uint32
}