Index: webrtc/base/firewallsocketserver.h |
diff --git a/webrtc/base/firewallsocketserver.h b/webrtc/base/firewallsocketserver.h |
index 95ff039623a2800a8169cb2991f9c731958def2f..b9664f007ae00659aa45b119134d0a65dc64dfde 100644 |
--- a/webrtc/base/firewallsocketserver.h |
+++ b/webrtc/base/firewallsocketserver.h |
@@ -58,6 +58,16 @@ class FirewallSocketServer : public SocketServer { |
bool Check(FirewallProtocol p, |
const SocketAddress& src, const SocketAddress& dst); |
+ // Set the IP addresses which can't be bound to using Bind. By default this |
pthatcher1
2017/06/13 19:52:49
"which can't be bound to using Bind" => "for which
Taylor Brandstetter
2017/06/13 22:11:17
Done.
|
+ // list is empty. This can be used to simulate a real OS that refuses to bind |
+ // to addresses under various circumstances. |
+ // |
+ // No matter how many addresses are added (including INADDR_ANY), the server |
+ // will still allow creating outgoing TCP connections, since they don't |
+ // require explicitly binding a socket. |
+ void SetInvalidBindIps(const std::vector<rtc::IPAddress>& invalid_bind_ips); |
+ bool CanBindToIp(const rtc::IPAddress& ip); |
pthatcher1
2017/06/13 19:52:49
Might make these symmetric: SetInvalidBindIps and
Taylor Brandstetter
2017/06/13 22:11:17
Done.
|
+ |
Socket* CreateSocket(int type) override; |
Socket* CreateSocket(int family, int type) override; |
@@ -83,6 +93,9 @@ class FirewallSocketServer : public SocketServer { |
SocketAddress dst; |
}; |
std::vector<Rule> rules_; |
+ // IP addresses which can't be successfully bound to, using Bind. If this |
+ // list is empty, any address is accepted. |
pthatcher1
2017/06/13 19:52:49
You just need one comment to explain this, not two
Taylor Brandstetter
2017/06/13 22:11:17
Done.
|
+ std::vector<rtc::IPAddress> invalid_bind_ips_; |
bool should_delete_server_; |
bool udp_sockets_enabled_; |
bool tcp_sockets_enabled_; |