Commit graph

21 commits

Author SHA1 Message Date
Mikhail Movchan
5efc623792 feat: improve logging and streamline peer creation/update logic
- Add detailed logging for `CreatePeer` and `UpdatePeer` operations to track input and processed data.
- Simplify `SetSubscriptions`, `SetCustomPrefixes`, and `SetCustomAsns` calls by removing conditional checks.
2026-06-11 22:21:56 +03:00
Mikhail Movchan
9e90b6ba98 refactor: simplify custom prefix and ASN handling in peer update logic
- Replace null checks with defaults for `CustomPrefixes` and `CustomAsns` to streamline processing.
- Consolidate prefix parsing logic and ensure consistent handling of invalid CIDRs.
2026-06-11 22:01:51 +03:00
Mikhail Movchan
0d2cdc206d feat: add RU defaults and fallback logic for unconfigured/empty peers
- 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.
2026-06-11 21:42:30 +03:00
Mikhail Movchan
8bb2b0a9d3 refactor: remove RIPE fallback logic from PrefixService 2026-06-11 21:23:41 +03:00
Mikhail Movchan
0a9300db57 feat: add prefix cache warm-up routine to PrefixService
- 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`.
2026-06-11 21:22:32 +03:00
Mikhail Movchan
e0ddb980bd refactor: simplify RU prefix fetching in BgpSession
- Replace inline RU ASN filtering with `GetRuPrefixesAsync`.
- Improve logging for RU prefix retrieval.
- Remove redundant route count check before `SendRoutesAsync` call.
2026-06-11 21:15:56 +03:00
Mikhail Movchan
2ab6062b58 fix: remove redundant route count check in SendRoutesAsync call 2026-06-11 21:09:21 +03:00
Mikhail Movchan
cba7a3cdf6 fix: correct API route and table mapping for custom ASNs
- Rename API route from `/api/asns/{asn}/prefixes` to `/api/as/{asn}/prefixes` for consistency.
- Map `PeerCustomAsn` entity to the `PeerCustomAsns` database table.
2026-06-11 20:40:19 +03:00
Mikhail Movchan
f2e9d82083 feat: add custom ASN support for peers
- 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.
2026-06-11 20:18:08 +03:00
Mikhail Movchan
3a3e0a8725 feat: enhance BGP configuration with custom filters and eBGP improvements
- 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.
2026-06-10 18:46:40 +03:00
Mikhail Movchan
f09e99e47b feat: improve session handling and peer status tracking
- 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.
2026-06-10 12:01:43 +03:00
Mikhail Movchan
5eafe61559 fix: only log session closure metric if previously established
- 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.
2026-06-10 11:43:41 +03:00
Mikhail Movchan
d0e1cb88c7 refactor: transition to DbContextFactory pattern, enhance database lifecycle management
- 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.
2026-06-10 03:37:50 +03:00
Mikhail Movchan
a774418abd feat: enhance session management, route handling, and peer operations
- 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.
2026-06-10 01:54:00 +03:00
Mikhail Movchan
3fc62f05b3 feat: refactor to standardize service interfaces, add IPrefixService and IPeerStore, enable dynamic API port configuration and CORS support 2026-06-09 21:09:45 +03:00
Mikhail Movchan
e1144952c3 docs: update README with dynamic prefix provisioning, RIPE Stat integration, and API enhancements 2026-06-09 20:07:07 +03:00
Mikhail Movchan
b829ad71f5 feat: extend PrefixService with local file support and RU-specific prefix handling, integrate with config and API 2026-06-09 19:53:25 +03:00
Mikhail Movchan
8077ae14c0 feat: implement PrefixService for cached prefix lookup and enhance ASN list handling across modules 2026-06-09 19:18:46 +03:00
Mikhail Movchan
a579f691f8 feat: integrate RIPE Stat support for dynamic ASN-based prefix management and extend peer store capabilities 2026-06-09 17:31:09 +03:00
Mikhail Movchan
51d3a7e6d2 docs: add project README
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-05 19:38:05 +03:00
Mikhail Movchan
9a6c0af00b feat: initial commit — BGPLite BGP route server
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>
2026-06-05 19:30:18 +03:00