control_cmd_args_st.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2019, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file control_cmd_args_st.h
  8. * \brief Definition for control_cmd_args_t
  9. **/
  10. #ifndef TOR_CONTROL_CMD_ST_H
  11. #define TOR_CONTROL_CMD_ST_H
  12. struct smartlist_t;
  13. struct config_line_t;
  14. /**
  15. * Parsed arguments for a control command.
  16. *
  17. * WORK IN PROGRESS: This structure is going to get more complex as this
  18. * branch goes on.
  19. **/
  20. struct control_cmd_args_t {
  21. /**
  22. * The command itself, as provided by the controller. Not owned by this
  23. * structure.
  24. **/
  25. const char *command;
  26. /**
  27. * Positional arguments to the command.
  28. **/
  29. struct smartlist_t *args;
  30. /**
  31. * Keyword arguments to the command.
  32. **/
  33. struct config_line_t *kwargs;
  34. /**
  35. * Number of bytes in <b>cmddata</b>; 0 if <b>cmddata</b> is not set.
  36. **/
  37. size_t cmddata_len;
  38. /**
  39. * A multiline object passed with this command.
  40. **/
  41. char *cmddata;
  42. /**
  43. * If set, a nul-terminated string containing the raw unparsed arguments.
  44. **/
  45. const char *raw_body;
  46. };
  47. #endif /* !defined(TOR_CONTROL_CMD_ST_H) */