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