It no longer needs an independent existence.
src/core/or/protover.h \
src/core/or/reasons.h \
src/core/or/relay.h \
- src/core/or/relay_cell.h \
src/core/or/relay_crypto_st.h \
src/core/or/relay_msg.h \
src/core/or/relay_msg_st.h \
#include "core/or/scheduler.h"
#include "feature/hs/hs_metrics.h"
#include "feature/stats/rephist.h"
-#include "core/or/relay_cell.h"
#include "core/or/relay_msg.h"
#include "core/or/cell_st.h"
+++ /dev/null
-/* Copyright (c) 2023, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-/**
- * \file relay_cell.h
- * \brief Header file for relay_cell.c.
- **/
-
-#ifndef TOR_RELAY_CELL_H
-#define TOR_RELAY_CELL_H
-
-#include "core/or/or.h"
-
-#include "core/or/cell_st.h"
-
-/* TODO #41051: Fold this file into relay_msg.h */
-
-/*
- * NOTE: The following are inlined for performance reasons. These values are
- * accessed everywhere and so, even if not expensive, we avoid a function call.
- */
-
-/** Return true iff 'cmd' uses a stream ID when using
- * the v1 relay message format. */
-static bool
-relay_cmd_expects_streamid_in_v1(uint8_t relay_command)
-{
- switch (relay_command) {
- case RELAY_COMMAND_BEGIN:
- case RELAY_COMMAND_BEGIN_DIR:
- case RELAY_COMMAND_CONNECTED:
- case RELAY_COMMAND_DATA:
- case RELAY_COMMAND_END:
- case RELAY_COMMAND_RESOLVE:
- case RELAY_COMMAND_RESOLVED:
- case RELAY_COMMAND_XOFF:
- case RELAY_COMMAND_XON:
- return true;
- default:
- return false;
- }
-}
-
-/** Return the size of the relay cell payload for the given relay
- * cell format. */
-static inline size_t
-relay_cell_max_payload_size(relay_cell_fmt_t format,
- uint8_t relay_command)
-{
- switch (format) {
- case RELAY_CELL_FORMAT_V0:
- return CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE_V0;
- case RELAY_CELL_FORMAT_V1: {
- if (relay_cmd_expects_streamid_in_v1(relay_command)) {
- return CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE_V1_WITH_STREAM_ID;
- } else {
- return CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE_V1_NO_STREAM_ID;
- }
- }
- default:
- tor_fragile_assert();
- return 0;
- }
-}
-
-#ifdef RELAY_CELL_PRIVATE
-
-#endif /* RELAY_CELL_PRIVATE */
-
-#endif /* TOR_RELAY_CELL_H */
#include "core/or/cell_st.h"
#include "core/or/circuitlist.h"
#include "core/or/relay.h"
-#include "core/or/relay_cell.h"
#include "core/or/relay_msg.h"
-#include "core/or/relay_cell.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "core/or/cell_st.h"
relay_cell_fmt_t relay_msg_get_format(const circuit_t *circ,
const crypt_path_t *cpath);
-/* Helpers. */
-void relay_msg_free_messages(smartlist_t *messages);
+/*
+ * NOTE: The following are inlined for performance reasons. These values are
+ * accessed everywhere and so, even if not expensive, we avoid a function call.
+ */
+
+/** Return true iff 'cmd' uses a stream ID when using
+ * the v1 relay message format. */
+static bool
+relay_cmd_expects_streamid_in_v1(uint8_t relay_command)
+{
+ switch (relay_command) {
+ case RELAY_COMMAND_BEGIN:
+ case RELAY_COMMAND_BEGIN_DIR:
+ case RELAY_COMMAND_CONNECTED:
+ case RELAY_COMMAND_DATA:
+ case RELAY_COMMAND_END:
+ case RELAY_COMMAND_RESOLVE:
+ case RELAY_COMMAND_RESOLVED:
+ case RELAY_COMMAND_XOFF:
+ case RELAY_COMMAND_XON:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/** Return the size of the relay cell payload for the given relay
+ * cell format. */
+static inline size_t
+relay_cell_max_payload_size(relay_cell_fmt_t format,
+ uint8_t relay_command)
+{
+ switch (format) {
+ case RELAY_CELL_FORMAT_V0:
+ return CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE_V0;
+ case RELAY_CELL_FORMAT_V1: {
+ if (relay_cmd_expects_streamid_in_v1(relay_command)) {
+ return CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE_V1_WITH_STREAM_ID;
+ } else {
+ return CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE_V1_NO_STREAM_ID;
+ }
+ }
+ default:
+ tor_fragile_assert();
+ return 0;
+ }
+}
#ifdef RELAY_MSG_PRIVATE
#include "feature/client/entrynodes.h"
#include "feature/nodelist/networkstatus.h"
#include "core/or/relay.h"
-#include "core/or/relay_cell.h"
#include "core/or/relay_msg.h"
#include "lib/math/fp.h"
#include "lib/math/laplace.h"
#include "core/or/origin_circuit_st.h"
#include "core/or/circuitlist.h"
#include "core/or/relay.h"
-#include "core/or/relay_cell.h"
#include "core/or/sendme.h"
#include "feature/nodelist/networkstatus.h"