port_cfg_st.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef PORT_CFG_ST_H
  7. #define PORT_CFG_ST_H
  8. #include "core/or/entry_port_cfg_st.h"
  9. #include "core/or/server_port_cfg_st.h"
  10. /** Configuration for a single port that we're listening on. */
  11. struct port_cfg_t {
  12. tor_addr_t addr; /**< The actual IP to listen on, if !is_unix_addr. */
  13. int port; /**< The configured port, or CFG_AUTO_PORT to tell Tor to pick its
  14. * own port. */
  15. uint8_t type; /**< One of CONN_TYPE_*_LISTENER */
  16. unsigned is_unix_addr : 1; /**< True iff this is an AF_UNIX address. */
  17. unsigned is_group_writable : 1;
  18. unsigned is_world_writable : 1;
  19. unsigned relax_dirmode_check : 1;
  20. entry_port_cfg_t entry_cfg;
  21. server_port_cfg_t server_cfg;
  22. /* Unix sockets only: */
  23. /** Path for an AF_UNIX address */
  24. char unix_addr[FLEXIBLE_ARRAY_MEMBER];
  25. };
  26. #endif