pub_binding_st.h 991 B

123456789101112131415161718192021222324252627282930313233343536
  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-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * @file pubsub_build.h
  8. * @brief Declaration of pub_binding_t.
  9. */
  10. #ifndef TOR_PUB_BINDING_ST_H
  11. #define TOR_PUB_BINDING_ST_H
  12. #include "lib/dispatch/msgtypes.h"
  13. struct dispatch_t;
  14. /**
  15. * A pub_binding_t is an opaque object that subsystems use to publish
  16. * messages. The DISPATCH_ADD_PUB*() macros set it up.
  17. **/
  18. typedef struct pub_binding_t {
  19. /**
  20. * A pointer to a configured dispatch_t object. This is filled in
  21. * when the dispatch_t is finally constructed.
  22. **/
  23. struct dispatch_t *dispatch_ptr;
  24. /**
  25. * A template for the msg_t fields that are filled in for this message.
  26. * This is copied into outgoing messages, ensuring that their fields are set
  27. * corretly.
  28. **/
  29. msg_t msg_template;
  30. } pub_binding_t;
  31. #endif