Tor 0.4.9.0-alpha-dev
Data Fields
control_cmd_syntax_t Struct Reference

#include <control_cmd.h>

Data Fields

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
 

Detailed Description

Definition for the syntax of a controller command, as parsed by control_cmd_parse_args.

WORK IN PROGRESS: This structure is going to get more complex as this branch goes on.

Definition at line 36 of file control_cmd.h.

Field Documentation

◆ accept_keywords

bool accept_keywords

If true, we should parse options after the positional arguments as a set of unordered flags and key=value arguments.

Requires that max_args is not UINT_MAX.

Definition at line 53 of file control_cmd.h.

◆ allowed_keywords

const char** allowed_keywords

If accept_keywords is true, then only the keywords listed in this (NULL-terminated) array are valid keywords for this command.

Definition at line 58 of file control_cmd.h.

Referenced by kvline_check_keyword_args().

◆ kvline_flags

unsigned kvline_flags

If accept_keywords is true, this option is passed to kvline_parse() as its flags.

Definition at line 63 of file control_cmd.h.

◆ max_args

unsigned int max_args

Highest number of positional arguments that this command accepts. UINT_MAX for no limit.

Definition at line 46 of file control_cmd.h.

◆ min_args

unsigned int min_args

Lowest number of positional arguments that this command accepts. 0 for "it's okay not to have positional arguments."

Definition at line 41 of file control_cmd.h.

◆ store_raw_body

bool store_raw_body

True iff this command needs access to the raw body of the input.

This should not be needed for pure commands; it is purely a legacy option.

Definition at line 74 of file control_cmd.h.

◆ want_cmddata

bool want_cmddata

True iff this command wants to be followed by a multiline object.

Definition at line 67 of file control_cmd.h.


The documentation for this struct was generated from the following file: