OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_BASE_FIREWALLSOCKETSERVER_H_ | 11 #ifndef WEBRTC_TEST_FIREWALLSOCKETSERVER_H_ |
12 #define WEBRTC_BASE_FIREWALLSOCKETSERVER_H_ | 12 #define WEBRTC_TEST_FIREWALLSOCKETSERVER_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 #include "webrtc/base/socketserver.h" | 15 #include "webrtc/base/socketserver.h" |
16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
17 | 17 |
18 namespace rtc { | 18 namespace rtc { |
19 | 19 |
20 class FirewallManager; | 20 class FirewallManager; |
21 | 21 |
22 // This SocketServer shim simulates a rule-based firewall server. | 22 // This SocketServer shim simulates a rule-based firewall server. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 }; | 84 }; |
85 std::vector<Rule> rules_; | 85 std::vector<Rule> rules_; |
86 bool should_delete_server_; | 86 bool should_delete_server_; |
87 bool udp_sockets_enabled_; | 87 bool udp_sockets_enabled_; |
88 bool tcp_sockets_enabled_; | 88 bool tcp_sockets_enabled_; |
89 bool tcp_listen_enabled_; | 89 bool tcp_listen_enabled_; |
90 }; | 90 }; |
91 | 91 |
92 // FirewallManager allows you to manage firewalls in multiple threads together | 92 // FirewallManager allows you to manage firewalls in multiple threads together |
93 | 93 |
94 class FirewallManager { | 94 class FirewallManager { |
nisse-webrtc
2016/11/18 11:17:45
I think this class is unused. I'll consider deleti
| |
95 public: | 95 public: |
96 FirewallManager(); | 96 FirewallManager(); |
97 ~FirewallManager(); | 97 ~FirewallManager(); |
98 | 98 |
99 void AddServer(FirewallSocketServer * server); | 99 void AddServer(FirewallSocketServer * server); |
100 void RemoveServer(FirewallSocketServer * server); | 100 void RemoveServer(FirewallSocketServer * server); |
101 | 101 |
102 void AddRule(bool allow, FirewallProtocol p = FP_ANY, | 102 void AddRule(bool allow, FirewallProtocol p = FP_ANY, |
103 FirewallDirection d = FD_ANY, | 103 FirewallDirection d = FD_ANY, |
104 const SocketAddress& addr = SocketAddress()); | 104 const SocketAddress& addr = SocketAddress()); |
105 void ClearRules(); | 105 void ClearRules(); |
106 | 106 |
107 private: | 107 private: |
108 CriticalSection crit_; | 108 CriticalSection crit_; |
109 std::vector<FirewallSocketServer *> servers_; | 109 std::vector<FirewallSocketServer *> servers_; |
110 }; | 110 }; |
111 | 111 |
112 } // namespace rtc | 112 } // namespace rtc |
113 | 113 |
114 #endif // WEBRTC_BASE_FIREWALLSOCKETSERVER_H_ | 114 #endif // WEBRTC_TEST_FIREWALLSOCKETSERVER_H_ |
OLD | NEW |