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 */
9 * @brief Header for core/or/extendinfo.c
12 #ifndef TOR_CORE_OR_EXTENDINFO_H
13 #define TOR_CORE_OR_EXTENDINFO_H
15 extend_info_t
*extend_info_new(const char *nickname
,
16 const char *rsa_id_digest
,
17 const struct ed25519_public_key_t
*ed_id
,
18 crypto_pk_t
*onion_key
,
19 const struct curve25519_public_key_t
*ntor_key
,
20 const tor_addr_t
*addr
, uint16_t port
);
21 extend_info_t
*extend_info_from_node(const node_t
*r
, int for_direct_connect
);
22 extend_info_t
*extend_info_dup(extend_info_t
*info
);
23 void extend_info_free_(extend_info_t
*info
);
24 #define extend_info_free(info) \
25 FREE_AND_NULL(extend_info_t, extend_info_free_, (info))
26 int extend_info_addr_is_allowed(const tor_addr_t
*addr
);
27 int extend_info_supports_tap(const extend_info_t
* ei
);
28 int extend_info_supports_ntor(const extend_info_t
* ei
);
29 int extend_info_has_preferred_onion_key(const extend_info_t
* ei
);
30 bool extend_info_has_orport(const extend_info_t
*ei
,
31 const tor_addr_t
*addr
, uint16_t port
);
32 int extend_info_add_orport(extend_info_t
*ei
,
33 const tor_addr_t
*addr
,
35 const tor_addr_port_t
*extend_info_get_orport(const extend_info_t
*ei
,
37 const tor_addr_port_t
*extend_info_pick_orport(const extend_info_t
*ei
);
38 bool extend_info_any_orport_addr_is_internal(const extend_info_t
*ei
);
40 #endif /* !defined(TOR_CORE_OR_EXTENDINFO_H) */