-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathconst.go
223 lines (200 loc) · 7.64 KB
/
const.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
package libssh
/*
#cgo pkg-config: libssh
#include <libssh/libssh.h>
*/
import "C"
const (
// the offsets of methods
SSH_KEX = C.SSH_KEX
SSH_HOSTKEYS = C.SSH_HOSTKEYS
SSH_CRYPT_C_S = C.SSH_CRYPT_C_S
SSH_CRYPT_S_C = C.SSH_CRYPT_S_C
SSH_MAC_C_S = C.SSH_MAC_C_S
SSH_MAC_S_C = C.SSH_MAC_S_C
SSH_COMP_C_S = C.SSH_COMP_C_S
SSH_COMP_S_C = C.SSH_COMP_S_C
SSH_LANG_C_S = C.SSH_LANG_C_S
SSH_LANG_S_C = C.SSH_LANG_S_C
)
const (
SSH_CRYPT = 2
SSH_MAC = 3
SSH_COMP = 4
SSH_LANG = 5
)
const (
SSH_AUTH_SUCCESS = C.SSH_AUTH_SUCCESS
SSH_AUTH_DENIED = C.SSH_AUTH_DENIED
SSH_AUTH_PARTIAL = C.SSH_AUTH_PARTIAL
SSH_AUTH_INFO = C.SSH_AUTH_INFO
SSH_AUTH_AGAIN = C.SSH_AUTH_AGAIN
SSH_AUTH_ERROR = C.SSH_AUTH_ERROR
)
const (
// auth flags
SSH_AUTH_METHOD_UNKNOWN = 0
SSH_AUTH_METHOD_NONE = 0x0001
SSH_AUTH_METHOD_PASSWORD = 0x0002
SSH_AUTH_METHOD_PUBLICKEY = 0x0004
SSH_AUTH_METHOD_HOSTBASED = 0x0008
SSH_AUTH_METHOD_INTERACTIVE = 0x0010
SSH_AUTH_METHOD_GSSAPI_MIC = 0x0020
)
const (
// messages
SSH_REQUEST_AUTH = C.SSH_REQUEST_AUTH
SSH_REQUEST_CHANNEL_OPEN = C.SSH_REQUEST_CHANNEL_OPEN
SSH_REQUEST_CHANNEL = C.SSH_REQUEST_CHANNEL
SSH_REQUEST_SERVICE = C.SSH_REQUEST_SERVICE
SSH_REQUEST_GLOBAL = C.SSH_REQUEST_GLOBAL
)
const (
SSH_CHANNEL_UNKNOWN = C.SSH_CHANNEL_UNKNOWN
SSH_CHANNEL_SESSION = C.SSH_CHANNEL_SESSION
SSH_CHANNEL_DIRECT_TCPIP = C.SSH_CHANNEL_DIRECT_TCPIP
SSH_CHANNEL_FORWARDED_TCPIP = C.SSH_CHANNEL_FORWARDED_TCPIP
SSH_CHANNEL_X11 = C.SSH_CHANNEL_X11
SSH_CHANNEL_AUTH_AGENT = C.SSH_CHANNEL_AUTH_AGENT
)
const (
SSH_CHANNEL_REQUEST_UNKNOWN = C.SSH_CHANNEL_REQUEST_UNKNOWN
SSH_CHANNEL_REQUEST_PTY = C.SSH_CHANNEL_REQUEST_PTY
SSH_CHANNEL_REQUEST_EXEC = C.SSH_CHANNEL_REQUEST_EXEC
SSH_CHANNEL_REQUEST_SHELL = C.SSH_CHANNEL_REQUEST_SHELL
SSH_CHANNEL_REQUEST_ENV = C.SSH_CHANNEL_REQUEST_ENV
SSH_CHANNEL_REQUEST_SUBSYSTEM = C.SSH_CHANNEL_REQUEST_SUBSYSTEM
SSH_CHANNEL_REQUEST_WINDOW_CHANGE = C.SSH_CHANNEL_REQUEST_WINDOW_CHANGE
SSH_CHANNEL_REQUEST_X11 = C.SSH_CHANNEL_REQUEST_X11
)
const (
SSH_GLOBAL_REQUEST_UNKNOWN = C.SSH_GLOBAL_REQUEST_UNKNOWN
SSH_GLOBAL_REQUEST_TCPIP_FORWARD = C.SSH_GLOBAL_REQUEST_TCPIP_FORWARD
SSH_GLOBAL_REQUEST_CANCEL_TCPIP_FORWARD = C.SSH_GLOBAL_REQUEST_CANCEL_TCPIP_FORWARD
SSH_GLOBAL_REQUEST_KEEPALIVE = C.SSH_GLOBAL_REQUEST_KEEPALIVE
)
const (
SSH_PUBLICKEY_STATE_ERROR = C.SSH_PUBLICKEY_STATE_ERROR
SSH_PUBLICKEY_STATE_NONE = C.SSH_PUBLICKEY_STATE_NONE
SSH_PUBLICKEY_STATE_VALID = C.SSH_PUBLICKEY_STATE_VALID
SSH_PUBLICKEY_STATE_WRONG = C.SSH_PUBLICKEY_STATE_WRONG
)
const (
// Status flags
SSH_CLOSED = 0x01 // Socket is closed
SSH_READ_PENDING = 0x02 // Reading to socket won't block
SSH_CLOSED_ERROR = 0x04 // Session was closed due to an error
SSH_WRITE_PENDING = 0x08 // Output buffer not empty
)
const (
SSH_SERVER_ERROR = C.SSH_SERVER_ERROR
SSH_SERVER_NOT_KNOWN = C.SSH_SERVER_NOT_KNOWN
SSH_SERVER_KNOWN_OK = C.SSH_SERVER_KNOWN_OK
SSH_SERVER_KNOWN_CHANGED = C.SSH_SERVER_KNOWN_CHANGED
SSH_SERVER_FOUND_OTHER = C.SSH_SERVER_FOUND_OTHER
SSH_SERVER_FILE_NOT_FOUND = C.SSH_SERVER_FILE_NOT_FOUND
)
const (
MD5_DIGEST_LEN = 16
)
const (
// errors
SSH_NO_ERROR = C.SSH_NO_ERROR
SSH_REQUEST_DENIED = C.SSH_REQUEST_DENIED
SSH_FATAL = C.SSH_FATAL
SSH_EINTR = C.SSH_EINTR
)
const (
SSH_KEYTYPE_UNKNOWN = C.SSH_KEYTYPE_UNKNOWN
SSH_KEYTYPE_DSS = C.SSH_KEYTYPE_DSS
SSH_KEYTYPE_RSA = C.SSH_KEYTYPE_RSA
SSH_KEYTYPE_RSA1 = C.SSH_KEYTYPE_RSA1
SSH_KEYTYPE_ECDSA = C.SSH_KEYTYPE_ECDSA
SSH_KEYTYPE_ED25519 = C.SSH_KEYTYPE_ED25519
SSH_KEYTYPE_DSS_CERT01 = C.SSH_KEYTYPE_DSS_CERT01
SSH_KEYTYPE_RSA_CERT01 = C.SSH_KEYTYPE_RSA_CERT01
)
const (
// some types for keys
SSH_KEY_CMP_PUBLIC = C.SSH_KEY_CMP_PUBLIC
SSH_KEY_CMP_PRIVATE = C.SSH_KEY_CMP_PRIVATE
)
const (
// Error return codes
SSH_OK = 0 /* No error */
SSH_ERROR = -1 /* Error of some kind */
SSH_AGAIN = -2 /* The nonblocking call must be repeated */
SSH_EOF = -127 /* We have already a eof */
)
const (
SSH_LOG_NOLOG = C.SSH_LOG_NOLOG // No logging at all
SSH_LOG_WARNING = C.SSH_LOG_WARNING // Only warnings
SSH_LOG_PROTOCOL = C.SSH_LOG_PROTOCOL // High level protocol information
SSH_LOG_PACKET = C.SSH_LOG_PACKET // Lower level protocol infomations, packet level
SSH_LOG_FUNCTIONS = C.SSH_LOG_FUNCTIONS // Every function path
SSH_LOG_RARE = SSH_LOG_WARNING
)
const (
// log levels
SSH_LOG_NONE = 0 //
SSH_LOG_WARN = 1 // Show only warnings
SSH_LOG_INFO = 2 // Get some information what's going on
SSH_LOG_DEBUG = 3 // Get detailed debuging information
SSH_LOG_TRACE = 4 // Get trace output, packet information, ...
)
const (
SSH_OPTIONS_HOST = C.SSH_OPTIONS_HOST
SSH_OPTIONS_PORT = C.SSH_OPTIONS_PORT
SSH_OPTIONS_PORT_STR = C.SSH_OPTIONS_PORT_STR
SSH_OPTIONS_FD = C.SSH_OPTIONS_FD
SSH_OPTIONS_USER = C.SSH_OPTIONS_USER
SSH_OPTIONS_SSH_DIR = C.SSH_OPTIONS_SSH_DIR
SSH_OPTIONS_IDENTITY = C.SSH_OPTIONS_IDENTITY
SSH_OPTIONS_ADD_IDENTITY = C.SSH_OPTIONS_ADD_IDENTITY
SSH_OPTIONS_KNOWNHOSTS = C.SSH_OPTIONS_KNOWNHOSTS
SSH_OPTIONS_TIMEOUT = C.SSH_OPTIONS_TIMEOUT
SSH_OPTIONS_TIMEOUT_USEC = C.SSH_OPTIONS_TIMEOUT_USEC
SSH_OPTIONS_SSH1 = C.SSH_OPTIONS_SSH1
SSH_OPTIONS_SSH2 = C.SSH_OPTIONS_SSH2
SSH_OPTIONS_LOG_VERBOSITY = C.SSH_OPTIONS_LOG_VERBOSITY
SSH_OPTIONS_LOG_VERBOSITY_STR = C.SSH_OPTIONS_LOG_VERBOSITY_STR
SSH_OPTIONS_CIPHERS_C_S = C.SSH_OPTIONS_CIPHERS_C_S
SSH_OPTIONS_CIPHERS_S_C = C.SSH_OPTIONS_CIPHERS_S_C
SSH_OPTIONS_COMPRESSION_C_S = C.SSH_OPTIONS_COMPRESSION_C_S
SSH_OPTIONS_COMPRESSION_S_C = C.SSH_OPTIONS_COMPRESSION_S_C
SSH_OPTIONS_PROXYCOMMAND = C.SSH_OPTIONS_PROXYCOMMAND
SSH_OPTIONS_BINDADDR = C.SSH_OPTIONS_BINDADDR
SSH_OPTIONS_STRICTHOSTKEYCHECK = C.SSH_OPTIONS_STRICTHOSTKEYCHECK
SSH_OPTIONS_COMPRESSION = C.SSH_OPTIONS_COMPRESSION
SSH_OPTIONS_COMPRESSION_LEVEL = C.SSH_OPTIONS_COMPRESSION_LEVEL
SSH_OPTIONS_KEY_EXCHANGE = C.SSH_OPTIONS_KEY_EXCHANGE
SSH_OPTIONS_HOSTKEYS = C.SSH_OPTIONS_HOSTKEYS
SSH_OPTIONS_GSSAPI_SERVER_IDENTITY = C.SSH_OPTIONS_GSSAPI_SERVER_IDENTITY
SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY = C.SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY
SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS = C.SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS
SSH_OPTIONS_HMAC_C_S = C.SSH_OPTIONS_HMAC_C_S
SSH_OPTIONS_HMAC_S_C = C.SSH_OPTIONS_HMAC_S_C
)
const (
/** Code is going to write/create remote files */
SSH_SCP_WRITE = C.SSH_SCP_WRITE
/** Code is going to read remote files */
SSH_SCP_READ = C.SSH_SCP_READ
SSH_SCP_RECURSIVE = C.SSH_SCP_RECURSIVE
)
const (
/** A new directory is going to be pulled */
SSH_SCP_REQUEST_NEWDIR = C.SSH_SCP_REQUEST_NEWDIR
/** A new file is going to be pulled */
SSH_SCP_REQUEST_NEWFILE = C.SSH_SCP_REQUEST_NEWFILE
/** End of requests */
SSH_SCP_REQUEST_EOF = C.SSH_SCP_REQUEST_EOF
/** End of directory */
SSH_SCP_REQUEST_ENDDIR = C.SSH_SCP_REQUEST_ENDDIR
/** Warning received */
SSH_SCP_REQUEST_WARNING = C.SSH_SCP_REQUEST_WARNING
)
const (
SSH_PUBLICKEY_HASH_SHA1 = C.SSH_PUBLICKEY_HASH_SHA1
SSH_PUBLICKEY_HASH_MD5 = C.SSH_PUBLICKEY_HASH_MD5
)