MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
failed_attempts_list_imp.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2024, Oracle and/or its affiliates.
3*/
4#ifndef CONNECTION_CONTROL_FAILED_ATTEMPTS_LIST_IMP_H
5#define CONNECTION_CONTROL_FAILED_ATTEMPTS_LIST_IMP_H
6
7#include <map>
8#include <shared_mutex>
11
12namespace connection_control {
14 public:
15 void failed_attempts_define(const char *userhost);
16 bool failed_attempts_undefine(const char *userhost);
17
18 /**
19 Fetch a copy of the queue data to return to a PFS table
20 @retval the data to put in the PFS table
21 */
23 unsigned long long get_failed_attempts_list_count();
24 unsigned long long get_failed_attempts_count(const char *userhost);
25 void reset();
26
27 private:
28 //* A case insensitive comparator using the C library */
29 struct ciLessLibC {
30 bool operator()(const std::string &lhs, const std::string &rhs) const {
31#if defined _WIN32
32 return _stricmp(lhs.c_str(), rhs.c_str()) < 0;
33#else
34 return strcasecmp(lhs.c_str(), rhs.c_str()) < 0;
35#endif
36 }
37 };
38 std::map<std::string, PSI_ulong, ciLessLibC> failed_attempts_map;
41};
42} // namespace connection_control
44
45#endif /* CONNECTION_CONTROL_FAILED_ATTEMPTS_LIST_IMP_H */
Definition: connection_control_memory.h:41
Definition: failed_attempts_list_imp.h:13
unsigned long long get_failed_attempts_list_count()
Definition: connection_control_pfs_table.cc:54
void reset()
Definition: connection_control_pfs_table.cc:69
bool failed_attempts_undefine(const char *userhost)
Definition: connection_control_pfs_table.cc:34
Connection_control_pfs_table_data * copy_pfs_table_data()
Fetch a copy of the queue data to return to a PFS table.
Definition: connection_control_pfs_table.cc:40
void failed_attempts_define(const char *userhost)
Definition: connection_control_pfs_table.cc:21
std::shared_mutex LOCK_shared_failed_attempts_list
Definition: failed_attempts_list_imp.h:40
unsigned long long get_failed_attempts_count(const char *userhost)
Definition: connection_control_pfs_table.cc:59
std::map< std::string, PSI_ulong, ciLessLibC > failed_attempts_map
Definition: failed_attempts_list_imp.h:38
std::mutex LOCK_failed_attempts_list
Definition: failed_attempts_list_imp.h:39
connection_control::Failed_attempts_list_imp g_failed_attempts_list
Definition: connection_control.cc:50
Definition: connection_control.h:70
std::vector< Connection_control_pfs_table_data_row, CustomAllocator< Connection_control_pfs_table_data_row > > Connection_control_pfs_table_data
Definition: connection_control_pfs_table.h:60
Definition: failed_attempts_list_imp.h:29
bool operator()(const std::string &lhs, const std::string &rhs) const
Definition: failed_attempts_list_imp.h:30