tor  0.4.2.1-alpha-dev
dispatch_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_DISPATCH_ST_H
14 #define TOR_DISPATCH_ST_H
15 
16 #ifdef DISPATCH_PRIVATE
17 
19 
23 typedef struct dispatch_rcv_t {
25  subsys_id_t sys;
27  bool enabled;
29  recv_fn_t fn;
30 } dispatch_rcv_t;
31 
39 typedef struct dtbl_entry_t {
44  uint16_t n_enabled;
46  channel_id_t channel;
48  msg_type_id_t type;
52  uint16_t n_fns;
56  dispatch_rcv_t rcv[FLEXIBLE_ARRAY_MEMBER];
57 } dtbl_entry_t;
58 
62 typedef struct dqueue_t {
64  TOR_SIMPLEQ_HEAD( , msg_t) queue;
66  dispatch_alertfn_t alert_fn;
68  void *alert_fn_arg;
69 } dqueue_t ;
70 
74 struct dispatch_t {
79  size_t n_msgs;
84  size_t n_queues;
89  size_t n_types;
93  dqueue_t *queues;
98  dtbl_entry_t **table;
103  dispatch_typefns_t *typefns;
104 };
105 
106 #endif /* defined(DISPATCH_PRIVATE) */
107 
108 #endif /* !defined(TOR_DISPATCH_ST_H) */
Header for smartlist.c.
struct dispatch_t dispatch_t
Definition: dispatch.h:53
Definition: msgtypes.h:50
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
void(* dispatch_alertfn_t)(struct dispatch_t *, channel_id_t, void *)
Definition: dispatch.h:98