OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Some socket related helper methods for quic. | 5 // Some socket related helper methods for quic. |
6 | 6 |
7 #ifndef NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ | 7 #ifndef NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ |
8 #define NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ | 8 #define NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 #include <sys/socket.h> | 11 #include <sys/socket.h> |
12 #include <string> | 12 #include <string> |
13 | 13 |
| 14 #include "base/basictypes.h" |
14 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
15 #include "net/quic/quic_protocol.h" | 16 #include "net/quic/quic_types.h" |
16 | 17 |
17 namespace net { | 18 namespace net { |
18 namespace tools { | 19 namespace tools { |
19 | 20 |
20 class QuicSocketUtils { | 21 class QuicSocketUtils { |
21 public: | 22 public: |
22 // If the msghdr contains IP_PKTINFO or IPV6_PKTINFO, this will return the | 23 // If the msghdr contains IP_PKTINFO or IPV6_PKTINFO, this will return the |
23 // IPAddressNumber in that header. Returns an uninitialized IPAddress on | 24 // IPAddressNumber in that header. Returns an uninitialized IPAddress on |
24 // failure. | 25 // failure. |
25 static IPAddressNumber GetAddressFromMsghdr(struct msghdr *hdr); | 26 static IPAddressNumber GetAddressFromMsghdr(struct msghdr *hdr); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 cmsghdr* cmsg); | 70 cmsghdr* cmsg); |
70 | 71 |
71 private: | 72 private: |
72 DISALLOW_COPY_AND_ASSIGN(QuicSocketUtils); | 73 DISALLOW_COPY_AND_ASSIGN(QuicSocketUtils); |
73 }; | 74 }; |
74 | 75 |
75 } // namespace tools | 76 } // namespace tools |
76 } // namespace net | 77 } // namespace net |
77 | 78 |
78 #endif // NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ | 79 #endif // NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ |
OLD | NEW |