/**
 * Fragment Manager for Detection Module
 *
 * Manages fragmented protocol data using the shared fragment handler
 */
import { FragmentHandler } from '../../protocols/common/fragment-handler.js';
/**
 * Detection-specific fragment manager
 */
export class DetectionFragmentManager {
    constructor() {
        // Configure fragment handlers with appropriate limits
        const tlsOptions = {
            maxBufferSize: 16384, // TLS record max size
            timeout: 5000,
            cleanupInterval: 30000
        };
        const httpOptions = {
            maxBufferSize: 8192, // HTTP header reasonable limit
            timeout: 5000,
            cleanupInterval: 30000
        };
        this.tlsFragments = new FragmentHandler(tlsOptions);
        this.httpFragments = new FragmentHandler(httpOptions);
    }
    /**
     * Get fragment handler for protocol type
     */
    getHandler(protocol) {
        return protocol === 'tls' ? this.tlsFragments : this.httpFragments;
    }
    /**
     * Create connection ID from context
     */
    static createConnectionId(context) {
        return context.id || `${context.sourceIp}:${context.sourcePort}-${context.destIp}:${context.destPort}`;
    }
    /**
     * Clean up all handlers
     */
    cleanup() {
        this.tlsFragments.cleanup();
        this.httpFragments.cleanup();
    }
    /**
     * Destroy all handlers
     */
    destroy() {
        this.tlsFragments.destroy();
        this.httpFragments.destroy();
    }
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJhZ21lbnQtbWFuYWdlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3RzL2RldGVjdGlvbi91dGlscy9mcmFnbWVudC1tYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7O0dBSUc7QUFFSCxPQUFPLEVBQUUsZUFBZSxFQUF5QixNQUFNLDRDQUE0QyxDQUFDO0FBR3BHOztHQUVHO0FBQ0gsTUFBTSxPQUFPLHdCQUF3QjtJQUluQztRQUNFLHNEQUFzRDtRQUN0RCxNQUFNLFVBQVUsR0FBcUI7WUFDbkMsYUFBYSxFQUFFLEtBQUssRUFBRyxzQkFBc0I7WUFDN0MsT0FBTyxFQUFFLElBQUk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