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

Side by Side Diff: net/udp/datagram_socket.h

Issue 22381012: Allow p2p UDP packages to set DSCP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed tests Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
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 NET_UDP_DATAGRAM_SOCKET_H_ 5 #ifndef NET_UDP_DATAGRAM_SOCKET_H_
6 #define NET_UDP_DATAGRAM_SOCKET_H_ 6 #define NET_UDP_DATAGRAM_SOCKET_H_
7 7
8 #include "net/base/net_export.h" 8 #include "net/base/net_export.h"
9 9
10 namespace net { 10 namespace net {
11 11
12 class BoundNetLog; 12 class BoundNetLog;
13 class IPEndPoint; 13 class IPEndPoint;
14 14
15 // TODO(hubbe): Move this to net_util.h and implement SetToS
16 // for tcp sockets as well.
17 enum DiffServCodePoint {
18 DSCP_CS0 = 0, // The default
19 DSCP_CS1 = 8, // Bulk/background traffic
20 DSCP_AF11 = 10,
21 DSCP_AF12 = 12,
22 DSCP_AF13 = 14,
23 DSCP_CS2 = 16,
24 DSCP_AF21 = 18,
25 DSCP_AF22 = 20,
26 DSCP_AF23 = 22,
27 DSCP_CS3 = 24,
28 DSCP_AF31 = 26,
29 DSCP_AF32 = 28,
30 DSCP_AF33 = 30,
31 DSCP_CS4 = 32,
32 DSCP_AF41 = 34, // Video
33 DSCP_AF42 = 36, // Video
34 DSCP_AF43 = 38, // Video
35 DSCP_CS5 = 40, // Video
36 DSCP_EF = 46, // Voice
37 DSCP_CS6 = 48, // Voice
38 DSCP_CS7 = 56, // Control messages
39 };
40
41
15 // A datagram socket is an interface to a protocol which exchanges 42 // A datagram socket is an interface to a protocol which exchanges
16 // datagrams, like UDP. 43 // datagrams, like UDP.
17 class NET_EXPORT_PRIVATE DatagramSocket { 44 class NET_EXPORT_PRIVATE DatagramSocket {
18 public: 45 public:
19 // Type of source port binding to use. 46 // Type of source port binding to use.
20 enum BindType { 47 enum BindType {
21 RANDOM_BIND, 48 RANDOM_BIND,
22 DEFAULT_BIND, 49 DEFAULT_BIND,
23 }; 50 };
24 51
25 virtual ~DatagramSocket() {} 52 virtual ~DatagramSocket() {}
26 53
27 // Close the socket. 54 // Close the socket.
28 virtual void Close() = 0; 55 virtual void Close() = 0;
29 56
30 // Copy the remote udp address into |address| and return a network error code. 57 // Copy the remote udp address into |address| and return a network error code.
31 virtual int GetPeerAddress(IPEndPoint* address) const = 0; 58 virtual int GetPeerAddress(IPEndPoint* address) const = 0;
32 59
33 // Copy the local udp address into |address| and return a network error code. 60 // Copy the local udp address into |address| and return a network error code.
34 // (similar to getsockname) 61 // (similar to getsockname)
35 virtual int GetLocalAddress(IPEndPoint* address) const = 0; 62 virtual int GetLocalAddress(IPEndPoint* address) const = 0;
36 63
37 // Gets the NetLog for this socket. 64 // Gets the NetLog for this socket.
38 virtual const BoundNetLog& NetLog() const = 0; 65 virtual const BoundNetLog& NetLog() const = 0;
39 }; 66 };
40 67
41 } // namespace net 68 } // namespace net
42 69
43 #endif // NET_UDP_DATAGRAM_SOCKET_H_ 70 #endif // NET_UDP_DATAGRAM_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698