Skip to content

alter/RouteManagerPro-v3.0

Repository files navigation

Route Manager Pro v3.0

A high-performance Windows application for intelligent network route management with automatic traffic monitoring and optimization.

Windows C++ License

๐Ÿš€ What is Route Manager Pro?

Route Manager Pro automatically creates and manages Windows network routes based on application traffic. It monitors which applications are making network connections and intelligently routes their traffic through specified gateways - perfect for VPN split tunneling, multi-WAN setups, or network optimization.

Key Features

  • ๐Ÿ” Real-time Traffic Monitoring - Captures network flows using WinDivert
  • ๐ŸŽฏ Process-based Routing - Routes traffic based on executable names
  • ๐Ÿง  Smart Route Optimization - Automatically aggregates routes to minimize routing table size
  • ๐Ÿ’พ Persistent Routes - Survives reboots with automatic state restoration
  • ๐ŸŽฎ Game & App Detection - Special handling for games, Discord, development tools
  • ๐Ÿ“Š Performance Optimized - Multi-level caching, async operations, minimal overhead

๐Ÿ“‹ System Requirements

  • Windows 10/11 (64-bit)
  • Administrator privileges
  • Visual C++ Redistributables 2022
  • ~50MB RAM
  • WinDivert driver (included)

๐Ÿ”ง Installation

  1. Download the latest release from Releases
  2. Extract to your preferred location
  3. Run RouteManagerPro.exe as Administrator

๐Ÿ“– How to Use

Basic Setup

  1. Configure Gateway

    • Set your VPN or secondary gateway IP (default: 10.200.210.1)
    • Adjust metric if needed (lower = higher priority)
  2. Select Applications

    • Choose applications from the left list
    • Click > to add to monitoring
    • Selected apps will have their traffic routed through your gateway
  3. Enable Monitoring

    • Routes are created automatically when selected apps make connections
    • No manual configuration needed!

Advanced Features

Preloaded Routes

Enable "Preload IPs" to pre-configure routes for popular services:

  • Discord voice servers
  • Cloud gaming platforms
  • AI services (ChatGPT, Claude)
  • CDN networks

Edit preload_ips.json to customize IP ranges.

Route Optimization

Click "Optimize Routes" to:

  • Aggregate multiple /32 routes into larger subnets
  • Remove redundant entries
  • Reduce routing table size by up to 80%

Common Use Cases

VPN Split Tunneling

  • Route only specific apps through VPN
  • Keep other traffic on main connection
  • Perfect for gaming while working

Multi-WAN Load Balancing

  • Route bandwidth-heavy apps through secondary connection
  • Keep latency-sensitive apps on primary
  • Optimize network usage

Development & Testing

  • Route development tools through corporate VPN
  • Keep personal apps on home network
  • Isolate test traffic

๐ŸŽฏ Why Route Manager Pro?

It's FAST

  • Sub-millisecond route decisions using memory-mapped caches
  • Zero-copy packet inspection with WinDivert
  • Lock-free data structures for concurrent access
  • 98%+ cache hit rates on critical paths

It's SMART

  • Automatic route aggregation reduces routing table bloat
  • Reference counting prevents premature route removal
  • Process caching eliminates redundant system calls
  • Adaptive optimization based on traffic patterns

It's RELIABLE

  • Graceful degradation if services fail
  • Automatic recovery from network changes
  • Persistent state across reboots
  • Watchdog monitoring prevents resource leaks

๐Ÿ—๏ธ Architecture & Technical Excellence

For Developers

This isn't just another route manager - it's a masterclass in modern C++ system programming.

๐ŸŽจ Architecture Highlights

Service-Based Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   UI Layer  โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚ IPC Protocol โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚   Service   โ”‚
โ”‚  (HWND/GDI) โ”‚     โ”‚ (Named Pipes)โ”‚     โ”‚   Core      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                               โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚                                  โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
              โ”‚   Network   โ”‚                   โ”‚   Route    โ”‚
              โ”‚  Monitor    โ”‚                   โ”‚ Controller โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚                                  โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                               โ”‚
                         โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚ WinDivert  โ”‚
                         โ”‚   Driver   โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ’Ž Modern C++ Features

C++23 Goodness

  • std::format for type-safe string formatting
  • std::ranges algorithms for cleaner code
  • std::chrono for all time operations
  • std::filesystem for path handling
  • Concepts and constraints for template safety

Smart Memory Management

// RAII everywhere
std::unique_ptr<RouteController> routeController;
std::shared_mutex cachesMutex;  // Reader-writer optimization

// Custom deleters for Windows handles
struct HandleDeleter {
    void operator()(HANDLE h) {
        if (h && h != INVALID_HANDLE_VALUE) CloseHandle(h);
    }
};
using UniqueHandle = std::unique_ptr<void, HandleDeleter>;

๐Ÿš„ Performance Engineering

Multi-Level Caching System

// 1. Process cache with LRU eviction
ThreadSafeLRUCache<DWORD, CachedProcessInfo> m_pidCache;

// 2. String conversion cache (98.5% hit rate!)
ThreadSafeLRUCache<std::wstring, std::string> m_wstringToStringCache;

// 3. Route optimization cache
std::unordered_map<size_t, CachedOptimization> optimizationCache;

Lock-Free Where Possible

std::atomic<bool> running{true};
std::atomic<uint64_t> hits{0};
mutable std::shared_mutex cachesMutex;  // Multiple readers, single writer

Async Everything

  • Background route verification thread
  • Async logging with buffering
  • Non-blocking IPC communication
  • Deferred route optimization

๐Ÿ›ก๏ธ Robustness & Safety

Comprehensive Error Handling

// Result<T> monad for error propagation
template<typename T>
class Result {
    std::variant<T, RouteError> data;
public:
    bool IsSuccess() const;
    T& Value();
    RouteError& Error();
};

Graceful Shutdown Coordination

class ShutdownCoordinator {
    std::atomic<bool> isShuttingDown{false};
    HANDLE shutdownEvent;
    
    void WaitForThreads(std::chrono::milliseconds timeout);
};

Resource Leak Prevention

  • RAII for all resources
  • Watchdog monitors memory usage
  • Automatic garbage collection
  • Handle leak detection in debug builds

๐Ÿ”ฌ Advanced Algorithms

Route Optimization Engine

  • Trie-based route aggregation
  • Waste threshold calculations
  • Prefix length optimization
  • O(n log n) complexity

Network Flow Correlation

  • Process โ†’ Connection mapping
  • Efficient flow tracking
  • Connection state machine
  • Automatic cleanup

๐Ÿ“Š Monitoring & Metrics

Built-in Performance Profiling

PERF_TIMER("NetworkMonitor::ProcessFlowEvent");
PERF_COUNT("RouteOptimizer.CacheHit");

// Automatic timing and counting
class ScopedTimer {
    std::chrono::high_resolution_clock::time_point start;
    ~ScopedTimer() { 
        RecordOperation(op, duration); 
    }
};

Detailed Statistics

  • Cache hit rates
  • Operation timings
  • Route optimization metrics
  • Memory usage tracking

๐Ÿค Contributing

Contributions are welcome!

๐Ÿ“œ License

This project is licensed under the MIT License.

๐Ÿ™ Acknowledgments

  • WinDivert for packet capture
  • JsonCpp for configuration
  • The Windows networking community

Built with โค๏ธ using modern C++ and a passion for performance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published