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

Side by Side Diff: net/tools/quic/quic_socket_utils.h

Issue 329223003: Changed SetIpInfoInCmsg to return the length of the packet info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Writes buf_len to the socket. If writing is successful, sets the result's 59 // Writes buf_len to the socket. If writing is successful, sets the result's
60 // status to WRITE_STATUS_OK and sets bytes_written. Otherwise sets the 60 // status to WRITE_STATUS_OK and sets bytes_written. Otherwise sets the
61 // result's status to WRITE_STATUS_BLOCKED or WRITE_STATUS_ERROR and sets 61 // result's status to WRITE_STATUS_BLOCKED or WRITE_STATUS_ERROR and sets
62 // error_code to errno. 62 // error_code to errno.
63 static WriteResult WritePacket(int fd, const char* buffer, size_t buf_len, 63 static WriteResult WritePacket(int fd, const char* buffer, size_t buf_len,
64 const IPAddressNumber& self_address, 64 const IPAddressNumber& self_address,
65 const IPEndPoint& peer_address); 65 const IPEndPoint& peer_address);
66 66
67 // A helper for WritePacket which fills in the cmsg with the supplied self 67 // A helper for WritePacket which fills in the cmsg with the supplied self
68 // address. 68 // address.
69 static void SetIpInfoInCmsg(const IPAddressNumber& self_address, 69 // Returns the length of the packet info structure used.
70 cmsghdr* cmsg); 70 static size_t SetIpInfoInCmsg(const IPAddressNumber& self_address,
71 cmsghdr* cmsg);
71 72
72 private: 73 private:
73 DISALLOW_COPY_AND_ASSIGN(QuicSocketUtils); 74 DISALLOW_COPY_AND_ASSIGN(QuicSocketUtils);
74 }; 75 };
75 76
76 } // namespace tools 77 } // namespace tools
77 } // namespace net 78 } // namespace net
78 79
79 #endif // NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_ 80 #endif // NET_TOOLS_QUIC_QUIC_SOCKET_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698