OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "content/public/common/p2p_socket_type.h" | 9 #include "content/public/common/p2p_socket_type.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 const std::vector<char>& data, | 46 const std::vector<char>& data, |
47 const talk_base::PacketOptions& options, | 47 const talk_base::PacketOptions& options, |
48 uint64 packet_id) = 0; | 48 uint64 packet_id) = 0; |
49 | 49 |
50 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 50 virtual P2PSocketHost* AcceptIncomingTcpConnection( |
51 const net::IPEndPoint& remote_address, int id) = 0; | 51 const net::IPEndPoint& remote_address, int id) = 0; |
52 | 52 |
53 virtual bool SetOption(P2PSocketOption option, int value) = 0; | 53 virtual bool SetOption(P2PSocketOption option, int value) = 0; |
54 | 54 |
55 protected: | 55 protected: |
56 void MaybeUpdateRtpSendTimeExtn(char* data, int length, | |
57 const talk_base::PacketOptions& options); | |
58 | |
56 friend class P2PSocketHostTcpTestBase; | 59 friend class P2PSocketHostTcpTestBase; |
57 | 60 |
58 // TODO(mallinath) - Remove this below enum and use one defined in | 61 // TODO(mallinath) - Remove this below enum and use one defined in |
59 // libjingle/souce/talk/p2p/base/stun.h | 62 // libjingle/souce/talk/p2p/base/stun.h |
60 enum StunMessageType { | 63 enum StunMessageType { |
61 STUN_BINDING_REQUEST = 0x0001, | 64 STUN_BINDING_REQUEST = 0x0001, |
62 STUN_BINDING_RESPONSE = 0x0101, | 65 STUN_BINDING_RESPONSE = 0x0101, |
63 STUN_BINDING_ERROR_RESPONSE = 0x0111, | 66 STUN_BINDING_ERROR_RESPONSE = 0x0111, |
64 STUN_SHARED_SECRET_REQUEST = 0x0002, | 67 STUN_SHARED_SECRET_REQUEST = 0x0002, |
65 STUN_SHARED_SECRET_RESPONSE = 0x0102, | 68 STUN_SHARED_SECRET_RESPONSE = 0x0102, |
(...skipping 24 matching lines...) Expand all Loading... | |
90 }; | 93 }; |
91 | 94 |
92 P2PSocketHost(IPC::Sender* message_sender, int id); | 95 P2PSocketHost(IPC::Sender* message_sender, int id); |
93 | 96 |
94 // Verifies that the packet |data| has a valid STUN header. In case | 97 // Verifies that the packet |data| has a valid STUN header. In case |
95 // of success stores type of the message in |type|. | 98 // of success stores type of the message in |type|. |
96 static bool GetStunPacketType(const char* data, int data_size, | 99 static bool GetStunPacketType(const char* data, int data_size, |
97 StunMessageType* type); | 100 StunMessageType* type); |
98 static bool IsRequestOrResponse(StunMessageType type); | 101 static bool IsRequestOrResponse(StunMessageType type); |
99 | 102 |
103 bool UpdateRtpAbsSendTimeExtension(char* data, int length, | |
juberti2
2014/02/22 01:16:05
This should probably also be a Maybe function.
P
Mallinath (Gone from Chromium)
2014/02/25 00:20:02
Done.
| |
104 const int extension_id); | |
juberti2
2014/02/22 01:16:05
const not needed on value types
Mallinath (Gone from Chromium)
2014/02/25 00:20:02
Done.
| |
105 bool GetRtpPacketStartPosition(char* data, int length, int* rtp_start_pos); | |
106 void UpdateAbsSendtime(char* data, int len); | |
107 | |
108 void UpdateHmac(char* packet, int len, | |
109 const talk_base::PacketOptions& options); | |
110 | |
100 IPC::Sender* message_sender_; | 111 IPC::Sender* message_sender_; |
101 int id_; | 112 int id_; |
102 State state_; | 113 State state_; |
103 | 114 |
104 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 115 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
105 }; | 116 }; |
106 | 117 |
107 } // namespace content | 118 } // namespace content |
108 | 119 |
109 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 120 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
OLD | NEW |