24#include <seastar/net/api.hh>
25#include <seastar/core/internal/api-level.hh>
26#include <seastar/core/memory.hh>
33class connected_socket_impl {
35 virtual ~connected_socket_impl() {}
36 virtual data_source source() = 0;
37 virtual data_source source(connected_socket_input_stream_config csisc);
38 virtual data_sink sink() = 0;
39 virtual void shutdown_input() = 0;
40 virtual void shutdown_output() = 0;
41 virtual void set_nodelay(
bool nodelay) = 0;
42 virtual bool get_nodelay()
const = 0;
43 virtual void set_keepalive(
bool keepalive) = 0;
44 virtual bool get_keepalive()
const = 0;
45 virtual void set_keepalive_parameters(
const keepalive_params&) = 0;
46 virtual keepalive_params get_keepalive_parameters()
const = 0;
47 virtual void set_sockopt(
int level,
int optname,
const void* data,
size_t len) = 0;
48 virtual int get_sockopt(
int level,
int optname,
void* data,
size_t len)
const = 0;
49 virtual socket_address local_address() const noexcept = 0;
50 virtual socket_address remote_address() const noexcept = 0;
51 virtual future<> wait_input_shutdown() = 0;
56 socket_impl() =
default;
57 socket_impl(
const socket_impl&) =
delete;
58 socket_impl(socket_impl&&) =
default;
59 virtual ~socket_impl() {}
60 virtual future<connected_socket>
connect(socket_address sa, socket_address local, transport proto = transport::TCP) = 0;
61 virtual void set_reuseaddr(
bool reuseaddr) = 0;
62 virtual bool get_reuseaddr()
const = 0;
63 virtual void shutdown() = 0;
67class server_socket_impl {
69 virtual ~server_socket_impl() {}
70 virtual future<accept_result> accept() = 0;
71 virtual void abort_accept() = 0;
72 virtual socket_address local_address()
const = 0;
75class datagram_channel_impl {
77 virtual ~datagram_channel_impl() {}
78 virtual socket_address local_address()
const = 0;
79 virtual future<datagram> receive() = 0;
80 virtual future<> send(
const socket_address& dst,
const char* msg) = 0;
81 virtual future<> send(
const socket_address& dst, packet p) = 0;
82 virtual void shutdown_input() = 0;
83 virtual void shutdown_output() = 0;
84 virtual bool is_closed()
const = 0;
85 virtual void close() = 0;
88using udp_channel_impl = datagram_channel_impl;
90class network_interface_impl {
92 network_interface_impl() =
default;
93 network_interface_impl(
const network_interface_impl&) =
default;
94 virtual ~network_interface_impl() {}
96 virtual uint32_t index()
const = 0;
97 virtual uint32_t mtu()
const = 0;
99 virtual const sstring& name()
const = 0;
100 virtual const sstring& display_name()
const = 0;
101 virtual const std::vector<net::inet_address>& addresses()
const = 0;
102 virtual const std::vector<uint8_t> hardware_address()
const = 0;
104 virtual bool is_loopback()
const = 0;
105 virtual bool is_virtual()
const = 0;
106 virtual bool is_up()
const = 0;
107 virtual bool supports_ipv6()
const = 0;
future< connected_socket > connect(socket_address sa)
Seastar API namespace.
Definition: abort_on_ebadf.hh:26