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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 bool SetTransactionID(const std::string& str); | 149 bool SetTransactionID(const std::string& str); |
150 | 150 |
151 // Gets the desired attribute value, or NULL if no such attribute type exists. | 151 // Gets the desired attribute value, or NULL if no such attribute type exists. |
152 const StunAddressAttribute* GetAddress(int type) const; | 152 const StunAddressAttribute* GetAddress(int type) const; |
153 const StunUInt32Attribute* GetUInt32(int type) const; | 153 const StunUInt32Attribute* GetUInt32(int type) const; |
154 const StunUInt64Attribute* GetUInt64(int type) const; | 154 const StunUInt64Attribute* GetUInt64(int type) const; |
155 const StunByteStringAttribute* GetByteString(int type) const; | 155 const StunByteStringAttribute* GetByteString(int type) const; |
156 | 156 |
157 // Gets these specific attribute values. | 157 // Gets these specific attribute values. |
158 const StunErrorCodeAttribute* GetErrorCode() const; | 158 const StunErrorCodeAttribute* GetErrorCode() const; |
| 159 // Returns the code inside the error code attribute, if present, and |
| 160 // STUN_ERROR_GLOBAL_FAILURE otherwise. |
| 161 int GetErrorCodeValue() const; |
159 const StunUInt16ListAttribute* GetUnknownAttributes() const; | 162 const StunUInt16ListAttribute* GetUnknownAttributes() const; |
160 | 163 |
161 // Takes ownership of the specified attribute and adds it to the message. | 164 // Takes ownership of the specified attribute and adds it to the message. |
162 void AddAttribute(std::unique_ptr<StunAttribute> attr); | 165 void AddAttribute(std::unique_ptr<StunAttribute> attr); |
163 | 166 |
164 // Validates that a raw STUN message has a correct MESSAGE-INTEGRITY value. | 167 // Validates that a raw STUN message has a correct MESSAGE-INTEGRITY value. |
165 // This can't currently be done on a StunMessage, since it is affected by | 168 // This can't currently be done on a StunMessage, since it is affected by |
166 // padding data (which we discard when reading a StunMessage). | 169 // padding data (which we discard when reading a StunMessage). |
167 static bool ValidateMessageIntegrity(const char* data, size_t size, | 170 static bool ValidateMessageIntegrity(const char* data, size_t size, |
168 const std::string& password); | 171 const std::string& password); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 case STUN_ATTR_ICE_CONTROLLING: return STUN_VALUE_UINT64; | 635 case STUN_ATTR_ICE_CONTROLLING: return STUN_VALUE_UINT64; |
633 default: return StunMessage::GetAttributeValueType(type); | 636 default: return StunMessage::GetAttributeValueType(type); |
634 } | 637 } |
635 } | 638 } |
636 virtual StunMessage* CreateNew() const { return new IceMessage(); } | 639 virtual StunMessage* CreateNew() const { return new IceMessage(); } |
637 }; | 640 }; |
638 | 641 |
639 } // namespace cricket | 642 } // namespace cricket |
640 | 643 |
641 #endif // WEBRTC_P2P_BASE_STUN_H_ | 644 #endif // WEBRTC_P2P_BASE_STUN_H_ |
OLD | NEW |