# mylib **Repository Path**: zxfLoveWd/mylib ## Basic Information - **Project Name**: mylib - **Description**: No description available - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-20 - **Last Updated**: 2026-04-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Mylib - Packet Shaper ## Project Overview Mylib is a Linux kernel implementation of a packet shaper, designed to control packet transmission rates and enable Quality of Service (QoS) functionality. ## Features - **Packet Shaping**: Control the transmission rate of packets - **Timer-Based Scheduling**: Event-driven mechanism based on timers - **Batch Budget Management**: Support for batch processing and packet budget control - **Queue Management**: Built-in queue buffer management - **Efficient Destruction Mechanism**: Safe resource deallocation ## Core Components ### pkt_shaper.c Implements the following core functions: - `pkt_shaper_init` - Initialize the packet shaper - `pkt_shaper_submit` - Submit packets to the shaping queue - `pkt_shaper_destroy` - Destroy the packet shaper and release resources ### Configuration Parameters | Parameter | Description | |-----------|-------------| | PS_MAX_DELTA | Maximum time delta | | PS_DEFAULT_BATCH_BUDGET | Default batch budget | | PS_DEFAULT_NEXT_TICK | Default next tick interval | | PS_DEFAULT_QUEUE_LEN | Default queue length | ## Usage ```c #include "pkt_shaper.h" // Initialize configuration struct pkt_shaper_config cfg = { .batch_budget = PS_DEFAULT_BATCH_BUDGET, .queue_len = PS_DEFAULT_QUEUE_LEN, // Other configurations... }; // Create and initialize struct pkt_shaper *ps = kmalloc(sizeof(*ps), GFP_ATOMIC); pkt_shaper_init(ps, &cfg); // Submit packets pkt_shaper_submit(ps, skb); // Destroy pkt_shaper_destroy(ps); kfree(ps); ``` ## License Please refer to the LICENSE file in the project root directory for specific licensing information. ## Contributions Pull requests and issues are welcome.