aboutsummaryrefslogtreecommitdiff
path: root/src/lib/pubsub/pub_binding_st.h
blob: d7c562fc35e2896d448f1a8331cf80bd49b6b2aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* Copyright (c) 2001, Matej Pfajfar.
 * Copyright (c) 2001-2004, Roger Dingledine.
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
 * Copyright (c) 2007-2020, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * @file pub_binding_st.h
 * @brief Declaration of pub_binding_t.
 *
 * This is an internal type for the pubsub implementation.
 */

#ifndef TOR_PUB_BINDING_ST_H
#define TOR_PUB_BINDING_ST_H

#include "lib/dispatch/msgtypes.h"
struct dispatch_t;

/**
 * A pub_binding_t is an opaque object that subsystems use to publish
 * messages.  The DISPATCH_ADD_PUB*() macros set it up.
 **/
typedef struct pub_binding_t {
  /**
   * A pointer to a configured dispatch_t object.  This is filled in
   * when the dispatch_t is finally constructed.
   **/
  struct dispatch_t *dispatch_ptr;
  /**
   * A template for the msg_t fields that are filled in for this message.
   * This is copied into outgoing messages, ensuring that their fields are set
   * corretly.
   **/
  msg_t msg_template;
} pub_binding_t;

#endif /* !defined(TOR_PUB_BINDING_ST_H) */