forked from ParallelSSH/ssh-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.pyx
More file actions
84 lines (74 loc) · 4.3 KB
/
options.pyx
File metadata and controls
84 lines (74 loc) · 4.3 KB
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
# This file is part of ssh-python.
# Copyright (C) 2018 Panos Kittenis
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, version 2.1.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-130
from c_ssh cimport ssh_options_e
cdef class Option:
"""Class for representing an SSH option."""
@staticmethod
cdef Option from_option(ssh_options_e option):
cdef Option _option = Option.__new__(Option)
_option._option = option
return _option
def __eq__(self, Option other):
return self._option == other._option
@property
def value(self):
return self._option
def __str__(self):
return str(self._option)
def __repr__(self):
return self.__str__()
# grep SSH_OPTIONS libssh/include/libssh/libssh.h | tr -d , | sed -E 's/SSH_OPTIONS_([A-Z0-9_]+)/\1 = Option.from_option(ssh_options_e.\0)/'
HOST = Option.from_option(ssh_options_e.SSH_OPTIONS_HOST)
PORT = Option.from_option(ssh_options_e.SSH_OPTIONS_PORT)
PORT_STR = Option.from_option(ssh_options_e.SSH_OPTIONS_PORT_STR)
FD = Option.from_option(ssh_options_e.SSH_OPTIONS_FD)
USER = Option.from_option(ssh_options_e.SSH_OPTIONS_USER)
SSH_DIR = Option.from_option(ssh_options_e.SSH_OPTIONS_SSH_DIR)
IDENTITY = Option.from_option(ssh_options_e.SSH_OPTIONS_IDENTITY)
ADD_IDENTITY = Option.from_option(ssh_options_e.SSH_OPTIONS_ADD_IDENTITY)
KNOWNHOSTS = Option.from_option(ssh_options_e.SSH_OPTIONS_KNOWNHOSTS)
TIMEOUT = Option.from_option(ssh_options_e.SSH_OPTIONS_TIMEOUT)
TIMEOUT_USEC = Option.from_option(ssh_options_e.SSH_OPTIONS_TIMEOUT_USEC)
SSH1 = Option.from_option(ssh_options_e.SSH_OPTIONS_SSH1)
SSH2 = Option.from_option(ssh_options_e.SSH_OPTIONS_SSH2)
LOG_VERBOSITY = Option.from_option(ssh_options_e.SSH_OPTIONS_LOG_VERBOSITY)
LOG_VERBOSITY_STR = Option.from_option(ssh_options_e.SSH_OPTIONS_LOG_VERBOSITY_STR)
CIPHERS_C_S = Option.from_option(ssh_options_e.SSH_OPTIONS_CIPHERS_C_S)
CIPHERS_S_C = Option.from_option(ssh_options_e.SSH_OPTIONS_CIPHERS_S_C)
COMPRESSION_C_S = Option.from_option(ssh_options_e.SSH_OPTIONS_COMPRESSION_C_S)
COMPRESSION_S_C = Option.from_option(ssh_options_e.SSH_OPTIONS_COMPRESSION_S_C)
PROXYCOMMAND = Option.from_option(ssh_options_e.SSH_OPTIONS_PROXYCOMMAND)
BINDADDR = Option.from_option(ssh_options_e.SSH_OPTIONS_BINDADDR)
STRICTHOSTKEYCHECK = Option.from_option(ssh_options_e.SSH_OPTIONS_STRICTHOSTKEYCHECK)
COMPRESSION = Option.from_option(ssh_options_e.SSH_OPTIONS_COMPRESSION)
COMPRESSION_LEVEL = Option.from_option(ssh_options_e.SSH_OPTIONS_COMPRESSION_LEVEL)
KEY_EXCHANGE = Option.from_option(ssh_options_e.SSH_OPTIONS_KEY_EXCHANGE)
HOSTKEYS = Option.from_option(ssh_options_e.SSH_OPTIONS_HOSTKEYS)
GSSAPI_SERVER_IDENTITY = Option.from_option(ssh_options_e.SSH_OPTIONS_GSSAPI_SERVER_IDENTITY)
GSSAPI_CLIENT_IDENTITY = Option.from_option(ssh_options_e.SSH_OPTIONS_GSSAPI_CLIENT_IDENTITY)
GSSAPI_DELEGATE_CREDENTIALS = Option.from_option(ssh_options_e.SSH_OPTIONS_GSSAPI_DELEGATE_CREDENTIALS)
HMAC_C_S = Option.from_option(ssh_options_e.SSH_OPTIONS_HMAC_C_S)
HMAC_S_C = Option.from_option(ssh_options_e.SSH_OPTIONS_HMAC_S_C)
PASSWORD_AUTH = Option.from_option(ssh_options_e.SSH_OPTIONS_PASSWORD_AUTH)
PUBKEY_AUTH = Option.from_option(ssh_options_e.SSH_OPTIONS_PUBKEY_AUTH)
KBDINT_AUTH = Option.from_option(ssh_options_e.SSH_OPTIONS_KBDINT_AUTH)
GSSAPI_AUTH = Option.from_option(ssh_options_e.SSH_OPTIONS_GSSAPI_AUTH)
GLOBAL_KNOWNHOSTS = Option.from_option(ssh_options_e.SSH_OPTIONS_GLOBAL_KNOWNHOSTS)
NODELAY = Option.from_option(ssh_options_e.SSH_OPTIONS_NODELAY)
PUBLICKEY_ACCEPTED_TYPES = Option.from_option(ssh_options_e.SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES)
PROCESS_CONFIG = Option.from_option(ssh_options_e.SSH_OPTIONS_PROCESS_CONFIG)
REKEY_DATA = Option.from_option(ssh_options_e.SSH_OPTIONS_REKEY_DATA)
REKEY_TIME = Option.from_option(ssh_options_e.SSH_OPTIONS_REKEY_TIME)