78 lines
2.8 KiB
Zig
78 lines
2.8 KiB
Zig
//! Core module - fundamental types and utilities for P2P networking
|
|
//!
|
|
//! This module provides the foundational building blocks including
|
|
//! error handling, address management, buffer operations, socket I/O,
|
|
//! and connection management.
|
|
|
|
pub const errors = @import("core/error.zig");
|
|
pub const address = @import("core/address.zig");
|
|
pub const buffer = @import("core/buffer.zig");
|
|
pub const socket = @import("core/socket.zig");
|
|
pub const connection = @import("core/connection.zig");
|
|
pub const rate_limiter = @import("core/rate_limiter.zig");
|
|
pub const limits = @import("core/limits.zig");
|
|
pub const tracking_allocator = @import("core/tracking_allocator.zig");
|
|
pub const log = @import("core/log.zig");
|
|
|
|
// Re-export commonly used types
|
|
pub const Error = errors.Error;
|
|
pub const ErrorInfo = errors.ErrorInfo;
|
|
pub const ErrorContext = errors.ErrorContext;
|
|
|
|
pub const Address = address.Address;
|
|
|
|
pub const Socket = socket.Socket;
|
|
pub const SocketProtocol = socket.SocketProtocol;
|
|
pub const SocketConfig = socket.SocketConfig;
|
|
pub const SocketState = socket.SocketState;
|
|
pub const SocketFactory = socket.SocketFactory;
|
|
pub const SocketManager = socket.SocketManager;
|
|
pub const MockSocket = socket.MockSocket;
|
|
pub const MockSocketConfig = socket.MockSocketConfig;
|
|
pub const ReceiveFromResult = socket.ReceiveFromResult;
|
|
|
|
pub const Connection = connection.Connection;
|
|
pub const ConnectionState = connection.ConnectionState;
|
|
pub const ConnectionConfig = connection.ConnectionConfig;
|
|
pub const ConnectionPool = connection.ConnectionPool;
|
|
|
|
// Buffer types
|
|
pub const BufferPool = buffer.BufferPool;
|
|
pub const StreamBuffer = buffer.StreamBuffer;
|
|
pub const PacketBuffer = buffer.PacketBuffer;
|
|
pub const MessageBuffer = buffer.MessageBuffer;
|
|
pub const BufferManager = buffer.BufferManager;
|
|
|
|
// Rate limiting
|
|
pub const RateLimiter = rate_limiter.RateLimiter;
|
|
pub const PeerRateLimiter = rate_limiter.PeerRateLimiter;
|
|
pub const ConnectionRateLimiter = rate_limiter.ConnectionRateLimiter;
|
|
|
|
// MED-12 FIX: Centralized limits configuration
|
|
pub const Limits = limits.Limits;
|
|
pub const FileLimits = limits.FileLimits;
|
|
pub const NetworkLimits = limits.NetworkLimits;
|
|
pub const DhtLimits = limits.DhtLimits;
|
|
pub const RateLimits = limits.RateLimits;
|
|
pub const MemoryLimits = limits.MemoryLimits;
|
|
pub const SecurityLimits = limits.SecurityLimits;
|
|
|
|
// CRIT-8 FIX: Global memory tracking allocator
|
|
pub const TrackingAllocator = tracking_allocator.TrackingAllocator;
|
|
pub const initGlobalTracker = tracking_allocator.initGlobal;
|
|
pub const initGlobalTrackerWithLimit = tracking_allocator.initGlobalWithLimit;
|
|
pub const getGlobalTracker = tracking_allocator.getGlobal;
|
|
|
|
test {
|
|
// Run inline tests from all submodules
|
|
_ = errors;
|
|
_ = address;
|
|
_ = buffer;
|
|
_ = socket;
|
|
_ = connection;
|
|
_ = rate_limiter;
|
|
_ = limits;
|
|
_ = tracking_allocator;
|
|
_ = log;
|
|
}
|