#ifndef TOR_CONTROL_CMD_H
#define TOR_CONTROL_CMD_H
#include "lib/malloc/malloc.h"
int handle_control_command(control_connection_t *conn,
uint32_t cmd_data_len,
char *args);
void control_cmd_free_all(void);
typedef struct control_cmd_args_t control_cmd_args_t;
void control_cmd_args_free_(control_cmd_args_t *args);
void control_cmd_args_wipe(control_cmd_args_t *args);
#define control_cmd_args_free(v) \
FREE_AND_NULL(control_cmd_args_t, control_cmd_args_free_, (v))
typedef struct control_cmd_syntax_t {
unsigned int min_args;
unsigned int max_args;
bool accept_keywords;
const char **allowed_keywords;
unsigned kvline_flags;
bool want_cmddata;
bool store_raw_body;
} control_cmd_syntax_t;
#ifdef CONTROL_CMD_PRIVATE
#include "lib/crypt_ops/crypto_ed25519.h"
typedef union add_onion_secret_key_t {
crypto_pk_t *v2;
ed25519_secret_key_t *v3;
} add_onion_secret_key_t;
STATIC int add_onion_helper_keyarg(const char *arg, int discard_pk,
const char **key_new_alg_out,
char **key_new_blob_out,
add_onion_secret_key_t *decoded_key,
int *hs_version,
control_connection_t *conn);
STATIC rend_authorized_client_t *add_onion_helper_clientauth(const char *arg,
int *created, control_connection_t *conn);
STATIC control_cmd_args_t *control_cmd_parse_args(
const char *command,
const control_cmd_syntax_t *syntax,
size_t body_len,
const char *body,
char **error_out);
#endif
#ifdef CONTROL_MODULE_PRIVATE
smartlist_t * get_detached_onion_services(void);
#endif
#endif