1//
2// ip/unicast.hpp
3// ~~~~~~~~~~~~~~
4//
5// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6//
7// Distributed under the Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9//
10
11#ifndef BOOST_ASIO_IP_UNICAST_HPP
12#define BOOST_ASIO_IP_UNICAST_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19#include <cstddef>
20#include <boost/asio/ip/detail/socket_option.hpp>
21
22#include <boost/asio/detail/push_options.hpp>
23
24namespace boost {
25namespace asio {
26namespace ip {
27namespace unicast {
28
29/// Socket option for time-to-live associated with outgoing unicast packets.
30/**
31 * Implements the IPPROTO_IP/IP_UNICAST_TTL socket option.
32 *
33 * @par Examples
34 * Setting the option:
35 * @code
36 * boost::asio::ip::udp::socket socket(my_context);
37 * ...
38 * boost::asio::ip::unicast::hops option(4);
39 * socket.set_option(option);
40 * @endcode
41 *
42 * @par
43 * Getting the current option value:
44 * @code
45 * boost::asio::ip::udp::socket socket(my_context);
46 * ...
47 * boost::asio::ip::unicast::hops option;
48 * socket.get_option(option);
49 * int ttl = option.value();
50 * @endcode
51 *
52 * @par Concepts:
53 * GettableSocketOption, SettableSocketOption.
54 */
55#if defined(GENERATING_DOCUMENTATION)
56typedef implementation_defined hops;
57#else
58typedef boost::asio::ip::detail::socket_option::unicast_hops<
59 BOOST_ASIO_OS_DEF(IPPROTO_IP),
60 BOOST_ASIO_OS_DEF(IP_TTL),
61 BOOST_ASIO_OS_DEF(IPPROTO_IPV6),
62 BOOST_ASIO_OS_DEF(IPV6_UNICAST_HOPS)> hops;
63#endif
64
65} // namespace unicast
66} // namespace ip
67} // namespace asio
68} // namespace boost
69
70#include <boost/asio/detail/pop_options.hpp>
71
72#endif // BOOST_ASIO_IP_UNICAST_HPP
73

source code of boost/libs/asio/include/boost/asio/ip/unicast.hpp