aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-21 12:02:01 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-21 12:02:01 -0400
commitfda9d7f5ed0758957b98d3b16a62bfd785f1917c (patch)
tree05be8330fd1ce24273ff80c0e070c58eaaf3b9d5 /src/app
parente8497bfaa70ef7ce8c48bc2c5464d6fddb8fcff1 (diff)
downloadtor-fda9d7f5ed0758957b98d3b16a62bfd785f1917c.tar.gz
tor-fda9d7f5ed0758957b98d3b16a62bfd785f1917c.zip
Rename get_first_advertised_{addr,port}_by_type_af().
Rationale: these don't actually give the first advertised address/port, but instead give us the first such port that we are _configured_ to advertise. Putting them in a portconf_ namespace therefore makes sense. Similarly, there are no other functions that get the first configured advertised addr/port, so the "by_type_af()" part is needless. This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ get_first_advertised_addr_by_type_af portconf_get_first_advertised_addr \ get_first_advertised_port_by_type_af portconf_get_first_advertised_port
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c4
-rw-r--r--src/app/config/config.h8
-rw-r--r--src/app/config/resolve_addr.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 9e7d1179ba..269677cbdf 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -6508,7 +6508,7 @@ get_first_listener_addrport_string(int listener_type)
* <b>address_family</b>. Returns 0 when no port is found, and when passed
* AF_UNSPEC. */
int
-get_first_advertised_port_by_type_af(int listener_type, int address_family)
+portconf_get_first_advertised_port(int listener_type, int address_family)
{
if (address_family == AF_UNSPEC)
return 0;
@@ -6530,7 +6530,7 @@ get_first_advertised_port_by_type_af(int listener_type, int address_family)
* <b>address_family</b>. Returns NULL if there is no advertised address,
* and when passed AF_UNSPEC. */
const tor_addr_t *
-get_first_advertised_addr_by_type_af(int listener_type, int address_family)
+portconf_get_first_advertised_addr(int listener_type, int address_family)
{
if (address_family == AF_UNSPEC)
return NULL;
diff --git a/src/app/config/config.h b/src/app/config/config.h
index f7d4e49f6f..fdffd66683 100644
--- a/src/app/config/config.h
+++ b/src/app/config/config.h
@@ -159,13 +159,13 @@ int get_num_cpus(const or_options_t *options);
MOCK_DECL(const smartlist_t *,get_configured_ports,(void));
int port_binds_ipv4(const port_cfg_t *port);
int port_binds_ipv6(const port_cfg_t *port);
-int get_first_advertised_port_by_type_af(int listener_type,
+int portconf_get_first_advertised_port(int listener_type,
int address_family);
#define get_primary_or_port() \
- (get_first_advertised_port_by_type_af(CONN_TYPE_OR_LISTENER, AF_INET))
+ (portconf_get_first_advertised_port(CONN_TYPE_OR_LISTENER, AF_INET))
#define get_primary_dir_port() \
- (get_first_advertised_port_by_type_af(CONN_TYPE_DIR_LISTENER, AF_INET))
-const tor_addr_t *get_first_advertised_addr_by_type_af(int listener_type,
+ (portconf_get_first_advertised_port(CONN_TYPE_DIR_LISTENER, AF_INET))
+const tor_addr_t *portconf_get_first_advertised_addr(int listener_type,
int address_family);
int port_exists_by_type_addr_port(int listener_type, const tor_addr_t *addr,
int port, int check_wildcard);
diff --git a/src/app/config/resolve_addr.h b/src/app/config/resolve_addr.h
index 369f621fa9..c279d19f6e 100644
--- a/src/app/config/resolve_addr.h
+++ b/src/app/config/resolve_addr.h
@@ -15,7 +15,7 @@
#include "app/config/or_options_st.h"
#define get_orport_addr(family) \
- (get_first_advertised_addr_by_type_af(CONN_TYPE_OR_LISTENER, family))
+ (portconf_get_first_advertised_addr(CONN_TYPE_OR_LISTENER, family))
bool find_my_address(const or_options_t *options, int family,
int warn_severity, tor_addr_t *addr_out,