SnmpKit.SnmpLib.MIB.Preprocessor (snmpkit v0.6.3)

Preprocessor for MIB files to handle problematic constructs before parsing.

This module addresses issues with very large TEXTUAL-CONVENTION enumerations that cause parser state corruption in certain edge cases.

Summary

Functions

Get statistics about enumeration complexity in a MIB file.

Check if a MIB file contains problematic constructs.

Normalize excessive whitespace that might cause tokenizer issues.

Preprocess MIB content to handle problematic constructs.

Simplify very large TEXTUAL-CONVENTION enumerations that cause parser issues.

Functions

analyze_enumerations(content)

Get statistics about enumeration complexity in a MIB file.

has_problematic_constructs?(content)

Check if a MIB file contains problematic constructs.

normalize_whitespace(content)

Normalize excessive whitespace that might cause tokenizer issues.

preprocess(content)

Preprocess MIB content to handle problematic constructs.

simplify_large_enumerations(content)

Simplify very large TEXTUAL-CONVENTION enumerations that cause parser issues.

This replaces complex enumerations with simplified versions that preserve the essential structure while avoiding parser state corruption.