| 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_P2P_BASE_PORT_H_ | 11 #ifndef WEBRTC_P2P_BASE_PORT_H_ |
| 12 #define WEBRTC_P2P_BASE_PORT_H_ | 12 #define WEBRTC_P2P_BASE_PORT_H_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <memory> |
| 15 #include <set> | 16 #include <set> |
| 16 #include <string> | 17 #include <string> |
| 17 #include <vector> | 18 #include <vector> |
| 18 | 19 |
| 19 #include "webrtc/p2p/base/candidate.h" | 20 #include "webrtc/p2p/base/candidate.h" |
| 20 #include "webrtc/p2p/base/candidatepairinterface.h" | 21 #include "webrtc/p2p/base/candidatepairinterface.h" |
| 21 #include "webrtc/p2p/base/packetsocketfactory.h" | 22 #include "webrtc/p2p/base/packetsocketfactory.h" |
| 22 #include "webrtc/p2p/base/portinterface.h" | 23 #include "webrtc/p2p/base/portinterface.h" |
| 23 #include "webrtc/p2p/base/stun.h" | 24 #include "webrtc/p2p/base/stun.h" |
| 24 #include "webrtc/p2p/base/stunrequest.h" | 25 #include "webrtc/p2p/base/stunrequest.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 ProtocolType proto); | 330 ProtocolType proto); |
| 330 | 331 |
| 331 // If the given data comprises a complete and correct STUN message then the | 332 // If the given data comprises a complete and correct STUN message then the |
| 332 // return value is true, otherwise false. If the message username corresponds | 333 // return value is true, otherwise false. If the message username corresponds |
| 333 // with this port's username fragment, msg will contain the parsed STUN | 334 // with this port's username fragment, msg will contain the parsed STUN |
| 334 // message. Otherwise, the function may send a STUN response internally. | 335 // message. Otherwise, the function may send a STUN response internally. |
| 335 // remote_username contains the remote fragment of the STUN username. | 336 // remote_username contains the remote fragment of the STUN username. |
| 336 bool GetStunMessage(const char* data, | 337 bool GetStunMessage(const char* data, |
| 337 size_t size, | 338 size_t size, |
| 338 const rtc::SocketAddress& addr, | 339 const rtc::SocketAddress& addr, |
| 339 rtc::scoped_ptr<IceMessage>* out_msg, | 340 std::unique_ptr<IceMessage>* out_msg, |
| 340 std::string* out_username); | 341 std::string* out_username); |
| 341 | 342 |
| 342 // Checks if the address in addr is compatible with the port's ip. | 343 // Checks if the address in addr is compatible with the port's ip. |
| 343 bool IsCompatibleAddress(const rtc::SocketAddress& addr); | 344 bool IsCompatibleAddress(const rtc::SocketAddress& addr); |
| 344 | 345 |
| 345 // Returns default DSCP value. | 346 // Returns default DSCP value. |
| 346 rtc::DiffServCodePoint DefaultDscpValue() const { | 347 rtc::DiffServCodePoint DefaultDscpValue() const { |
| 347 // No change from what MediaChannel set. | 348 // No change from what MediaChannel set. |
| 348 return rtc::DSCP_NO_CHANGE; | 349 return rtc::DSCP_NO_CHANGE; |
| 349 } | 350 } |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 const rtc::PacketOptions& options) override; | 672 const rtc::PacketOptions& options) override; |
| 672 int GetError() override { return error_; } | 673 int GetError() override { return error_; } |
| 673 | 674 |
| 674 private: | 675 private: |
| 675 int error_ = 0; | 676 int error_ = 0; |
| 676 }; | 677 }; |
| 677 | 678 |
| 678 } // namespace cricket | 679 } // namespace cricket |
| 679 | 680 |
| 680 #endif // WEBRTC_P2P_BASE_PORT_H_ | 681 #endif // WEBRTC_P2P_BASE_PORT_H_ |
| OLD | NEW |