control_proto.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_proto.h
  8. * \brief Header file for control_proto.c.
  9. **/
  10. #ifndef TOR_CONTROL_PROTO_H
  11. #define TOR_CONTROL_PROTO_H
  12. void connection_write_str_to_buf(const char *s, control_connection_t *conn);
  13. void connection_printf_to_buf(control_connection_t *conn,
  14. const char *format, ...)
  15. CHECK_PRINTF(2,3);
  16. size_t write_escaped_data(const char *data, size_t len, char **out);
  17. size_t read_escaped_data(const char *data, size_t len, char **out);
  18. void send_control_done(control_connection_t *conn);
  19. MOCK_DECL(void, control_write_reply, (control_connection_t *conn, int code,
  20. int c, const char *s));
  21. void control_vprintf_reply(control_connection_t *conn, int code, int c,
  22. const char *fmt, va_list ap)
  23. CHECK_PRINTF(4, 0);
  24. void control_write_endreply(control_connection_t *conn, int code,
  25. const char *s);
  26. void control_printf_endreply(control_connection_t *conn, int code,
  27. const char *fmt, ...)
  28. CHECK_PRINTF(3, 4);
  29. void control_write_midreply(control_connection_t *conn, int code,
  30. const char *s);
  31. void control_printf_midreply(control_connection_t *conn, int code,
  32. const char *fmt,
  33. ...)
  34. CHECK_PRINTF(3, 4);
  35. void control_write_datareply(control_connection_t *conn, int code,
  36. const char *s);
  37. void control_printf_datareply(control_connection_t *conn, int code,
  38. const char *fmt,
  39. ...)
  40. CHECK_PRINTF(3, 4);
  41. void control_write_data(control_connection_t *conn, const char *data);
  42. #endif /* !defined(TOR_CONTROL_PROTO_H) */