@@ -213,6 +213,11 @@ struct tr_session
213213 return session_.localPeerPort ();
214214 }
215215
216+ [[nodiscard]] std::optional<tr_address> gateway_address () const override
217+ {
218+ return session_.gateway_address ();
219+ }
220+
216221 [[nodiscard]] libtransmission::TimerMaker& timer_maker () override
217222 {
218223 return session_.timerMaker ();
@@ -433,6 +438,7 @@ struct tr_session
433438 std::array<tr_preferred_transport, TR_NUM_PREFERRED_TRANSPORT> preferred_transport = { TR_PREFER_UTP, TR_PREFER_TCP };
434439 std::chrono::milliseconds sleep_per_seconds_during_verify = std::chrono::milliseconds{ 100 };
435440 std::optional<std::string> proxy_url;
441+ std::optional<std::string> gateway_address;
436442 std::string announce_ip;
437443 std::string bind_address_ipv4;
438444 std::string bind_address_ipv6;
@@ -471,6 +477,7 @@ struct tr_session
471477 { TR_KEY_download_queue_enabled, &download_queue_enabled },
472478 { TR_KEY_download_queue_size, &download_queue_size },
473479 { TR_KEY_encryption, &encryption_mode },
480+ { TR_KEY_gateway_address, &gateway_address },
474481 { TR_KEY_idle_seeding_limit, &idle_seeding_limit_minutes },
475482 { TR_KEY_idle_seeding_limit_enabled, &idle_seeding_limit_enabled },
476483 { TR_KEY_incomplete_dir, &incomplete_dir },
@@ -910,6 +917,16 @@ struct tr_session
910917 return advertised_peer_port_;
911918 }
912919
920+ [[nodiscard]] std::optional<tr_address> gateway_address () const noexcept
921+ {
922+ if (const auto addr = settings ().gateway_address )
923+ {
924+ return tr_address::from_string (*addr);
925+ }
926+
927+ return {};
928+ }
929+
913930 [[nodiscard]] constexpr auto queueEnabled (tr_direction dir) const noexcept
914931 {
915932 return dir == TR_DOWN ? settings_.download_queue_enabled : settings_.seed_queue_enabled ;
0 commit comments