def _ssh_options_set_long(ssh_session, type_, value): value_long = c_long(value) result = c_ssh_options_set(c_void_p(ssh_session), c_int(type_), cast(byref(value_long), c_void_p)) if result < 0: error = ssh_get_error(ssh_session) raise SshError("Could not set LONG option (%d) to (%d): %s" % (type_, value, error))
def _ssh_options_set_string(ssh_session, type_, value): assert issubclass(value.__class__, str) value_charp = c_char_p(bytify(value)) result = c_ssh_options_set(c_void_p(ssh_session), c_int(type_), cast(value_charp, c_void_p)) if result < 0: error = ssh_get_error(ssh_session) raise SshError("Could not set STRING option (%d) to [%s]: %s" % (type_, value, error))