summaryrefslogtreecommitdiff
path: root/src/feature/relay/circuitbuild_relay.h
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2020-03-17 17:18:40 +1000
committerteor <teor@torproject.org>2020-03-20 18:05:10 +1000
commit81687f5bc975842bb4d251881b04e19092ab336e (patch)
tree1450f4ea123bf03e8ec9baa32164d45f5ed15409 /src/feature/relay/circuitbuild_relay.h
parentfdba6ff0c0f27b9948101e63efd5acb965a2f6a3 (diff)
downloadtor-81687f5bc975842bb4d251881b04e19092ab336e.tar.gz
tor-81687f5bc975842bb4d251881b04e19092ab336e.zip
relay: Split out relay-only circuit building
Move the relay-only circuit building functions into a new file. Part of 33633.
Diffstat (limited to 'src/feature/relay/circuitbuild_relay.h')
-rw-r--r--src/feature/relay/circuitbuild_relay.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/feature/relay/circuitbuild_relay.h b/src/feature/relay/circuitbuild_relay.h
new file mode 100644
index 0000000000..decc28d3a8
--- /dev/null
+++ b/src/feature/relay/circuitbuild_relay.h
@@ -0,0 +1,60 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2020, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * @file circuitbuild_relay.h
+ * @brief Header for feature/relay/circuitbuild_relay.c
+ **/
+
+#ifndef TOR_FEATURE_RELAY_CIRCUITBUILD_RELAY_H
+#define TOR_FEATURE_RELAY_CIRCUITBUILD_RELAY_H
+
+#include "lib/cc/torint.h"
+
+struct cell_t;
+struct created_cell_t;
+
+struct circuit_t;
+struct or_circuit_t;
+
+#ifdef HAVE_MODULE_RELAY
+
+int circuit_extend(struct cell_t *cell, struct circuit_t *circ);
+
+int onionskin_answer(struct or_circuit_t *circ,
+ const struct created_cell_t *created_cell,
+ const char *keys, size_t keys_len,
+ const uint8_t *rend_circ_nonce);
+
+#else
+
+static inline int
+circuit_extend(struct cell_t *cell, struct circuit_t *circ)
+{
+ (void)cell;
+ (void)circ;
+ tor_assert_nonfatal_unreached();
+ return -1;
+}
+
+static inline int
+onionskin_answer(struct or_circuit_t *circ,
+ const struct created_cell_t *created_cell,
+ const char *keys, size_t keys_len,
+ const uint8_t *rend_circ_nonce)
+{
+ (void)circ;
+ (void)created_cell;
+ (void)keys;
+ (void)keys_len;
+ (void)rend_circ_nonce;
+ tor_assert_nonfatal_unreached();
+ return -1;
+}
+
+#endif
+
+#endif /* !defined(TOR_FEATURE_RELAY_CIRCUITBUILD_RELAY_H) */