Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: webrtc/p2p/base/stun.h

Issue 1815473002: Add 16-bit network id to the candidate signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Remove the old NETWORK_COST attribute. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 599 }
600 virtual StunMessage* CreateNew() const { return new TurnMessage(); } 600 virtual StunMessage* CreateNew() const { return new TurnMessage(); }
601 }; 601 };
602 602
603 // RFC 5245 ICE STUN attributes. 603 // RFC 5245 ICE STUN attributes.
604 enum IceAttributeType { 604 enum IceAttributeType {
605 STUN_ATTR_PRIORITY = 0x0024, // UInt32 605 STUN_ATTR_PRIORITY = 0x0024, // UInt32
606 STUN_ATTR_USE_CANDIDATE = 0x0025, // No content, Length = 0 606 STUN_ATTR_USE_CANDIDATE = 0x0025, // No content, Length = 0
607 STUN_ATTR_ICE_CONTROLLED = 0x8029, // UInt64 607 STUN_ATTR_ICE_CONTROLLED = 0x8029, // UInt64
608 STUN_ATTR_ICE_CONTROLLING = 0x802A, // UInt64 608 STUN_ATTR_ICE_CONTROLLING = 0x802A, // UInt64
609 STUN_ATTR_NETWORK_COST = 0xC057 // UInt32 609 // UInt32. The higher 16 bits are the network ID. The lower 16 bits are the
610 // network cost.
611 STUN_ATTR_NETWORK_INFO = 0xC057
610 }; 612 };
611 613
612 // RFC 5245-defined errors. 614 // RFC 5245-defined errors.
613 enum IceErrorCode { 615 enum IceErrorCode {
614 STUN_ERROR_ROLE_CONFLICT = 487, 616 STUN_ERROR_ROLE_CONFLICT = 487,
615 }; 617 };
616 extern const char STUN_ERROR_REASON_ROLE_CONFLICT[]; 618 extern const char STUN_ERROR_REASON_ROLE_CONFLICT[];
617 619
618 // A RFC 5245 ICE STUN message. 620 // A RFC 5245 ICE STUN message.
619 class IceMessage : public StunMessage { 621 class IceMessage : public StunMessage {
620 protected: 622 protected:
621 virtual StunAttributeValueType GetAttributeValueType(int type) const { 623 virtual StunAttributeValueType GetAttributeValueType(int type) const {
622 switch (type) { 624 switch (type) {
623 case STUN_ATTR_PRIORITY: 625 case STUN_ATTR_PRIORITY:
624 case STUN_ATTR_NETWORK_COST: 626 case STUN_ATTR_NETWORK_INFO:
625 return STUN_VALUE_UINT32; 627 return STUN_VALUE_UINT32;
626 case STUN_ATTR_USE_CANDIDATE: return STUN_VALUE_BYTE_STRING; 628 case STUN_ATTR_USE_CANDIDATE: return STUN_VALUE_BYTE_STRING;
627 case STUN_ATTR_ICE_CONTROLLED: return STUN_VALUE_UINT64; 629 case STUN_ATTR_ICE_CONTROLLED: return STUN_VALUE_UINT64;
628 case STUN_ATTR_ICE_CONTROLLING: return STUN_VALUE_UINT64; 630 case STUN_ATTR_ICE_CONTROLLING: return STUN_VALUE_UINT64;
629 default: return StunMessage::GetAttributeValueType(type); 631 default: return StunMessage::GetAttributeValueType(type);
630 } 632 }
631 } 633 }
632 virtual StunMessage* CreateNew() const { return new IceMessage(); } 634 virtual StunMessage* CreateNew() const { return new IceMessage(); }
633 }; 635 };
634 636
635 } // namespace cricket 637 } // namespace cricket
636 638
637 #endif // WEBRTC_P2P_BASE_STUN_H_ 639 #endif // WEBRTC_P2P_BASE_STUN_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698