OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 #include "webrtc/media/base/turnutils.h" | 11 #include "webrtc/media/base/turnutils.h" |
12 | 12 |
13 #include "webrtc/base/byteorder.h" | |
14 #include "webrtc/base/checks.h" | |
15 #include "webrtc/p2p/base/stun.h" | 13 #include "webrtc/p2p/base/stun.h" |
| 14 #include "webrtc/rtc_base/byteorder.h" |
| 15 #include "webrtc/rtc_base/checks.h" |
16 | 16 |
17 namespace cricket { | 17 namespace cricket { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const size_t kTurnChannelHeaderLength = 4; | 21 const size_t kTurnChannelHeaderLength = 4; |
22 | 22 |
23 bool IsTurnChannelData(const uint8_t* data, size_t length) { | 23 bool IsTurnChannelData(const uint8_t* data, size_t length) { |
24 return length >= kTurnChannelHeaderLength && ((*data & 0xC0) == 0x40); | 24 return length >= kTurnChannelHeaderLength && ((*data & 0xC0) == 0x40); |
25 } | 25 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return false; | 118 return false; |
119 } | 119 } |
120 | 120 |
121 // This is not a TURN packet. | 121 // This is not a TURN packet. |
122 *content_position = 0; | 122 *content_position = 0; |
123 *content_size = packet_size; | 123 *content_size = packet_size; |
124 return true; | 124 return true; |
125 } | 125 } |
126 | 126 |
127 } // namespace cricket | 127 } // namespace cricket |
OLD | NEW |