[tor-commits] [tor/master] Add relay crypto mock points for tests.

nickm at torproject.org nickm at torproject.org
Mon Jan 14 19:50:35 UTC 2019


commit d62340018c8d363ea67ef01dc4a740e47fce2a10
Author: Mike Perry <mikeperry-git at torproject.org>
Date:   Thu Aug 23 20:31:16 2018 +0000

    Add relay crypto mock points for tests.
    
    Co-authored-by: George Kadianakis <desnacked at riseup.net>
---
 src/core/or/relay.c | 6 +++---
 src/core/or/relay.h | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/core/or/relay.c b/src/core/or/relay.c
index 452777b2f..9c0f3bbbe 100644
--- a/src/core/or/relay.c
+++ b/src/core/or/relay.c
@@ -355,11 +355,11 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ,
  *  - Encrypt it to the right layer
  *  - Append it to the appropriate cell_queue on <b>circ</b>.
  */
-static int
-circuit_package_relay_cell(cell_t *cell, circuit_t *circ,
+MOCK_IMPL(int,
+circuit_package_relay_cell, (cell_t *cell, circuit_t *circ,
                            cell_direction_t cell_direction,
                            crypt_path_t *layer_hint, streamid_t on_stream,
-                           const char *filename, int lineno)
+                           const char *filename, int lineno))
 {
   channel_t *chan; /* where to send the cell */
 
diff --git a/src/core/or/relay.h b/src/core/or/relay.h
index db7f17b96..e84727e37 100644
--- a/src/core/or/relay.h
+++ b/src/core/or/relay.h
@@ -78,6 +78,11 @@ void destroy_cell_queue_append(destroy_cell_queue_t *queue,
 void channel_unlink_all_circuits(channel_t *chan, smartlist_t *detached_out);
 MOCK_DECL(int, channel_flush_from_first_active_circuit,
           (channel_t *chan, int max));
+MOCK_DECL(int, circuit_package_relay_cell, (cell_t *cell, circuit_t *circ,
+                           cell_direction_t cell_direction,
+                           crypt_path_t *layer_hint, streamid_t on_stream,
+                           const char *filename, int lineno));
+
 void update_circuit_on_cmux_(circuit_t *circ, cell_direction_t direction,
                              const char *file, int lineno);
 #define update_circuit_on_cmux(circ, direction) \





More information about the tor-commits mailing list