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

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

Issue 99923004: Add support of IP_MULTICAST_IF in UDP sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « net/udp/udp_socket_unittest.cc ('k') | net/udp/udp_socket_win.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 #ifndef NET_UDP_UDP_SOCKET_WIN_H_ 5 #ifndef NET_UDP_UDP_SOCKET_WIN_H_
6 #define NET_UDP_UDP_SOCKET_WIN_H_ 6 #define NET_UDP_UDP_SOCKET_WIN_H_
7 7
8 #include <winsock2.h> 8 #include <winsock2.h>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 // Leave the multicast group. 124 // Leave the multicast group.
125 // |group_address| is the group address to leave, could be either 125 // |group_address| is the group address to leave, could be either
126 // an IPv4 or IPv6 address. If the socket hasn't joined the group, 126 // an IPv4 or IPv6 address. If the socket hasn't joined the group,
127 // it will be ignored. 127 // it will be ignored.
128 // It's optional to leave the multicast group before destroying 128 // It's optional to leave the multicast group before destroying
129 // the socket. It will be done by the OS. 129 // the socket. It will be done by the OS.
130 // Return a network error code. 130 // Return a network error code.
131 int LeaveGroup(const IPAddressNumber& group_address) const; 131 int LeaveGroup(const IPAddressNumber& group_address) const;
132 132
133 // Set interface to use for multicast. If |interface_index| set to 0, default
134 // interface is used.
135 // Should be called before Bind().
136 // Returns a network error code.
137 int SetMulticastInterface(uint32 interface_index);
138
133 // Set the time-to-live option for UDP packets sent to the multicast 139 // Set the time-to-live option for UDP packets sent to the multicast
134 // group address. The default value of this option is 1. 140 // group address. The default value of this option is 1.
135 // Cannot be negative or more than 255. 141 // Cannot be negative or more than 255.
136 // Should be called before Bind(). 142 // Should be called before Bind().
137 int SetMulticastTimeToLive(int time_to_live); 143 int SetMulticastTimeToLive(int time_to_live);
138 144
139 // Set the loopback flag for UDP socket. If this flag is true, the host 145 // Set the loopback flag for UDP socket. If this flag is true, the host
140 // will receive packets sent to the joined group from itself. 146 // will receive packets sent to the joined group from itself.
141 // The default value of this option is true. 147 // The default value of this option is true.
142 // Should be called before Bind(). 148 // Should be called before Bind().
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // to an IPEndPoint and writes it to |address|. Returns true on success. 206 // to an IPEndPoint and writes it to |address|. Returns true on success.
201 bool ReceiveAddressToIPEndpoint(IPEndPoint* address) const; 207 bool ReceiveAddressToIPEndpoint(IPEndPoint* address) const;
202 208
203 SOCKET socket_; 209 SOCKET socket_;
204 int addr_family_; 210 int addr_family_;
205 211
206 // Bitwise-or'd combination of SocketOptions. Specifies the set of 212 // Bitwise-or'd combination of SocketOptions. Specifies the set of
207 // options that should be applied to |socket_| before Bind(). 213 // options that should be applied to |socket_| before Bind().
208 int socket_options_; 214 int socket_options_;
209 215
216 // Multicast interface.
217 uint32 multicast_interface_;
218
210 // Multicast socket options cached for SetSocketOption. 219 // Multicast socket options cached for SetSocketOption.
211 // Cannot be used after Bind(). 220 // Cannot be used after Bind().
212 int multicast_time_to_live_; 221 int multicast_time_to_live_;
213 222
214 // How to do source port binding, used only when UDPSocket is part of 223 // How to do source port binding, used only when UDPSocket is part of
215 // UDPClientSocket, since UDPServerSocket provides Bind. 224 // UDPClientSocket, since UDPServerSocket provides Bind.
216 DatagramSocket::BindType bind_type_; 225 DatagramSocket::BindType bind_type_;
217 226
218 // PRNG function for generating port numbers. 227 // PRNG function for generating port numbers.
219 RandIntCallback rand_int_cb_; 228 RandIntCallback rand_int_cb_;
(...skipping 21 matching lines...) Expand all
241 CompletionCallback write_callback_; 250 CompletionCallback write_callback_;
242 251
243 BoundNetLog net_log_; 252 BoundNetLog net_log_;
244 253
245 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin); 254 DISALLOW_COPY_AND_ASSIGN(UDPSocketWin);
246 }; 255 };
247 256
248 } // namespace net 257 } // namespace net
249 258
250 #endif // NET_UDP_UDP_SOCKET_WIN_H_ 259 #endif // NET_UDP_UDP_SOCKET_WIN_H_
OLDNEW
« no previous file with comments | « net/udp/udp_socket_unittest.cc ('k') | net/udp/udp_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698