Statistics
| Revision:

root / tmp / org.txm.statsengine.r.core.win32 / res / win32 / library / BH / include / boost / asio / ip / multicast.hpp @ 2486

History | View | Annotate | Download (5.4 kB)

1 2486 sjacqu01
//
2 2486 sjacqu01
// ip/multicast.hpp
3 2486 sjacqu01
// ~~~~~~~~~~~~~~~~
4 2486 sjacqu01
//
5 2486 sjacqu01
// Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 2486 sjacqu01
//
7 2486 sjacqu01
// Distributed under the Boost Software License, Version 1.0. (See accompanying
8 2486 sjacqu01
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 2486 sjacqu01
//
10 2486 sjacqu01
11 2486 sjacqu01
#ifndef BOOST_ASIO_IP_MULTICAST_HPP
12 2486 sjacqu01
#define BOOST_ASIO_IP_MULTICAST_HPP
13 2486 sjacqu01
14 2486 sjacqu01
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 2486 sjacqu01
# pragma once
16 2486 sjacqu01
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 2486 sjacqu01
18 2486 sjacqu01
#include <boost/asio/detail/config.hpp>
19 2486 sjacqu01
#include <cstddef>
20 2486 sjacqu01
#include <boost/asio/ip/detail/socket_option.hpp>
21 2486 sjacqu01
22 2486 sjacqu01
#include <boost/asio/detail/push_options.hpp>
23 2486 sjacqu01
24 2486 sjacqu01
namespace boost {
25 2486 sjacqu01
namespace asio {
26 2486 sjacqu01
namespace ip {
27 2486 sjacqu01
namespace multicast {
28 2486 sjacqu01
29 2486 sjacqu01
/// Socket option to join a multicast group on a specified interface.
30 2486 sjacqu01
/**
31 2486 sjacqu01
 * Implements the IPPROTO_IP/IP_ADD_MEMBERSHIP socket option.
32 2486 sjacqu01
 *
33 2486 sjacqu01
 * @par Examples
34 2486 sjacqu01
 * Setting the option to join a multicast group:
35 2486 sjacqu01
 * @code
36 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
37 2486 sjacqu01
 * ...
38 2486 sjacqu01
 * boost::asio::ip::address multicast_address =
39 2486 sjacqu01
 *   boost::asio::ip::address::from_string("225.0.0.1");
40 2486 sjacqu01
 * boost::asio::ip::multicast::join_group option(multicast_address);
41 2486 sjacqu01
 * socket.set_option(option);
42 2486 sjacqu01
 * @endcode
43 2486 sjacqu01
 *
44 2486 sjacqu01
 * @par Concepts:
45 2486 sjacqu01
 * SettableSocketOption.
46 2486 sjacqu01
 */
47 2486 sjacqu01
#if defined(GENERATING_DOCUMENTATION)
48 2486 sjacqu01
typedef implementation_defined join_group;
49 2486 sjacqu01
#else
50 2486 sjacqu01
typedef boost::asio::ip::detail::socket_option::multicast_request<
51 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IP),
52 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IP_ADD_MEMBERSHIP),
53 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
54 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPV6_JOIN_GROUP)> join_group;
55 2486 sjacqu01
#endif
56 2486 sjacqu01
57 2486 sjacqu01
/// Socket option to leave a multicast group on a specified interface.
58 2486 sjacqu01
/**
59 2486 sjacqu01
 * Implements the IPPROTO_IP/IP_DROP_MEMBERSHIP socket option.
60 2486 sjacqu01
 *
61 2486 sjacqu01
 * @par Examples
62 2486 sjacqu01
 * Setting the option to leave a multicast group:
63 2486 sjacqu01
 * @code
64 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
65 2486 sjacqu01
 * ...
66 2486 sjacqu01
 * boost::asio::ip::address multicast_address =
67 2486 sjacqu01
 *   boost::asio::ip::address::from_string("225.0.0.1");
68 2486 sjacqu01
 * boost::asio::ip::multicast::leave_group option(multicast_address);
69 2486 sjacqu01
 * socket.set_option(option);
70 2486 sjacqu01
 * @endcode
71 2486 sjacqu01
 *
72 2486 sjacqu01
 * @par Concepts:
73 2486 sjacqu01
 * SettableSocketOption.
74 2486 sjacqu01
 */
75 2486 sjacqu01
#if defined(GENERATING_DOCUMENTATION)
76 2486 sjacqu01
typedef implementation_defined leave_group;
77 2486 sjacqu01
#else
78 2486 sjacqu01
typedef boost::asio::ip::detail::socket_option::multicast_request<
79 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IP),
80 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IP_DROP_MEMBERSHIP),
81 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
82 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPV6_LEAVE_GROUP)> leave_group;
83 2486 sjacqu01
#endif
84 2486 sjacqu01
85 2486 sjacqu01
/// Socket option for local interface to use for outgoing multicast packets.
86 2486 sjacqu01
/**
87 2486 sjacqu01
 * Implements the IPPROTO_IP/IP_MULTICAST_IF socket option.
88 2486 sjacqu01
 *
89 2486 sjacqu01
 * @par Examples
90 2486 sjacqu01
 * Setting the option:
91 2486 sjacqu01
 * @code
92 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
93 2486 sjacqu01
 * ...
94 2486 sjacqu01
 * boost::asio::ip::address_v4 local_interface =
95 2486 sjacqu01
 *   boost::asio::ip::address_v4::from_string("1.2.3.4");
96 2486 sjacqu01
 * boost::asio::ip::multicast::outbound_interface option(local_interface);
97 2486 sjacqu01
 * socket.set_option(option);
98 2486 sjacqu01
 * @endcode
99 2486 sjacqu01
 *
100 2486 sjacqu01
 * @par Concepts:
101 2486 sjacqu01
 * SettableSocketOption.
102 2486 sjacqu01
 */
103 2486 sjacqu01
#if defined(GENERATING_DOCUMENTATION)
104 2486 sjacqu01
typedef implementation_defined outbound_interface;
105 2486 sjacqu01
#else
106 2486 sjacqu01
typedef boost::asio::ip::detail::socket_option::network_interface<
107 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IP),
108 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IP_MULTICAST_IF),
109 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
110 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPV6_MULTICAST_IF)> outbound_interface;
111 2486 sjacqu01
#endif
112 2486 sjacqu01
113 2486 sjacqu01
/// Socket option for time-to-live associated with outgoing multicast packets.
114 2486 sjacqu01
/**
115 2486 sjacqu01
 * Implements the IPPROTO_IP/IP_MULTICAST_TTL socket option.
116 2486 sjacqu01
 *
117 2486 sjacqu01
 * @par Examples
118 2486 sjacqu01
 * Setting the option:
119 2486 sjacqu01
 * @code
120 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
121 2486 sjacqu01
 * ...
122 2486 sjacqu01
 * boost::asio::ip::multicast::hops option(4);
123 2486 sjacqu01
 * socket.set_option(option);
124 2486 sjacqu01
 * @endcode
125 2486 sjacqu01
 *
126 2486 sjacqu01
 * @par
127 2486 sjacqu01
 * Getting the current option value:
128 2486 sjacqu01
 * @code
129 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
130 2486 sjacqu01
 * ...
131 2486 sjacqu01
 * boost::asio::ip::multicast::hops option;
132 2486 sjacqu01
 * socket.get_option(option);
133 2486 sjacqu01
 * int ttl = option.value();
134 2486 sjacqu01
 * @endcode
135 2486 sjacqu01
 *
136 2486 sjacqu01
 * @par Concepts:
137 2486 sjacqu01
 * GettableSocketOption, SettableSocketOption.
138 2486 sjacqu01
 */
139 2486 sjacqu01
#if defined(GENERATING_DOCUMENTATION)
140 2486 sjacqu01
typedef implementation_defined hops;
141 2486 sjacqu01
#else
142 2486 sjacqu01
typedef boost::asio::ip::detail::socket_option::multicast_hops<
143 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IP),
144 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IP_MULTICAST_TTL),
145 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
146 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPV6_MULTICAST_HOPS)> hops;
147 2486 sjacqu01
#endif
148 2486 sjacqu01
149 2486 sjacqu01
/// Socket option determining whether outgoing multicast packets will be
150 2486 sjacqu01
/// received on the same socket if it is a member of the multicast group.
151 2486 sjacqu01
/**
152 2486 sjacqu01
 * Implements the IPPROTO_IP/IP_MULTICAST_LOOP socket option.
153 2486 sjacqu01
 *
154 2486 sjacqu01
 * @par Examples
155 2486 sjacqu01
 * Setting the option:
156 2486 sjacqu01
 * @code
157 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
158 2486 sjacqu01
 * ...
159 2486 sjacqu01
 * boost::asio::ip::multicast::enable_loopback option(true);
160 2486 sjacqu01
 * socket.set_option(option);
161 2486 sjacqu01
 * @endcode
162 2486 sjacqu01
 *
163 2486 sjacqu01
 * @par
164 2486 sjacqu01
 * Getting the current option value:
165 2486 sjacqu01
 * @code
166 2486 sjacqu01
 * boost::asio::ip::udp::socket socket(io_service);
167 2486 sjacqu01
 * ...
168 2486 sjacqu01
 * boost::asio::ip::multicast::enable_loopback option;
169 2486 sjacqu01
 * socket.get_option(option);
170 2486 sjacqu01
 * bool is_set = option.value();
171 2486 sjacqu01
 * @endcode
172 2486 sjacqu01
 *
173 2486 sjacqu01
 * @par Concepts:
174 2486 sjacqu01
 * GettableSocketOption, SettableSocketOption.
175 2486 sjacqu01
 */
176 2486 sjacqu01
#if defined(GENERATING_DOCUMENTATION)
177 2486 sjacqu01
typedef implementation_defined enable_loopback;
178 2486 sjacqu01
#else
179 2486 sjacqu01
typedef boost::asio::ip::detail::socket_option::multicast_enable_loopback<
180 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IP),
181 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IP_MULTICAST_LOOP),
182 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
183 2486 sjacqu01
  BOOST_ASIO_OS_DEF(IPV6_MULTICAST_LOOP)> enable_loopback;
184 2486 sjacqu01
#endif
185 2486 sjacqu01
186 2486 sjacqu01
} // namespace multicast
187 2486 sjacqu01
} // namespace ip
188 2486 sjacqu01
} // namespace asio
189 2486 sjacqu01
} // namespace boost
190 2486 sjacqu01
191 2486 sjacqu01
#include <boost/asio/detail/pop_options.hpp>
192 2486 sjacqu01
193 2486 sjacqu01
#endif // BOOST_ASIO_IP_MULTICAST_HPP