tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

half_edge_st.h (1536B)


      1 /* Copyright (c) 2001 Matej Pfajfar.
      2 * Copyright (c) 2001-2004, Roger Dingledine.
      3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
      4 * Copyright (c) 2007-2021, The Tor Project, Inc. */
      5 /* See LICENSE for licensing information */
      6 
      7 /**
      8 * @file half_edge_st.h
      9 * @brief Half-open connection structure.
     10 **/
     11 
     12 #ifndef HALF_EDGE_ST_H
     13 #define HALF_EDGE_ST_H
     14 
     15 #include "core/or/or.h"
     16 
     17 /**
     18 * Struct to track a connection that we closed that the other end
     19 * still thinks is open. Exists in origin_circuit_t.half_streams until
     20 * we get an end cell or a resolved cell for this stream id.
     21 */
     22 typedef struct half_edge_t {
     23  /** stream_id for the half-closed connection */
     24  streamid_t stream_id;
     25 
     26  /** How many sendme's can the other end still send, based on how
     27   * much data we had sent at the time of close */
     28  int sendmes_pending;
     29 
     30  /** How much more data can the other end still send, based on
     31   * our deliver window */
     32  int data_pending;
     33 
     34  /**
     35   * Monotime timestamp of when the other end should have successfully
     36   * shut down the stream and stop sending data, based on the larger
     37   * of circuit RTT and CBT. Used if 'used_ccontrol' is true, to expire
     38   * the half_edge at this monotime timestamp. */
     39  uint64_t end_ack_expected_usec;
     40 
     41  /**
     42   * Did this edge use congestion control? If so, use
     43   * timer instead of pending data approach */
     44  unsigned int used_ccontrol : 1;
     45 
     46  /** Is there a connected cell pending? */
     47  unsigned int connected_pending : 1;
     48 } half_edge_t;
     49 
     50 #endif /* !defined(HALF_EDGE_ST_H) */