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 Determine whether we are trying to be a proxy.
12 #include "core/or/or.h"
14 #include "app/config/config.h"
15 #include "core/mainloop/connection.h"
16 #include "core/or/port_cfg_st.h"
17 #include "feature/client/proxymode.h"
19 /** Return true iff we are trying to proxy client connections. */
21 proxy_mode(const or_options_t
*options
)
24 SMARTLIST_FOREACH_BEGIN(get_configured_ports(), const port_cfg_t
*, p
) {
25 if (p
->type
== CONN_TYPE_AP_LISTENER
||
26 p
->type
== CONN_TYPE_AP_TRANS_LISTENER
||
27 p
->type
== CONN_TYPE_AP_DNS_LISTENER
||
28 p
->type
== CONN_TYPE_AP_NATD_LISTENER
)
30 } SMARTLIST_FOREACH_END(p
);