STTNet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
sttnet_English.h File Reference
#include <jsoncpp/json/json.h>
#include <string_view>
#include <string>
#include <atomic>
#include <iostream>
#include <unistd.h>
#include <sys/stat.h>
#include <fstream>
#include <fcntl.h>
#include <sstream>
#include <mutex>
#include <chrono>
#include <iomanip>
#include <random>
#include <cmath>
#include <thread>
#include <openssl/sha.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <cstring>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/buffer.h>
#include <functional>
#include <list>
#include <queue>
#include <sys/epoll.h>
#include <condition_variable>
#include <regex>
#include <unordered_map>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/crypto.h>
#include <signal.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/wait.h>
#include <sys/shm.h>
#include <type_traits>
#include <charconv>
#include <any>
#include <sys/eventfd.h>
#include <sys/timerfd.h>

Go to the source code of this file.

Classes

class  stt::file::FileTool
 A utility class that provides static functions for file operations. More...
 
struct  stt::file::FileThreadLock
 A structure that records the relationship between files and threads. More...
 
class  stt::file::File
 A class for reading and writing disk files. More...
 
struct  stt::time::Duration
 A structure representing a time interval, supporting granularity in days, hours, minutes, seconds, and milliseconds. More...
 
class  stt::time::DateTime
 Class for time operations, calculations, and timing. More...
 
class  stt::file::LogFile
 Log file operation class. More...
 
class  stt::data::CryptoUtil
 Responsible for encryption, decryption, and hashing. More...
 
class  stt::data::BitUtil
 Responsible for conversion between binary data and strings. More...
 
class  stt::data::RandomUtil
 Related to random number and string generation. More...
 
class  stt::data::NetworkOrderUtil
 Responsible for endianness conversion. More...
 
class  stt::data::PrecisionUtil
 Responsible for floating-point precision processing. More...
 
class  stt::data::HttpStringUtil
 Responsible for HTTP string and URL parsing Including functions to extract parameters, IP, port, request header fields, etc., from URLs or request messages. More...
 
class  stt::data::WebsocketStringUtil
 Responsible for string operations related to the WebSocket protocol. More...
 
class  stt::data::NumberStringConvertUtil
 Responsible for conversion between strings and numbers. More...
 
class  stt::data::EncodingUtil
 Data encoding/decoding, mask processing, etc. More...
 
class  stt::data::JsonHelper
 class of solving json data More...
 
struct  stt::security::RateState
 Runtime state for one limiter key (reused by multiple strategies). More...
 
struct  stt::security::ConnectionState
 Security and limiter state for a single connection (fd). More...
 
struct  stt::security::IPInformation
 Security state and connection set for a single IP. More...
 
class  stt::security::ConnectionLimiter
 Unified connection & request security gate (IP-level + fd-level, multi-strategy limiting + blacklist). More...
 
class  stt::network::TcpFDHandler
 TCP socket operation class. More...
 
class  stt::network::TcpClient
 TCP client operation class. More...
 
class  stt::network::HttpClient
 Http/Https client operation class. More...
 
class  stt::network::EpollSingle
 Listen to a single handle with epoll. More...
 
class  stt::network::WebSocketClient
 Websocket client operation class. More...
 
struct  stt::network::HttpRequestInformation
 Structure to save HTTP/HTTPS request information. More...
 
class  stt::network::HttpServerFDHandler
 Operation class for parsing and responding to Http/https requests Only pass in the socket, then use this class for Http operations. More...
 
struct  stt::network::WebSocketFDInformation
 Structure to save client WS/WSS request information. More...
 
struct  stt::network::TcpInformation
 Save TCP client information. More...
 
struct  stt::network::TcpFDInf
 Structure to save TCP client information. More...
 
struct  stt::network::WorkerMessage
 Data structure for pushing tasks into a completion queue after they are completed at the work site. More...
 
class  stt::network::TcpServer
 Tcp server class. More...
 
class  stt::network::HttpServer
 Http/HttpServer server operation class. More...
 
class  stt::network::WebSocketServerFDHandler
 WebSocket protocol operation class Only pass in the socket, then use this class for WebSocket operations. More...
 
class  stt::network::WebSocketServer
 WebSocketServer server operation class. More...
 
class  stt::network::UdpFDHandler
 UDP operation class Pass in the socket for UDP protocol operations. More...
 
class  stt::network::UdpClient
 Udp client operation class. More...
 
class  stt::network::UdpServer
 Udp server operation class. More...
 
class  stt::system::ServerSetting
 Class for initializing the service system. More...
 
class  stt::system::csemp
 Synchronization tool class encapsulating System V semaphores. More...
 
struct  stt::system::ProcessInf
 Structure for process information. More...
 
class  stt::system::HBSystem
 Class responsible for process heartbeat monitoring and scheduling Used to monitor service processes and ensure they continue to run effectively After the process ends, the shared memory at 0x5095 and the semaphore are not deleted Currently only supports processes with up to three parameters to join monitoring The logic of joining the heartbeat monitoring system, updating heartbeats, and checking the heartbeat system should be manually written in the program. This class only provides call interfaces. More...
 
class  stt::system::Process
 Static utility class for process management. More...
 
class  stt::system::WorkerPool
 Fixed-size worker thread pool. More...
 

Namespaces

 stt
 
 stt::system
 System settings, process control, heartbeat monitoring, etc.
 
 stt::file
 File-related operations: file reading and writing, logging, etc.
 
 stt::time
 Time-related operations, basic time tools.
 
 stt::data
 Data processing.
 
 stt::security
 API related to information security.
 
 stt::network
 Network framework, protocols, communication, and IO multiplexing related.
 

Macros

#define ISO8086A   "yyyy-mm-ddThh:mi:ss"
 Define the macro ISO8086A as "yyyy-mm-ddThh:mi:ss". More...
 
#define ISO8086B   "yyyy-mm-ddThh:mi:ss.sss"
 Define the macro ISO8086B as "yyyy-mm-ddThh:mi:ss.sss". More...
 
#define MAX_PROCESS_NAME   100
 Define the macro MAX_PROCESS_NAME as 100, meaning the process name in process information does not exceed 100 bytes. More...
 
#define MAX_PROCESS_INF   1000
 Define the macro MAX_PROCESS_INF as 1000, meaning the process information table records up to 1000 process information entries. More...
 
#define SHARED_MEMORY_KEY   0x5095
 Define the macro SHARED_MEMORY_KEY as 0x5095, meaning the shared memory key for the process information table is 0x5095. More...
 
#define SHARED_MEMORY_LOCK_KEY   0x5095
 Define the macro SHARED_MEMORY_LOCK_KEY as 0x5095, meaning the semaphore key for operating the process information table is 0x5095. More...
 

Typedefs

using stt::time::Milliseconds = std::chrono::duration< uint64_t, std::milli >
 
using stt::time::Seconds = std::chrono::duration< uint64_t >
 
using stt::system::Task = std::function< void()>
 

Enumerations

enum  stt::security::RateLimitType { stt::security::RateLimitType::Cooldown, stt::security::RateLimitType::FixedWindow, stt::security::RateLimitType::SlidingWindow, stt::security::RateLimitType::TokenBucket }
 Rate limiting algorithm / strategy type. More...
 
enum  stt::security::DefenseDecision : int { stt::security::ALLOW = 0, stt::security::DROP = 1, stt::security::CLOSE = 2 }
 Security decision returned by ConnectionLimiter. More...
 
enum  stt::network::TLSState : uint8_t { stt::network::TLSState::NONE = 0, stt::network::TLSState::HANDSHAKING, stt::network::TLSState::ESTABLISHED, stt::network::TLSState::ERROR }
 

Functions

std::ostream & stt::time::operator<< (std::ostream &os, const Duration &a)
 Output the Duration object to a stream in a readable format. More...
 

Macro Definition Documentation

#define ISO8086A   "yyyy-mm-ddThh:mi:ss"

Define the macro ISO8086A as "yyyy-mm-ddThh:mi:ss".

#define ISO8086B   "yyyy-mm-ddThh:mi:ss.sss"

Define the macro ISO8086B as "yyyy-mm-ddThh:mi:ss.sss".

#define MAX_PROCESS_INF   1000

Define the macro MAX_PROCESS_INF as 1000, meaning the process information table records up to 1000 process information entries.

#define MAX_PROCESS_NAME   100

Define the macro MAX_PROCESS_NAME as 100, meaning the process name in process information does not exceed 100 bytes.

#define SHARED_MEMORY_KEY   0x5095

Define the macro SHARED_MEMORY_KEY as 0x5095, meaning the shared memory key for the process information table is 0x5095.

#define SHARED_MEMORY_LOCK_KEY   0x5095

Define the macro SHARED_MEMORY_LOCK_KEY as 0x5095, meaning the semaphore key for operating the process information table is 0x5095.