[ANN] parse_sdp: strict SDP parser/validator for RFC 8866, ST 2110, IPMX
Andrew Starks <[email protected]> Fri, 22 May 2026 17:30:36 -0500
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <CAGprG-kmvvCx6sxN64W1M04nzNP5h38nUfnEYwC8wwYDDtVYMQ@mail.gmail.com> |
I'd like to share parse_sdp, a small Lua 5.5 (5.4 and 5.3 work too) library for working with Session Description Protocol (SDP) documents. It is built on LPeg and focuses on strict, spec-grounded validation. Three validation tiers, layered on each other: *RFC 8866* generic SDP well-formedness *SMPTE ST 2110* IP-based professional media transport *IPMX (VSF TR-10)* interoperability profile on top of ST 2110 *Features:* - Parse, validate, and serialize, with a round-trip invariant (parse -> to_sdp -> re-parse yields the same document) - Errors are values, never raised. Every finding carries a stable check ID, a severity, and a verbatim citation of the SHALL / SHALL-NOT clause it enforces - Per-check severity policy (warn / error / off) so consumers can relax or tighten individual rules without forking - JSON round-trip via dkjson - A small CLI shipped as parse_sdp: validate / diagnose / to_json / to_sdp / checks (registry inspection) The grammar is composed from three LPeg modules (base, st2110, ipmx) where each tier overlays per-rule overrides onto the previous one via a small base.extend() mechanism, so the RFC 8866 grammar stays the single source of truth and tier-specific narrowings live next to the clauses that are their source. Strictness is the main goal, but there are options: a check exists only when the referenced spec contains explicit normative text (a "shall", "shall not", or a defined value set for an optional field). Anything out of scope from the spec should pass. Each check's source comment quotes the clause, so the reasoning is auditable. Install: luarocks install parse_sdp Source, guide, and runnable examples: https://github.com/andrewstarks/parse_sdp Feedback, bug reports, and citations of clauses I have misread are all welcome. I made this because I work in the IPMX and ST 2110 standards world and after learning about SDP files, I've had it on my list to try to make an LPeg parser for SDP files. I actually had a lot of fun re-learning LPeg through Claude and going a lot further with it than I ever did back in the day. AI note: I used Claude Code while developing this. I worked hard to make something that's maintainable and high quality and intend to make fixes to it over time. But if AI assisted / vibe coding is a hang up, you might want to take a pass on this. - Andy -- You received this message because you are subscribed to the Google Groups "lua-l" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAGprG-kmvvCx6sxN64W1M04nzNP5h38nUfnEYwC8wwYDDtVYMQ%40mail.gmail.com.