tor  0.4.2.1-alpha-dev
pubsub_builder_st.h
Go to the documentation of this file.
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 
13 #ifndef TOR_PUBSUB_BUILDER_ST_H
14 #define TOR_PUBSUB_BUILDER_ST_H
15 
16 #ifdef PUBSUB_PRIVATE
17 
18 #include <stdbool.h>
19 #include <stddef.h>
20 
21 struct dispatch_cfg_t;
22 struct smartlist_t;
23 struct pub_binding_t;
24 
34 typedef struct pubsub_cfg_t {
36  bool is_publish;
38  subsys_id_t subsys;
40  channel_id_t channel;
42  message_id_t msg;
44  msg_type_id_t type;
46  unsigned flags;
47 
53  struct pub_binding_t *pub_binding;
54 
58  recv_fn_t recv_fn;
59 
61  const char *added_by_file;
63  unsigned added_by_line;
64 } pubsub_cfg_t;
65 
72 typedef struct pubsub_type_cfg_t {
76  msg_type_id_t type;
81 
83  subsys_id_t subsys;
85  const char *added_by_file;
87  unsigned added_by_line;
88 } pubsub_type_cfg_t;
89 
94 struct pubsub_items_t {
96  struct smartlist_t *items;
98  struct smartlist_t *type_items;
99 };
100 
106 struct pubsub_builder_t {
109  int n_connectors;
111  int n_errors;
114  struct pubsub_items_t *items;
117  struct dispatch_cfg_t *cfg;
118 };
119 
125 struct pubsub_connector_t {
127  struct pubsub_builder_t *builder;
129  subsys_id_t subsys_id;
130 };
131 
136 typedef struct pubsub_adjmap_t {
137  /* XXXX The next three fields are currently constructed but not yet
138  * XXXX used. I believe we'll want them in the future, though. -nickm
139  */
141  size_t n_subsystems;
144  struct smartlist_t **pub_by_subsys;
147  struct smartlist_t **sub_by_subsys;
148 
150  size_t n_msgs;
153  struct smartlist_t **pub_by_msg;
156  struct smartlist_t **sub_by_msg;
157 } pubsub_adjmap_t;
158 
159 #endif /* defined(PUBSUB_PRIVATE) */
160 
161 #endif /* !defined(TOR_PUBSUB_BUILDER_ST_H) */
struct pubsub_connector_t pubsub_connector_t
struct pubsub_builder_t pubsub_builder_t
Definition: pubsub_build.h:28
struct pubsub_items_t pubsub_items_t
Definition: pubsub_build.h:35
uint16_t msg_type_id_t
Definition: msgtypes.h:29
uint16_t subsys_id_t
Definition: msgtypes.h:22
void(* recv_fn_t)(const msg_t *m)
Definition: msgtypes.h:66