diff options
author | friendly73 <friendly73@x.x> | 2023-03-21 14:25:57 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-05-25 11:03:35 -0400 |
commit | 1899b6230d62a185f3f126e34f4896237190cf36 (patch) | |
tree | 6095f35b895bdda8fb3df9d38720585e2453aebf /src/feature/rend/rendmid.c | |
parent | 2f8a88448d9a75737a60a204127eb697891ec112 (diff) | |
download | tor-1899b6230d62a185f3f126e34f4896237190cf36.tar.gz tor-1899b6230d62a185f3f126e34f4896237190cf36.zip |
Removed getter abstraction and moved from rephist to relay_metrics.
Diffstat (limited to 'src/feature/rend/rendmid.c')
-rw-r--r-- | src/feature/rend/rendmid.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/feature/rend/rendmid.c b/src/feature/rend/rendmid.c index e234332a54..e95087bd6f 100644 --- a/src/feature/rend/rendmid.c +++ b/src/feature/rend/rendmid.c @@ -19,7 +19,7 @@ #include "feature/hs/hs_circuitmap.h" #include "feature/hs/hs_dos.h" #include "feature/hs/hs_intropoint.h" -#include "feature/stats/rephist.h" +#include "feature/relay/relay_metrics.h" #include "core/or/or_circuit_st.h" @@ -37,7 +37,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, (unsigned)circ->p_circ_id); if (circ->base_.purpose != CIRCUIT_PURPOSE_OR) { - rep_hist_note_est_rend_action(EST_REND_UNSUITABLE_CIRCUIT); + increment_est_rend_action(EST_REND_UNSUITABLE_CIRCUIT); log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Tried to establish rendezvous on non-OR circuit with purpose %s", circuit_purpose_to_string(circ->base_.purpose)); @@ -48,7 +48,7 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, * attempt to establish rendezvous points directly to us. */ if (channel_is_client(circ->p_chan) && dos_should_refuse_single_hop_client()) { - rep_hist_note_est_rend_action(EST_REND_SINGLE_HOP); + increment_est_rend_action(EST_REND_SINGLE_HOP); /* Note it down for the heartbeat log purposes. */ dos_note_refuse_single_hop_client(); /* Silent drop so the client has to time out before moving on. */ @@ -56,21 +56,21 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, } if (circ->base_.n_chan) { - rep_hist_note_est_rend_action(EST_REND_UNSUITABLE_CIRCUIT); + increment_est_rend_action(EST_REND_UNSUITABLE_CIRCUIT); log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Tried to establish rendezvous on non-edge circuit"); goto err; } if (request_len != REND_COOKIE_LEN) { - rep_hist_note_est_rend_action(EST_REND_MALFORMED); + increment_est_rend_action(EST_REND_MALFORMED); log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Invalid length on ESTABLISH_RENDEZVOUS."); goto err; } if (hs_circuitmap_get_rend_circ_relay_side(request)) { - rep_hist_note_est_rend_action(EST_REND_DUPLICATE_COOKIE); + increment_est_rend_action(EST_REND_DUPLICATE_COOKIE); log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Duplicate rendezvous cookie in ESTABLISH_RENDEZVOUS."); goto err; @@ -80,13 +80,13 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const uint8_t *request, if (relay_send_command_from_edge(0,TO_CIRCUIT(circ), RELAY_COMMAND_RENDEZVOUS_ESTABLISHED, "", 0, NULL)<0) { - rep_hist_note_est_rend_action(EST_REND_CIRCUIT_DEAD); + increment_est_rend_action(EST_REND_CIRCUIT_DEAD); log_warn(LD_PROTOCOL, "Couldn't send RENDEZVOUS_ESTABLISHED cell."); /* Stop right now, the circuit has been closed. */ return -1; } - rep_hist_note_est_rend_action(EST_REND_SUCCESS); + increment_est_rend_action(EST_REND_SUCCESS); circuit_change_purpose(TO_CIRCUIT(circ), CIRCUIT_PURPOSE_REND_POINT_WAITING); hs_circuitmap_register_rend_circ_relay_side(circ, request); @@ -116,7 +116,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, int reason = END_CIRC_REASON_INTERNAL; if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { - rep_hist_note_rend1_action(REND1_UNSUITABLE_CIRCUIT); + increment_rend1_action(REND1_UNSUITABLE_CIRCUIT); log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Tried to complete rendezvous on non-OR or non-edge circuit %u.", (unsigned)circ->p_circ_id); @@ -125,7 +125,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, } if (request_len < REND_COOKIE_LEN) { - rep_hist_note_rend1_action(REND1_MALFORMED); + increment_rend1_action(REND1_MALFORMED); log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Rejecting RENDEZVOUS1 cell with bad length (%d) on circuit %u.", (int)request_len, (unsigned)circ->p_circ_id); @@ -145,7 +145,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, * client gives up on a rendezvous circuit after sending INTRODUCE1, but * before the onion service sends the RENDEZVOUS1 cell. */ - rep_hist_note_rend1_action(REND1_UNKNOWN_COOKIE); + increment_rend1_action(REND1_UNKNOWN_COOKIE); log_fn(LOG_DEBUG, LD_PROTOCOL, "Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie %s.", hexid); @@ -166,7 +166,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, RELAY_COMMAND_RENDEZVOUS2, (char*)(request+REND_COOKIE_LEN), request_len-REND_COOKIE_LEN, NULL)) { - rep_hist_note_rend1_action(REND1_CIRCUIT_DEAD); + increment_rend1_action(REND1_CIRCUIT_DEAD); log_warn(LD_GENERAL, "Unable to send RENDEZVOUS2 cell to client on circuit %u.", (unsigned)rend_circ->p_circ_id); @@ -174,7 +174,7 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request, return -1; } - rep_hist_note_rend1_action(REND1_SUCCESS); + increment_rend1_action(REND1_SUCCESS); /* Join the circuits. */ log_info(LD_REND, "Completing rendezvous: circuit %u joins circuit %u (cookie %s)", |