27#include <netinet/in.h>
33#include <seastar/core/future.hh>
34#include <seastar/core/sstring.hh>
35#include <seastar/util/modules.hh>
40SEASTAR_MODULE_EXPORT_BEGIN
47 using invalid_argument::invalid_argument;
52 enum class family : sa_family_t {
53 INET = AF_INET, INET6 = AF_INET6
63 uint32_t _scope = invalid_scope;
65 static constexpr uint32_t invalid_scope = std::numeric_limits<uint32_t>::max();
70 inet_address(::in6_addr i, uint32_t scope = invalid_scope)
noexcept;
88 family in_family()
const noexcept {
92 bool is_ipv6()
const noexcept {
93 return _in_family == family::INET6;
95 bool is_ipv4()
const noexcept {
96 return _in_family == family::INET;
99 size_t size()
const noexcept;
100 const void * data()
const noexcept;
102 uint32_t scope()
const noexcept {
107 operator ::in_addr()
const;
108 operator ::in6_addr()
const noexcept;
120 static std::optional<inet_address> parse_numerical(
const sstring&);
122 bool is_loopback()
const noexcept;
123 bool is_addr_any()
const noexcept;
126std::ostream& operator<<(std::ostream&,
const inet_address&);
127std::ostream& operator<<(std::ostream&,
const inet_address::family&);
129SEASTAR_MODULE_EXPORT_END
141#if FMT_VERSION >= 90000
142template <>
struct fmt::formatter<
seastar::net::inet_address> : fmt::ostream_formatter {};
143template <>
struct fmt::formatter<
seastar::net::inet_address::family> : fmt::ostream_formatter {};
A representation of a possibly not-yet-computed value.
Definition: future.hh:1240
Definition: inet_address.hh:50
Definition: inet_address.hh:45
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
Definition: ipv4_address.hh:35
Definition: ipv6_address.hh:34