RESTinio
ip_blocker.hpp
Go to the documentation of this file.
1/*
2 * RESTinio
3 */
4
12#pragma once
13
15
16namespace restinio
17{
18
19namespace ip_blocker
20{
21
22//
23// inspection_result_t
24//
31{
33 deny,
35 allow
36};
37
43inline constexpr inspection_result_t
44deny() noexcept { return inspection_result_t::deny; }
45
51inline constexpr inspection_result_t
52allow() noexcept { return inspection_result_t::allow; }
53
54//
55// incoming_info_t
56//
64{
66
67public :
72 {}
73
77};
78
79//
80// noop_ip_blocker_t
81//
94{
95 // empty type by design.
96};
97
98} /* namespace ip_blocker */
99
100} /* namespace restinio */
101
An information about new incoming connection to be passed to IP-blocker object.
Definition: ip_blocker.hpp:64
endpoint_t remote_endpoint() const noexcept
Remote endpoint of the new connection.
Definition: ip_blocker.hpp:76
incoming_info_t(endpoint_t remote_endpoint)
Initializing constructor.
Definition: ip_blocker.hpp:69
constexpr inspection_result_t deny() noexcept
Shorthand for inspection_result_t::deny.
Definition: ip_blocker.hpp:44
inspection_result_t
Enumeration of result of inspecting new incoming connection.
Definition: ip_blocker.hpp:31
@ deny
New connection is disabled and should be closed.
@ allow
New connection is allowed to be processed further.
constexpr inspection_result_t allow() noexcept
Shorthand for inspection_result_t::allow.
Definition: ip_blocker.hpp:52
asio_ns::ip::tcp::endpoint endpoint_t
An alias for endpoint type from Asio.
The default no-op IP-blocker.
Definition: ip_blocker.hpp:94
#define const
Definition: zconf.h:230