+ goto err_out;
+ ct->status = CL_CONNECTED;
+ ct->btrn = btr_new_node(&(struct btr_node_description)
+ EMBRACE(.name = "client", .parent = parent, .child = child));
+ ct->task.pre_select = client_pre_select;
+ ct->task.post_select = client_post_select;
+ ct->task.error = 0;
+ sprintf(ct->task.status, "client");
+ register_task(s, &ct->task);
+ return 1;
+err_out:
+ close(ct->scc.fd);
+ ct->scc.fd = -1;
+ return ret;
+}
+
+/**
+ * Parse a client configuration.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ * \param ct_ptr Filled in by this function.
+ * \param loglevel If not \p NULL, the number of the loglevel is stored here.
+ *
+ * This checks the command line options given by \a argc and \a argv, sets
+ * default values for the user name and the name of the rsa key file and reads
+ * further options from the config file.
+ *
+ * Upon successful return, \a ct_ptr points to a dynamically allocated and
+ * initialized client task struct.
+ *
+ * \return The number of non-option arguments in \a argc/argv on success,
+ * negative on errors.
+ */
+int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr,
+ int *loglevel)
+{
+ char *home = para_homedir();
+ int ret;
+ struct client_task *ct = para_calloc(sizeof(struct client_task));
+
+ *ct_ptr = ct;
+ ct->scc.fd = -1;
+ ret = -E_CLIENT_SYNTAX;
+ if (client_cmdline_parser(argc, argv, &ct->conf))