Commit Graph
19 Commits
Author SHA1 Message Date
nutcas3 9b64366e25 refactor: Fix Rust edition, remove duplicate lint rule, and improve error handling in charging-engine and packet-gateway
- Change Rust edition from "2026" to "2024" in workspace Cargo.toml
- Remove duplicate expect_used lint rule from workspace lints
- Prefix unused account variable with underscore in calculate_usage_cost
- Split CARGO_MANIFEST_DIR assignment into separate variable in run_migrations
- Clone plan_id before moving plan in add_rating_plan handler
- Replace expect() with unwrap() in governor
2026-04-30 03:17:46 +03:00
nutcas3 4cc0b80b1c refactor: Remove unnecessary clone() calls and improve error handling in packet-gateway
- Remove clone() from rating plan parameter in add_rating_plan call
- Remove clone() calls from ChargingEngineClient and EbpfManager initialization
- Remove clone() from Redis client Arc wrapping
- Remove clone() calls from PacketGatewayConfig field assignments
- Replace expect() with proper error handling using map_err and anyhow in health check server
- Remove clone() from IP string in session data collection
2026-04-29 04:21:52 +03:00
nutcas3 1d489a0a8a refactor: Make eBPF dependencies optional and add conditional compilation support to packet-gateway
- Add ebpf feature flag to Cargo.toml with default disabled
- Make aya and aya-log dependencies optional and tied to ebpf feature
- Add #[cfg(feature = "ebpf")] conditional compilation directives for EbpfManager imports and usage
- Add feature-gated readiness check logic (ebpf_ok only checked when feature enabled)
- Add feature-gated metrics_handler implementations (full version with eBPF, stub version without)
- Change
2026-04-26 02:00:27 +03:00
nutcas3 95def1bcab refactor: Re-enable circuit breaker implementation and add conditional eBPF compilation support
- Uncomment CircuitBreaker and CircuitBreakerError imports in charging-engine
- Re-enable redis_circuit_breaker and postgres_circuit_breaker fields in ChargingEngine struct
- Add circuit breaker initialization with environment variable configuration (REDIS_FAILURE_THRESHOLD, REDIS_TIMEOUT, POSTGRES_FAILURE_THRESHOLD, POSTGRES_TIMEOUT)
- Add #[cfg(feature = "ebpf")] conditional compilation directives throughout
2026-04-26 01:50:29 +03:00
nutcas3 be6b6856fa feat: Add configurable logging with JSON and pretty format support to packet gateway
- Add LOG_FORMAT environment variable with compact/pretty format options
- Add LOG_JSON environment variable for JSON output toggle
- Add EnvFilter with INFO level default to tracing subscriber
- Enable target display in log output
- Add conditional initialization for JSON, pretty, and compact log formats
- Add startup log message showing active logging configuration
2026-04-25 05:54:13 +03:00
nutcas3 609eba2920 feat: Add comprehensive error handling and logging to eBPF sync operations with EbpfError types
- Replace ? operator with explicit error handling in sync_from_redis for credits and blocked users sync
- Add error logging before returning EbpfError::RedisFetchError in sync operations
- Replace generic map errors with EbpfError::MapNotFound and MapAccessError in trigger_sync
- Add match-based error handling with logging for sync_control map insert operation
- Replace generic map errors with EbpfError::MapNot
2026-04-25 05:53:39 +03:00
nutcas3 bc01fc1885 feat: Add structured error handling to eBPF operations with EbpfError types and error logging
- Add EbpfError import to ebpf.rs module
- Replace generic error messages with EbpfError::LoadError in program load operations
- Replace generic error messages with EbpfError::AttachError in XDP attach operations with interface field
- Replace generic error messages with EbpfError::MapNotFound and MapAccessError in map access operations
- Add error logging with error! macro before returning errors in all
2026-04-25 05:53:23 +03:00
nutcas3 5bb5e37e07 feat: Add eBPF error types with recoverability classification for packet gateway
- Add EbpfError enum with LoadError, AttachError, MapNotFound, MapAccessError, RedisSyncError, RedisFetchError, NotAttached, Timeout, and InvalidData variants
- Add is_recoverable method returning true for MapAccessError, RedisSyncError, RedisFetchError, and Timeout errors
- Add thiserror::Error derive for automatic error trait implementation
- Add interface and map_name fields to AttachError and MapAccessError variants
2026-04-25 05:52:57 +03:00
nutcas3 e121fb4266 feat: Add runtime configuration management API for packet gateway with sync interval and charging engine URL updates
- Add PacketGatewayConfig struct with interface, redis_url, charging_engine_url, sync_interval, and health_port fields
- Add ConfigUpdateRequest struct with optional sync_interval and charging_engine_url fields
- Add ConfigResponse struct with config and status fields
- Add ConfigState wrapper with Arc<RwLock<PacketGatewayConfig>> for thread-safe config access
- Add create_config_
2026-04-25 05:52:35 +03:00
nutcas3 91b8d53662 feat: Add charging engine integration with periodic usage reporting to packet gateway
- Add reqwest dependency with json feature to Cargo.toml
- Add charging_client module import and ChargingEngineClient initialization
- Add --charging-engine-url CLI argument with default http://localhost:3001
- Add periodic usage reporting every 60 seconds with batch processing
- Add IP-to-session-id mapping for usage events (format: session-{ip})
- Add async batch usage reporting with error logging on failure
- Add last
2026-04-25 05:29:00 +03:00
nutcas3 5ec4db009f feat: Add charging engine client with usage reporting and batch processing support
- Add ChargingEngineClient struct with reqwest HTTP client and configurable base URL
- Add report_usage method for single usage event reporting with volume conversion (bytes to MB)
- Add report_batch_usage method for processing multiple usage events with error tolerance
- Add UsageEvent and UsageResponse types for API request/response serialization
- Add tracing integration (info, warn, error) for usage reporting
2026-04-25 05:25:48 +03:00
nutcas3 f90882b4b2 refactor: Extract health checks and utility modules from packet-gateway ebpf module
- Extract health check handlers to new health.rs module (health, liveness, readiness, metrics endpoints)
- Extract IP conversion utilities to new ip_utils.rs module (u32_to_ipv4_string, ipv4_string_to_u32)
- Extract Redis synchronization logic to new redis_sync.rs module (RedisSyncer with sync_packet_stats, sync_credit_info, sync_credits_from_redis, sync_blocked_from_redis, sync_batch_entry methods)
- Refactor EbpfManager
2026-04-25 03:51:23 +03:00
nutcas3 5467e22d22 feat: Add metrics endpoint to packet-gateway health check server
- Add MetricsResponse struct with status, service, timestamp, tracked_ips, total_bytes_processed, and low_credit_users fields
- Add metrics_handler function calculating tracked IPs count, total bytes processed sum, and low credit users count from EbpfManager stats
- Add GET /metrics route to health check server
- Add ebpf_manager_clone state to health check server for metrics access
2026-04-25 03:46:05 +03:00
nutcas3 121cb60a62 feat: Add HTTP health check endpoints with Redis and eBPF status validation for packet-gateway
- Add axum, serde, serde_json, and chrono dependencies to Cargo.toml
- Add health_port CLI argument (defaults to 8081)
- Add /health endpoint returning basic health status
- Add /health/live endpoint for liveness checks (always returns alive if service is running)
- Add /health/ready endpoint for readiness checks with Redis connectivity and eBPF attachment validation
- Add AtomicBool to track eBPF attachment status across
2026-04-25 03:25:01 +03:00
nutcas3 6aea8af89e feat: Add batch sync mechanism to eBPF packet filter with sync_control flag, sync_buffer map, and stats aggregation
- Add sync_control BPF_MAP_TYPE_ARRAY map with single entry for sync flag control
- Add sync_buffer BPF_MAP_TYPE_PERCPU_ARRAY map with 1024 entries for batched sync data
- Add sync_entry struct with ip/bytes/credit/blocked/valid fields for data transfer
- Update sync_stats XDP program to check sync_control flag and reset after triggering
- Add packet_stats/user_credits/block_list map
2026-04-23 03:01:39 +03:00
nutcas3 316bb76eca feat: Add eBPF manager with XDP program loading, packet stats tracking, credit management, and bidirectional Redis synchronization
- Add EbpfManager struct with bpf/interface fields and PacketStats/SyncEntry/CreditInfo structs for data transfer
- Add new/attach methods for eBPF program loading and XDP attachment with BpfLogger initialization
- Add get_packet_stats/get_credit_info methods for reading packet_stats and user_credits maps
- Add update_user_credit/block_user methods for modifying user
2026-04-23 03:01:09 +03:00
nutcas3 3d868580ae feat: Add eBPF manager integration with XDP program loading, bidirectional Redis sync, and graceful shutdown handling
- Add EbpfManager import and initialization with interface parameter and attach method for XDP program loading
- Add initial sync from Redis to eBPF maps on startup with context error handling
- Replace simulated packet processing with sync_batch_to_redis for eBPF-to-Redis data transfer and sync_from_redis for credit updates
- Add periodic stats logging (every 10 iterations) with
2026-04-23 03:00:49 +03:00
nutcas3 f898e9d206 feat: Add eBPF packet filter for credit-based traffic control
- Add XDP-based packet filtering with credit balance enforcement
- Create BPF hash maps for packet statistics, user credits, and block list tracking
- Implement packet size calculation and IP address extraction helpers
- Add credit deduction logic based on packet byte count
- Block packets when user credit balance falls below threshold
- Track bidirectional packet statistics for source and destination IPs
- Include sync_stats hook for periodic Redis
2026-04-14 03:29:00 +03:00
nutcas3 b69b7ec087 feat: Initialize telecom platform with core services and infrastructure
- Add Go-based API server and carrier connector services
- Add Rust-based charging engine and packet gateway services
- Add Docker Compose configuration for local development
- Add comprehensive documentation (API, Architecture, Deployment)
- Add development scripts for Redis, MongoDB, and environment setup
- Add workspace configuration for Go modules and pnpm
- Remove unnecessary documentation files from web-dashboard
- Add project build configuration (Makefile, Cargo.toml)

This commit establishes the foundational microservices architecture for the sovereign Telecom-as-a-Service platform.
2026-04-03 19:55:38 +03:00