π Major Refactoring and Feature Enhancement
Overview
This pull request represents a significant evolution of the protoTools library with extensive refactoring, new features, and architectural improvements. The changes include 3,371 additions and 327 deletions across 84 files, introducing new modules for protocol interpretation, services architecture, and enhanced dissection capabilities.
π§ Key Changes
Architecture & Organization
- Modular Restructuring: Reorganized codebase into distinct namespaces and directories:
dissection/- Core packet dissection functionalityinterpretation/- Protocol interpretation and type formattingservices/- Network protocol services and client-server architecturecommon/- Shared utilities and patterns
π New Features
Protocol Services Architecture
- Protocol Client/Server Framework: Complete client-server implementation with ZMQ backend
- Protocol Directory Services: Service discovery and registration system
- Command/Reply Pattern: Structured request-response messaging
- Protocol Publisher: Event publishing and subscription capabilities
Enhanced Dissection Engine
- Dynamic Length Support: Fields can now calculate their size based on buffer content
- Size Callback System: Advanced size determination with forward buffer scanning
- Packet Helper Utilities: Enhanced packet manipulation and analysis tools
- Serialization Support: Generic dissector serialization capabilities
Type Interpretation System
- Generic Packet Interpreter: Flexible packet interpretation framework
- Type Formatter: Comprehensive formatting system for various data types
- Field Interpretation: Advanced field-level interpretation capabilities
π§ Core Improvements
BitUtils Enhancements
- Breaking Change: Semantic naming with
as_andto_function prefixes - Enhanced Type Support: Better arithmetic type handling with
to_number - Helper Functions: New
as_bytesandas_chars_spanutilities
Field & Packet Descriptors
- Immutable FieldData: Improved data integrity with immutable design
- Monadic Interface: Fluent API for PacketDescriptor configuration
- Fixed Size Detection:
hasFixedSizefunction for better packet analysis - Enhanced Error Handling: More precise exception information
Generic Dissector
- Advanced Construction: Support for byteBuffer-based construction
- Empty Field Handling: Refined behavior for empty and removed fields
- Size Calculation Callbacks: Dynamic size determination capabilities
π Applications & Examples
- Protocol Client CLI: Command-line interface for protocol interaction
- Demo Server: Example protocol server implementation
- Protocol Proxy: Proxy service for protocol bridging
- Protocol Pusher: Message pushing utility
π§ͺ Testing & Quality
- Comprehensive Unit Tests: Added tests for dissector and interpreter functionality
- GCC Build Compatibility: Fixed compilation issues for GCC
- Windows Symbol Collision Fixes: Resolved naming conflicts with Windows headers
ποΈ Build System
- CPM Integration: Enhanced dependency management
- Embedded Detection: Better embedded system support
- Conditional Building: Apps and tests only built in standalone mode
- CMake Improvements: Streamlined build configuration
π Statistics
- Files Changed: 84
- Lines Added: 3,371
- Lines Removed: 327
- Net Change: +3,044 lines
- Commits: 47 commits from
maintodev
π Breaking Changes
BitUtilsfunction naming convention changed to semanticas_/to_prefixes- Moved dissection utilities to separate folder structure
- Namespace reorganization for interpreter components
π― Benefits
- Enhanced Modularity: Clear separation of concerns with organized directory structure
- Improved Extensibility: Plugin-like architecture for protocol handling
- Better Performance: Optimized dissection and interpretation pipelines
- Comprehensive Testing: Robust test coverage for critical components
- Production Ready: Complete service architecture for real-world deployment
π Migration Notes
- Update includes to reflect new header locations
- Adapt BitUtils function calls to new naming convention
- Consider namespace changes for interpreter components
This PR represents months of development effort to create a robust, scalable protocol analysis framework suitable for production use.
What's Changed
New Contributors
Full Changelog: https://github.com/psyinf/protoTools/commits/v1.0.0