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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 const std::vector<char>& data, | 42 const std::vector<char>& data, |
43 net::DiffServCodePoint dscp, | 43 net::DiffServCodePoint dscp, |
44 uint64 packet_id) = 0; | 44 uint64 packet_id) = 0; |
45 | 45 |
46 virtual P2PSocketHost* AcceptIncomingTcpConnection( | 46 virtual P2PSocketHost* AcceptIncomingTcpConnection( |
47 const net::IPEndPoint& remote_address, int id) = 0; | 47 const net::IPEndPoint& remote_address, int id) = 0; |
48 | 48 |
49 virtual bool SetOption(P2PSocketOption option, int value) = 0; | 49 virtual bool SetOption(P2PSocketOption option, int value) = 0; |
50 | 50 |
51 protected: | 51 protected: |
52 void MaybeUpdateRtpSendTimeExtn(const char* data, int len); | |
juberti2
2014/02/14 01:53:27
The naming could be clearer here - you have 3 func
Solis
2014/02/14 10:05:29
I assume you mean to update the absolute sender ti
| |
53 | |
52 friend class P2PSocketHostTcpTestBase; | 54 friend class P2PSocketHostTcpTestBase; |
53 | 55 |
54 // TODO(mallinath) - Remove this below enum and use one defined in | 56 // TODO(mallinath) - Remove this below enum and use one defined in |
55 // libjingle/souce/talk/p2p/base/stun.h | 57 // libjingle/souce/talk/p2p/base/stun.h |
56 enum StunMessageType { | 58 enum StunMessageType { |
57 STUN_BINDING_REQUEST = 0x0001, | 59 STUN_BINDING_REQUEST = 0x0001, |
58 STUN_BINDING_RESPONSE = 0x0101, | 60 STUN_BINDING_RESPONSE = 0x0101, |
59 STUN_BINDING_ERROR_RESPONSE = 0x0111, | 61 STUN_BINDING_ERROR_RESPONSE = 0x0111, |
60 STUN_SHARED_SECRET_REQUEST = 0x0002, | 62 STUN_SHARED_SECRET_REQUEST = 0x0002, |
61 STUN_SHARED_SECRET_RESPONSE = 0x0102, | 63 STUN_SHARED_SECRET_RESPONSE = 0x0102, |
(...skipping 24 matching lines...) Expand all Loading... | |
86 }; | 88 }; |
87 | 89 |
88 P2PSocketHost(IPC::Sender* message_sender, int id); | 90 P2PSocketHost(IPC::Sender* message_sender, int id); |
89 | 91 |
90 // Verifies that the packet |data| has a valid STUN header. In case | 92 // Verifies that the packet |data| has a valid STUN header. In case |
91 // of success stores type of the message in |type|. | 93 // of success stores type of the message in |type|. |
92 static bool GetStunPacketType(const char* data, int data_size, | 94 static bool GetStunPacketType(const char* data, int data_size, |
93 StunMessageType* type); | 95 StunMessageType* type); |
94 static bool IsRequestOrResponse(StunMessageType type); | 96 static bool IsRequestOrResponse(StunMessageType type); |
95 | 97 |
98 bool ParseRtpPacket(const char* data, int len); | |
Solis
2014/02/14 10:05:29
I think you can remove these functions from the cl
| |
99 int SkipPaddingBytes(const char* data, int len); | |
100 void UpdateRtpSendTimeExtn(const char* data, int len); | |
101 | |
102 void UpdateHmac(const void* packet, int len); | |
103 | |
96 IPC::Sender* message_sender_; | 104 IPC::Sender* message_sender_; |
97 int id_; | 105 int id_; |
98 State state_; | 106 State state_; |
107 int rtp_sendtime_extn_id_; | |
99 | 108 |
100 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); | 109 DISALLOW_COPY_AND_ASSIGN(P2PSocketHost); |
101 }; | 110 }; |
102 | 111 |
103 } // namespace content | 112 } // namespace content |
104 | 113 |
105 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ | 114 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_ |
OLD | NEW |