ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
errors.h
Go to the documentation of this file.
1#pragma once
2
11#include "common.h"
12#include "platform/socket.h"
13#include "network/acip/acds.h"
15#include <stddef.h>
16#include <stdbool.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
33
46
63bool check_and_record_rate_limit(rate_limiter_t *rate_limiter, const char *client_ip, rate_event_type_t event_type,
64 socket_t client_socket, const char *operation_name);
65
86bool check_and_record_packet_rate_limit(rate_limiter_t *rate_limiter, const char *client_ip, socket_t client_socket,
87 packet_type_t packet_type);
88
89#ifdef __cplusplus
90}
91#endif
asciichat_error_t error_code
bool check_and_record_rate_limit(rate_limiter_t *rate_limiter, const char *client_ip, rate_event_type_t event_type, socket_t client_socket, const char *operation_name)
Check rate limit and send error if exceeded.
Definition errors.c:38
asciichat_error_t send_error_packet(socket_t sockfd, asciichat_error_t error_code)
Send an ACIP error packet using asciichat_error_t.
Definition errors.c:11
bool check_and_record_packet_rate_limit(rate_limiter_t *rate_limiter, const char *client_ip, socket_t client_socket, packet_type_t packet_type)
Map packet type to rate event type and check rate limit.
Definition errors.c:54
asciichat_error_t send_error_packet_message(socket_t sockfd, asciichat_error_t error_code, const char *message)
Send an ACIP error packet with custom message.
Definition errors.c:15
asciichat_error_t
Error and exit codes - unified status values (0-255)
Definition error_codes.h:46
packet_type_t
Network protocol packet type enumeration.
Definition packet.h:281
int socket_t
Socket handle type (POSIX: int)
Definition socket.h:50
ASCII-Chat Discovery Service (ACDS) Protocol Message Formats.
🚦 Rate limiting API with pluggable backends
rate_event_type_t
Rate limit event types.
Definition rate_limit.h:46
Cross-platform socket interface for ascii-chat.
Rate limiter structure.
Definition rate_limit.c:63