Macros | Functions | Variables
ocirc_event.c File Reference

Publish state change messages for origin circuits. More...

#include "core/or/or.h"
#include "core/or/cpath_build_state_st.h"
#include "core/or/ocirc_event.h"
#include "core/or/or_sys.h"
#include "core/or/origin_circuit_st.h"
#include "lib/subsys/subsys.h"

Go to the source code of this file.


 DECLARE_PUBLISH (ocirc_state)
 DECLARE_PUBLISH (ocirc_chan)
 DECLARE_PUBLISH (ocirc_cevent)
static void ocirc_event_free (msg_aux_data_t u)
static char * ocirc_state_fmt (msg_aux_data_t u)
static char * ocirc_chan_fmt (msg_aux_data_t u)
static char * ocirc_cevent_fmt (msg_aux_data_t u)
int ocirc_add_pubsub (struct pubsub_connector_t *connector)
void ocirc_state_publish (ocirc_state_msg_t *msg)
void ocirc_chan_publish (ocirc_chan_msg_t *msg)
void ocirc_cevent_publish (ocirc_cevent_msg_t *msg)


static dispatch_typefns_t ocirc_state_fns
static dispatch_typefns_t ocirc_chan_fns
static dispatch_typefns_t ocirc_cevent_fns

Detailed Description

Publish state change messages for origin circuits.

Implements a basic publish-subscribe framework for messages about the state of origin circuits. The publisher calls the subscriber callback functions synchronously.

Although the synchronous calls might not simplify the call graph, this approach improves data isolation because the publisher doesn't need knowledge about the internals of subscribing subsystems. It also avoids race conditions that might occur in asynchronous frameworks.

Definition in file ocirc_event.c.

Variable Documentation

◆ ocirc_cevent_fns

dispatch_typefns_t ocirc_cevent_fns
Initial value:
= {
.free_fn = ocirc_event_free,
.fmt_fn = ocirc_cevent_fmt,

Definition at line 82 of file ocirc_event.c.

◆ ocirc_chan_fns

dispatch_typefns_t ocirc_chan_fns
Initial value:
= {
.free_fn = ocirc_event_free,
.fmt_fn = ocirc_chan_fmt,

Definition at line 77 of file ocirc_event.c.

◆ ocirc_state_fns

dispatch_typefns_t ocirc_state_fns
Initial value:
= {
.free_fn = ocirc_event_free,
.fmt_fn = ocirc_state_fmt,

Definition at line 72 of file ocirc_event.c.