How seladb/toyvpn-pcapplusplus works
Main Components
a) Client-Side (Android App):
• UI Layer (ToyVpnClient Activity)
• VPN Service Layer (ToyVpnService)
• Connection Handler (ToyVpnConnection)
• PcapPlusPlus Integration Layer:
• PcapPlusPlusInterface (Kotlin)
• Native Interface (JNI Layer)
• PcapPlusPlus Libraries
b) Server-Side:
• Linux VPN Server
• TUN Interface
• NAT/Routing Components
c) External Components:
• Internet/Remote Destinations
• DNS Servers
• TLS Endpoints
[Remote Services (Top)]
• ↕
[VPN Server (Middle)]
• ↕
[Android App Components (Bottom)]
Component Relationships
Key interactions:
a) Data Flow:
• Device → VpnService → ToyVpnConnection → Server → Internet
• Packet Analysis Flow: ToyVpnConnection → PcapPlusPlusInterface → Native Layer
b) Control Flow:
• UI → VpnService → Connection Management
• PcapPlusPlus Analysis Pipeline
Detailed Elements
Specific details:
a) Android App Layer:
┌─ Android App ─────────────────────┐
• ┌─ UI Layer ─┐ ┌─ VPN Core ───┐ │
• ToyVpnClient│→│ToyVpnService │ │
• ┘ │ToyVpnConnection│ │
• ┘ │
• ┌─ PcapPlusPlus Integration ───┐ │
• PcapPlusPlusInterface │ │
• Native JNI Layer │ │
• PcapPlusPlus Libraries │ │
• ┘ │
• ┘
b) Server Layer:
┌─ Linux Server ────────┐
• TUN Interface │
• NAT Configuration │
• Routing Rules │
• ┘
Technical Details
• API Level (30)
• Supported architectures (arm64-v8a, armeabi-v7a, x86, x86_64)
• Network protocols (IPv4, IPv6, TCP, UDP, DNS, TLS)
• File formats (pcap)