mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 23:21:38 +01:00
Make tor_addr_lookup() mockable.
This commit is contained in:
parent
97ed2ce085
commit
f23ec14d62
2 changed files with 4 additions and 3 deletions
|
@ -237,8 +237,8 @@ tor_addr_make_null(tor_addr_t *a, sa_family_t family)
|
||||||
*
|
*
|
||||||
* Return 0 on success, -1 on failure; 1 on transient failure.
|
* Return 0 on success, -1 on failure; 1 on transient failure.
|
||||||
*/
|
*/
|
||||||
int
|
MOCK_IMPL(int,
|
||||||
tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr)
|
tor_addr_lookup,(const char *name, uint16_t family, tor_addr_t *addr))
|
||||||
{
|
{
|
||||||
/* Perhaps eventually this should be replaced by a tor_getaddrinfo or
|
/* Perhaps eventually this should be replaced by a tor_getaddrinfo or
|
||||||
* something.
|
* something.
|
||||||
|
|
|
@ -190,7 +190,8 @@ tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u)
|
||||||
*/
|
*/
|
||||||
#define TOR_ADDR_BUF_LEN 48
|
#define TOR_ADDR_BUF_LEN 48
|
||||||
|
|
||||||
int tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr_out);
|
MOCK_DECL(int, tor_addr_lookup,(const char *name, uint16_t family,
|
||||||
|
tor_addr_t *addr_out));
|
||||||
char *tor_addr_to_str_dup(const tor_addr_t *addr) ATTR_MALLOC;
|
char *tor_addr_to_str_dup(const tor_addr_t *addr) ATTR_MALLOC;
|
||||||
|
|
||||||
/** Wrapper function of fmt_addr_impl(). It does not decorate IPv6
|
/** Wrapper function of fmt_addr_impl(). It does not decorate IPv6
|
||||||
|
|
Loading…
Add table
Reference in a new issue