- Add detailed logging for `CreatePeer` and `UpdatePeer` operations to track input and processed data.
- Simplify `SetSubscriptions`, `SetCustomPrefixes`, and `SetCustomAsns` calls by removing conditional checks.
- Replace null checks with defaults for `CustomPrefixes` and `CustomAsns` to streamline processing.
- Consolidate prefix parsing logic and ensure consistent handling of invalid CIDRs.
- Send RU default prefixes to unconfigured peers with no subscriptions, custom prefixes, or ASNs.
- Implement fallback to RU prefixes when calculated routes for configured peers resolve to zero.
- Improve logging to track RU prefix retrieval and fallback scenarios.
- Introduce `WarmUpAsync` method to pre-cache prefixes for ASNs and RU-specific routes.
- Update `Program` to execute cache warm-up before starting BGP operations.
- Extend `IPrefixService` interface with `WarmUpAsync`.
- Rename API route from `/api/asns/{asn}/prefixes` to `/api/as/{asn}/prefixes` for consistency.
- Map `PeerCustomAsn` entity to the `PeerCustomAsns` database table.
- Introduce `PeerCustomAsn` entity and database schema for managing peer-specific custom ASNs.
- Update `PeerStore` with CRUD methods for custom ASNs.
- Enhance `BgpSession` to load and process custom ASN prefixes.
- Extend API to handle custom ASN retrieval and updates in peer operations.
- Add `bgplite_in` filter for inbound traffic and graceful restart handling for eBGP sessions.
- Update local ASN, IP settings, and multihop handling for both Bird and RouterOS configurations.
- Refine input/output filter rules, hold time, and client-to-client reflection settings for improved session control.
- Update `BgpSession` to track session closure in `_peerStore` when transitioning from an established state.
- Add `LastSessionAt` field initialization in `PeerStore` to log session timestamps for new peers.
- Add condition to ensure `_metrics.SessionClosed()` is called only when the session was in an established state before transitioning to Idle.
- Prevents misleading metrics logging for sessions that didn’t reach the established state.
- Replace direct `BgpDbContext` instantiation with `IDbContextFactory` for efficient context creation and scoped usage.
- Refactor `PeerStore` to leverage scoped `DbContext` for improved resource management.
- Update `Program.cs` to streamline database initialization logic and ensure proper setup.
- Add helper for client IP resolution in API requests, supporting `X-Real-IP` and `X-Forwarded-For` headers.
- Modify `Dockerfile` to include missing provider project and adjust exposed API port configuration.
- Add `RefreshRoutesAsync` for route updates in `BgpSession`, improving route management and resilience.
- Introduce dynamic peer subscriptions, custom prefixes, and RU-specific routes in `BgpSession`.
- Enhance `PeerStore` with CRUD operations for peers, subscriptions, communities, and prefixes.
- Implement `ISessionManager` in `BgpServer` for session-level operations.
- Refactor API routes for extensibility; introduce scoped handlers for peers, ASN lists, routes, and prefixes.
- Update database context to track new/loaded state and additional peer handling updates.
- Improve logging and error handling across modules for better visibility and debugging.
Lightweight BGP route server with TCP session management,
route table, community-based filtering, management HTTP API,
and SQLite peer store.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>