/** True iff this router supports congestion control.
* Requires both FlowCtrl=2 *and* Relay=4 */
unsigned int supports_congestion_control : 1;
+
+ /** True iff this router supports conflux. Requires Relay=5 */
+ unsigned int supports_conflux : 1;
} protover_summary_flags_t;
typedef struct routerinfo_t routerinfo_t;
{ PRT_PADDING, "Padding"},
{ PRT_CONS, "Cons" },
{ PRT_FLOWCTRL, "FlowCtrl"},
+ { PRT_CONFLUX, "Conflux"},
};
#define N_PROTOCOL_NAMES ARRAY_LENGTH(PROTOCOL_NAMES)
* XXX START OF HAZARDOUS ZONE XXX
*/
/* All protocol version that this relay version supports. */
+#define PR_CONFLUX_V "1"
#define PR_CONS_V "1-2"
#define PR_DESC_V "1-2"
#define PR_DIRCACHE_V "2"
protover_get_supported(const protocol_type_t type)
{
switch (type) {
+ case PRT_CONFLUX: return PR_CONFLUX_V;
case PRT_CONS: return PR_CONS_V;
case PRT_DESC: return PR_DESC_V;
case PRT_DIRCACHE: return PR_DIRCACHE_V;
*/
return
+ "Conflux=" PR_CONFLUX_V " "
"Cons=" PR_CONS_V " "
"Desc=" PR_DESC_V " "
"DirCache=" PR_DIRCACHE_V " "
#define PROTOVER_RELAY_CANONICAL_IPV6 3
/** The protover version number where relays can accept ntorv3 */
#define PROTOVER_RELAY_NTOR_V3 4
+/** The protover that signals conflux support. */
+#define PROTOVER_CONFLUX_V1 1
/** The protover version number that signifies HSv3 intro point support */
#define PROTOVER_HS_INTRO_V3 4
PRT_CONS = 9,
PRT_PADDING = 10,
PRT_FLOWCTRL = 11,
+ PRT_CONFLUX = 12,
} protocol_type_t;
bool protover_list_is_invalid(const char *s);
protocol_list_supports_protocol(protocols, PRT_RELAY,
PROTOVER_RELAY_NTOR_V3);
+ /* Conflux requires congestion control. */
+ out->supports_conflux =
+ protocol_list_supports_protocol(protocols, PRT_FLOWCTRL,
+ PROTOVER_FLOWCTRL_CC) &&
+ protocol_list_supports_protocol(protocols, PRT_CONFLUX,
+ PROTOVER_CONFLUX_V1);
+
protover_summary_flags_t *new_cached = tor_memdup(out, sizeof(*out));
cached = strmap_set(protover_summary_map, protocols, new_cached);
tor_assert(!cached);
/** Dummy object that should be unreturnable. Used to ensure that
* node_get_protover_summary_flags() always returns non-NULL. */
static const protover_summary_flags_t zero_protover_flags = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0
};
/** Return the protover_summary_flags for a given node. */
}
}
+/** Return true iff the given node supports conflux (Relay=5) */
+bool
+node_supports_conflux(const node_t *node)
+{
+ tor_assert(node);
+
+ return node_get_protover_summary_flags(node)->supports_conflux;
+}
+
/** Return the RSA ID key's SHA1 digest for the provided node. */
const uint8_t *
node_get_rsa_id_digest(const node_t *node)
bool node_supports_initiating_ipv6_extends(const node_t *node);
bool node_supports_accepting_ipv6_extends(const node_t *node,
bool need_canonical_ipv6_conn);
+bool node_supports_conflux(const node_t *node);
const uint8_t *node_get_rsa_id_digest(const node_t *node);
MOCK_DECL(smartlist_t *,node_get_link_specifier_smartlist,(const node_t *node,