mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge ocirc and orconn events into or subsystem.
Pubsub events are not supposed to have their own subsystems; they're supposed to be part of a parent subsystem.
This commit is contained in:
@@ -14,9 +14,7 @@
|
||||
#include "lib/cc/torint.h"
|
||||
|
||||
#include "core/mainloop/mainloop_sys.h"
|
||||
#include "core/or/ocirc_event_sys.h"
|
||||
#include "core/or/or_sys.h"
|
||||
#include "core/or/orconn_event_sys.h"
|
||||
#include "feature/control/btrack_sys.h"
|
||||
#include "lib/compress/compress_sys.h"
|
||||
#include "lib/crypt_ops/crypto_sys.h"
|
||||
@@ -61,8 +59,6 @@ const subsys_fns_t *tor_subsystems[] = {
|
||||
|
||||
&sys_mainloop,
|
||||
&sys_or,
|
||||
&sys_orconn_event,
|
||||
&sys_ocirc_event,
|
||||
|
||||
&sys_relay,
|
||||
|
||||
|
||||
@@ -74,13 +74,11 @@ noinst_HEADERS += \
|
||||
src/core/or/or_periodic.h \
|
||||
src/core/or/or_sys.h \
|
||||
src/core/or/orconn_event.h \
|
||||
src/core/or/orconn_event_sys.h \
|
||||
src/core/or/or_circuit_st.h \
|
||||
src/core/or/or_connection_st.h \
|
||||
src/core/or/or_handshake_certs_st.h \
|
||||
src/core/or/or_handshake_state_st.h \
|
||||
src/core/or/ocirc_event.h \
|
||||
src/core/or/ocirc_event_sys.h \
|
||||
src/core/or/origin_circuit_st.h \
|
||||
src/core/or/policies.h \
|
||||
src/core/or/port_cfg_st.h \
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "core/or/cpath_build_state_st.h"
|
||||
#include "core/or/ocirc_event.h"
|
||||
#include "core/or/ocirc_event_sys.h"
|
||||
#include "core/or/or_sys.h"
|
||||
#include "core/or/origin_circuit_st.h"
|
||||
#include "lib/subsys/subsys.h"
|
||||
|
||||
@@ -84,7 +84,7 @@ static dispatch_typefns_t ocirc_cevent_fns = {
|
||||
.fmt_fn = ocirc_cevent_fmt,
|
||||
};
|
||||
|
||||
static int
|
||||
int
|
||||
ocirc_add_pubsub(struct pubsub_connector_t *connector)
|
||||
{
|
||||
if (DISPATCH_REGISTER_TYPE(connector, ocirc_state, ô_state_fns))
|
||||
@@ -119,10 +119,3 @@ ocirc_cevent_publish(ocirc_cevent_msg_t *msg)
|
||||
{
|
||||
PUBLISH(ocirc_cevent, msg);
|
||||
}
|
||||
|
||||
const subsys_fns_t sys_ocirc_event = {
|
||||
.name = "ocirc_event",
|
||||
.supported = true,
|
||||
.level = 22,
|
||||
.add_pubsub = ocirc_add_pubsub,
|
||||
};
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/* Copyright (c) 2007-2020, The Tor Project, Inc. */
|
||||
|
||||
/**
|
||||
* \file ocirc_event_sys.h
|
||||
* \brief Declare subsystem object for the origin circuit event module.
|
||||
**/
|
||||
|
||||
#ifndef TOR_OCIRC_EVENT_SYS_H
|
||||
#define TOR_OCIRC_EVENT_SYS_H
|
||||
|
||||
extern const struct subsys_fns_t sys_ocirc_event;
|
||||
|
||||
#endif /* !defined(TOR_OCIRC_EVENT_SYS_H) */
|
||||
@@ -34,10 +34,22 @@ subsys_or_shutdown(void)
|
||||
policies_free_all();
|
||||
}
|
||||
|
||||
static int
|
||||
subsys_or_add_pubsub(struct pubsub_connector_t *connector)
|
||||
{
|
||||
int rv = 0;
|
||||
if (orconn_add_pubsub(connector) < 0)
|
||||
rv = -1;
|
||||
if (ocirc_add_pubsub(connector) < 0)
|
||||
rv = -1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
const struct subsys_fns_t sys_or = {
|
||||
.name = "or",
|
||||
.supported = true,
|
||||
.level = 20,
|
||||
.initialize = subsys_or_initialize,
|
||||
.shutdown = subsys_or_shutdown,
|
||||
.add_pubsub = subsys_or_add_pubsub,
|
||||
};
|
||||
|
||||
@@ -14,4 +14,8 @@
|
||||
|
||||
extern const struct subsys_fns_t sys_or;
|
||||
|
||||
struct pubsub_connector_t;
|
||||
int ocirc_add_pubsub(struct pubsub_connector_t *connector);
|
||||
int orconn_add_pubsub(struct pubsub_connector_t *connector);
|
||||
|
||||
#endif /* !defined(TOR_CORE_OR_OR_SYS_H) */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#define ORCONN_EVENT_PRIVATE
|
||||
#include "core/or/orconn_event.h"
|
||||
#include "core/or/orconn_event_sys.h"
|
||||
#include "core/or/or_sys.h"
|
||||
|
||||
DECLARE_PUBLISH(orconn_state);
|
||||
DECLARE_PUBLISH(orconn_status);
|
||||
@@ -65,7 +65,7 @@ static dispatch_typefns_t orconn_status_fns = {
|
||||
.fmt_fn = orconn_status_fmt,
|
||||
};
|
||||
|
||||
static int
|
||||
int
|
||||
orconn_add_pubsub(struct pubsub_connector_t *connector)
|
||||
{
|
||||
if (DISPATCH_REGISTER_TYPE(connector, orconn_state, &orconn_state_fns))
|
||||
@@ -90,10 +90,3 @@ orconn_status_publish(orconn_status_msg_t *msg)
|
||||
{
|
||||
PUBLISH(orconn_status, msg);
|
||||
}
|
||||
|
||||
const subsys_fns_t sys_orconn_event = {
|
||||
.name = "orconn_event",
|
||||
.supported = true,
|
||||
.level = 22,
|
||||
.add_pubsub = orconn_add_pubsub,
|
||||
};
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/* Copyright (c) 2007-2020, The Tor Project, Inc. */
|
||||
|
||||
/**
|
||||
* \file orconn_event_sys.h
|
||||
* \brief Declare subsystem object for the OR connection event module.
|
||||
**/
|
||||
#ifndef TOR_ORCONN_EVENT_SYS_H
|
||||
#define TOR_ORCONN_EVENT_SYS_H
|
||||
|
||||
extern const struct subsys_fns_t sys_orconn_event;
|
||||
|
||||
#endif /* !defined(TOR_ORCONN_EVENT_SYS_H) */
|
||||
Reference in New Issue
Block a user