tor  0.4.2.1-alpha-dev
ocirc_event.h
Go to the documentation of this file.
1 /* Copyright (c) 2007-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
9 #ifndef TOR_OCIRC_EVENT_H
10 #define TOR_OCIRC_EVENT_H
11 
12 #include <stdbool.h>
13 
14 #include "lib/cc/torint.h"
15 #include "lib/pubsub/pubsub.h"
16 
19 typedef enum circuit_status_event_t {
20  CIRC_EVENT_LAUNCHED = 0,
21  CIRC_EVENT_BUILT = 1,
22  CIRC_EVENT_EXTENDED = 2,
23  CIRC_EVENT_FAILED = 3,
24  CIRC_EVENT_CLOSED = 4,
26 
28 typedef struct ocirc_state_msg_t {
29  uint32_t gid;
30  int state;
31  bool onehop;
33 
34 DECLARE_MESSAGE(ocirc_state, ocirc_state, ocirc_state_msg_t *);
35 
44 typedef struct ocirc_chan_msg_t {
45  uint32_t gid;
46  uint64_t chan;
47  bool onehop;
49 
50 DECLARE_MESSAGE(ocirc_chan, ocirc_chan, ocirc_chan_msg_t *);
51 
57 typedef struct ocirc_cevent_msg_t {
58  uint32_t gid;
59  int evtype;
60  int reason;
61  bool onehop;
63 
64 DECLARE_MESSAGE(ocirc_cevent, ocirc_cevent, ocirc_cevent_msg_t *);
65 
66 #ifdef OCIRC_EVENT_PRIVATE
67 void ocirc_state_publish(ocirc_state_msg_t *msg);
68 void ocirc_chan_publish(ocirc_chan_msg_t *msg);
69 void ocirc_cevent_publish(ocirc_cevent_msg_t *msg);
70 #endif
71 
72 #endif /* !defined(TOR_OCIRC_EVENT_H) */
#define DECLARE_MESSAGE(messagename, typename, c_ptr_type)
Integer definitions used throughout Tor.
struct ocirc_state_msg_t ocirc_state_msg_t
struct ocirc_chan_msg_t ocirc_chan_msg_t
struct ocirc_cevent_msg_t ocirc_cevent_msg_t
Header for OO publish-subscribe functionality.
circuit_status_event_t
Definition: ocirc_event.h:19