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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 const std::string & id() const { return id_; } | 64 const std::string & id() const { return id_; } |
65 void set_id(const std::string & id) { id_ = id; } | 65 void set_id(const std::string & id) { id_ = id; } |
66 | 66 |
67 int component() const { return component_; } | 67 int component() const { return component_; } |
68 void set_component(int component) { component_ = component; } | 68 void set_component(int component) { component_ = component; } |
69 | 69 |
70 const std::string & protocol() const { return protocol_; } | 70 const std::string & protocol() const { return protocol_; } |
71 void set_protocol(const std::string & protocol) { protocol_ = protocol; } | 71 void set_protocol(const std::string & protocol) { protocol_ = protocol; } |
72 | 72 |
| 73 // The protocol used to talk to relay. |
| 74 const std::string& relay_protocol() const { return relay_protocol_; } |
| 75 void set_relay_protocol(const std::string& protocol) { |
| 76 relay_protocol_ = protocol; |
| 77 } |
| 78 |
73 const rtc::SocketAddress & address() const { return address_; } | 79 const rtc::SocketAddress & address() const { return address_; } |
74 void set_address(const rtc::SocketAddress & address) { | 80 void set_address(const rtc::SocketAddress & address) { |
75 address_ = address; | 81 address_ = address; |
76 } | 82 } |
77 | 83 |
78 uint32 priority() const { return priority_; } | 84 uint32 priority() const { return priority_; } |
79 void set_priority(const uint32 priority) { priority_ = priority; } | 85 void set_priority(const uint32 priority) { priority_ = priority; } |
80 | 86 |
81 // void set_type_preference(uint32 type_preference) { | 87 // void set_type_preference(uint32 type_preference) { |
82 // priority_ = GetPriority(type_preference); | 88 // priority_ = GetPriority(type_preference); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 ost << "Cand[" << foundation_ << ":" << component_ << ":" | 213 ost << "Cand[" << foundation_ << ":" << component_ << ":" |
208 << protocol_ << ":" << priority_ << ":" | 214 << protocol_ << ":" << priority_ << ":" |
209 << address << ":" << type_ << ":" << related_address_ << ":" | 215 << address << ":" << type_ << ":" << related_address_ << ":" |
210 << username_ << ":" << password_ << "]"; | 216 << username_ << ":" << password_ << "]"; |
211 return ost.str(); | 217 return ost.str(); |
212 } | 218 } |
213 | 219 |
214 std::string id_; | 220 std::string id_; |
215 int component_; | 221 int component_; |
216 std::string protocol_; | 222 std::string protocol_; |
| 223 std::string relay_protocol_; |
217 rtc::SocketAddress address_; | 224 rtc::SocketAddress address_; |
218 uint32 priority_; | 225 uint32 priority_; |
219 std::string username_; | 226 std::string username_; |
220 std::string password_; | 227 std::string password_; |
221 std::string type_; | 228 std::string type_; |
222 std::string network_name_; | 229 std::string network_name_; |
223 rtc::AdapterType network_type_; | 230 rtc::AdapterType network_type_; |
224 uint32 generation_; | 231 uint32 generation_; |
225 std::string foundation_; | 232 std::string foundation_; |
226 rtc::SocketAddress related_address_; | 233 rtc::SocketAddress related_address_; |
227 std::string tcptype_; | 234 std::string tcptype_; |
228 }; | 235 }; |
229 | 236 |
230 // Used during parsing and writing to map component to channel name | 237 // Used during parsing and writing to map component to channel name |
231 // and back. This is primarily for converting old G-ICE candidate | 238 // and back. This is primarily for converting old G-ICE candidate |
232 // signalling to new ICE candidate classes. | 239 // signalling to new ICE candidate classes. |
233 class CandidateTranslator { | 240 class CandidateTranslator { |
234 public: | 241 public: |
235 virtual ~CandidateTranslator() {} | 242 virtual ~CandidateTranslator() {} |
236 virtual bool GetChannelNameFromComponent( | 243 virtual bool GetChannelNameFromComponent( |
237 int component, std::string* channel_name) const = 0; | 244 int component, std::string* channel_name) const = 0; |
238 virtual bool GetComponentFromChannelName( | 245 virtual bool GetComponentFromChannelName( |
239 const std::string& channel_name, int* component) const = 0; | 246 const std::string& channel_name, int* component) const = 0; |
240 }; | 247 }; |
241 | 248 |
242 } // namespace cricket | 249 } // namespace cricket |
243 | 250 |
244 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ | 251 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ |
OLD | NEW |