Electroneum
Loading...
Searching...
No Matches
command_server.h
Go to the documentation of this file.
1
11
12
// Copyrights(c) 2017-2021, The Electroneum Project
13
// Copyrights(c) 2014-2019, The Monero Project
14
//
15
// All rights reserved.
16
//
17
// Redistribution and use in source and binary forms, with or without modification, are
18
// permitted provided that the following conditions are met:
19
//
20
// 1. Redistributions of source code must retain the above copyright notice, this list of
21
// conditions and the following disclaimer.
22
//
23
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
24
// of conditions and the following disclaimer in the documentation and/or other
25
// materials provided with the distribution.
26
//
27
// 3. Neither the name of the copyright holder nor the names of its contributors may be
28
// used to endorse or promote products derived from this software without specific
29
// prior written permission.
30
//
31
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
32
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
34
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
38
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
39
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
41
#pragma once
42
43
#include <boost/optional/optional_fwd.hpp>
44
#include "
common/common_fwd.h
"
45
#include "
console_handler.h
"
46
#include "
daemon/command_parser_executor.h
"
47
#include "
net/net_fwd.h
"
48
49
namespace
daemonize
{
50
51
class
t_command_server
{
52
private
:
53
t_command_parser_executor
m_parser;
54
epee::console_handlers_binder
m_command_lookup;
55
bool
m_is_rpc;
56
57
public
:
58
t_command_server
(
59
uint32_t
ip
60
,
uint16_t
port
61
,
const
boost::optional<tools::login>& login
62
,
const
epee::net_utils::ssl_options_t
& ssl_options
63
,
bool
is_rpc =
true
64
,
cryptonote::core_rpc_server
* rpc_server = NULL
65
);
66
67
bool
process_command_str
(
const
std::string& cmd);
68
69
bool
process_command_vec
(
const
std::vector<std::string>& cmd);
70
71
bool
start_handling
(std::function<
void
(
void
)> exit_handler = NULL);
72
73
void
stop_handling
();
74
75
private
:
76
bool
help(
const
std::vector<std::string>& args);
77
78
std::string get_commands_str();
79
std::string get_command_usage(
const
std::vector<std::string> &args);
80
};
81
82
}
// namespace daemonize
cryptonote::core_rpc_server
Definition
core_rpc_server.h:59
daemonize::t_command_parser_executor
Definition
command_parser_executor.h:50
daemonize::t_command_server::stop_handling
void stop_handling()
Definition
command_server.cpp:365
daemonize::t_command_server::process_command_vec
bool process_command_vec(const std::vector< std::string > &cmd)
Definition
command_server.cpp:346
daemonize::t_command_server::process_command_str
bool process_command_str(const std::string &cmd)
Definition
command_server.cpp:341
daemonize::t_command_server::start_handling
bool start_handling(std::function< void(void)> exit_handler=NULL)
Definition
command_server.cpp:356
daemonize::t_command_server::t_command_server
t_command_server(uint32_t ip, uint16_t port, const boost::optional< tools::login > &login, const epee::net_utils::ssl_options_t &ssl_options, bool is_rpc=true, cryptonote::core_rpc_server *rpc_server=NULL)
Definition
command_server.cpp:43
epee::console_handlers_binder
Definition
console_handler.h:544
epee::net_utils::ssl_options_t
Definition
net_ssl.h:74
command_parser_executor.h
common_fwd.h
console_handler.h
daemonize
Definition
command_parser_executor.cpp:38
net_fwd.h
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
src
daemon
command_server.h
Generated on
for Electroneum by
1.16.1