| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- # -*- coding: utf-8 -*-
- """
- Trixy Netzwerk-Protokoll und Kommunikation.
- Bietet:
- - Protocol: Binärprotokoll für Trixy-Kommunikation
- - Encryption: AES-256-GCM Verschlüsselung
- - Security: Whitelist/Blacklist, Rate-Limiting, DDoS-Schutz
- - TLS: Zertifikatsverwaltung und sichere Verbindungen
- - Pool: Connection-Pooling für effiziente Verbindungen
- - Retry: Robuste Retry-Strategien mit Backoff
- - KeepAlive: Verbindungsüberwachung mit Ping/Pong
- - Compression: Datenkomprimierung für Übertragung
- - RPC: Request-Response Korrelation
- - Service: TCP-Server für Server-seitige Kommunikation
- - ClientConnection: Client-seitige Verbindung zum Server
- - MessageHandler: Nachrichtenverarbeitung und Event-Bridge
- """
- # Core Protocol
- from trixy_core.network.protocol import TrixyProtocol, ProtocolFlags, ProtocolMessage
- from trixy_core.network.encryption import TrixyEncryption
- # Transport Layer
- from trixy_core.network.service import NetworkService, ClientHandler, AudioStreamHandler
- from trixy_core.network.client_connection import ClientConnection, ConnectionConfig, get_mac_address
- from trixy_core.network.message_handler import (
- MessageHandler,
- EventBridge,
- setup_default_event_bridge,
- DEFAULT_EVENT_MAPPINGS,
- )
- # Retry
- from trixy_core.network.retry import (
- NetworkRetry,
- RetryConfig,
- RetryStrategy,
- RetryStats,
- RetryContext,
- RetryPolicy,
- RetryableError,
- NonRetryableError,
- with_retry,
- AGGRESSIVE_RETRY,
- CONSERVATIVE_RETRY,
- FAST_FAIL_RETRY,
- )
- # KeepAlive
- from trixy_core.network.keepalive import (
- KeepAliveManager,
- KeepAliveSession,
- KeepAliveConfig,
- ConnectionStats as KeepAliveStats,
- ConnectionState as KeepAliveState,
- )
- # Compression
- from trixy_core.network.compression import (
- Compressor,
- CompressionLevel,
- CompressionStats,
- ZlibCompressor,
- CompressionRegistry,
- get_default_registry as get_compression_registry,
- get_compressor,
- )
- # RPC
- from trixy_core.network.rpc import (
- CorrelationManager,
- CorrelationConfig,
- PendingRequest,
- RequestState,
- )
- # Security
- from trixy_core.network.security import (
- # Access Control
- AccessController,
- AccessRule,
- AccessDecision,
- IPMatcher,
- CIDRMatcher,
- MACMatcher,
- # Rate Limiting
- ConnectionRateLimiter,
- RateLimitConfig,
- RateLimitResult,
- IPRateLimiter,
- GlobalRateLimiter,
- # DDoS Protection
- DDoSProtection,
- DDoSConfig,
- ThreatLevel,
- ConnectionTracker,
- SuspiciousActivityDetector,
- )
- # TLS
- from trixy_core.network.tls import (
- TLSConfig,
- TLSVersion,
- CipherSuite,
- TLSManager,
- CertificateInfo,
- CertificateGenerator,
- CertificateRequest,
- KeyType,
- )
- # Connection Pool
- from trixy_core.network.pool import (
- Connection,
- ConnectionState,
- ConnectionInfo,
- ConnectionPool,
- PoolConfig,
- PoolStatistics,
- HealthChecker,
- HealthCheckConfig,
- HealthStatus,
- )
- __all__ = [
- # Core Protocol
- "TrixyProtocol",
- "ProtocolFlags",
- "ProtocolMessage",
- "TrixyEncryption",
- # Transport Layer
- "NetworkService",
- "ClientHandler",
- "AudioStreamHandler",
- "ClientConnection",
- "ConnectionConfig",
- "get_mac_address",
- "MessageHandler",
- "EventBridge",
- "setup_default_event_bridge",
- "DEFAULT_EVENT_MAPPINGS",
- # Security - Access Control
- "AccessController",
- "AccessRule",
- "AccessDecision",
- "IPMatcher",
- "CIDRMatcher",
- "MACMatcher",
- # Security - Rate Limiting
- "ConnectionRateLimiter",
- "RateLimitConfig",
- "RateLimitResult",
- "IPRateLimiter",
- "GlobalRateLimiter",
- # Security - DDoS Protection
- "DDoSProtection",
- "DDoSConfig",
- "ThreatLevel",
- "ConnectionTracker",
- "SuspiciousActivityDetector",
- # TLS
- "TLSConfig",
- "TLSVersion",
- "CipherSuite",
- "TLSManager",
- "CertificateInfo",
- "CertificateGenerator",
- "CertificateRequest",
- "KeyType",
- # Connection Pool
- "Connection",
- "ConnectionState",
- "ConnectionInfo",
- "ConnectionPool",
- "PoolConfig",
- "PoolStatistics",
- "HealthChecker",
- "HealthCheckConfig",
- "HealthStatus",
- # Retry
- "NetworkRetry",
- "RetryConfig",
- "RetryStrategy",
- "RetryStats",
- "RetryContext",
- "RetryPolicy",
- "RetryableError",
- "NonRetryableError",
- "with_retry",
- "AGGRESSIVE_RETRY",
- "CONSERVATIVE_RETRY",
- "FAST_FAIL_RETRY",
- # KeepAlive
- "KeepAliveManager",
- "KeepAliveSession",
- "KeepAliveConfig",
- "KeepAliveStats",
- "KeepAliveState",
- # Compression
- "Compressor",
- "CompressionLevel",
- "CompressionStats",
- "ZlibCompressor",
- "CompressionRegistry",
- "get_compression_registry",
- "get_compressor",
- # RPC
- "CorrelationManager",
- "CorrelationConfig",
- "PendingRequest",
- "RequestState",
- ]
|