GithubHelp home page GithubHelp logo

ocaml-sdp's Introduction

Session Description Protocol (RFC 4566)

A (very WIP) pure OCaml implementation of RFC 4566, Session Description Protocol (SDP).

Disclaimer: I've never written one of these "OCaml implementations of a protocol" before so I largely have no idea what I'm doing especially trying to make sense of the RFC and in particular, all of the details about encoding (UTF-8, ASCII...). If someone with more experience has the time to check this I'm happy for PRs/Issues for improvement.


Todos:

  • Better printing and encoding functions (some are not implemented yet...)
  • Better testing (could it use fuzzing or database of real-world SDPs?)

The library exposes the Sdp.Make functor. This is because most of the SDP protocol is fairly straightforward and the same for most use cases except the attributes. These vary widely depending on the usage of the SDP protocol. If you want to extend the abilities of the parser to provide more useful types in your attributes then you need to provide that functionality:

module type Attribute = sig
  type t
  (* The type of your attributes *)

  val attribute : t Angstrom.t
  (* Angstrom parser -- only needs to parse one line terminated with eol *)

  val pp : t Fmt.t
  (* A pretty printer for your attributes *)
end

If you are happy with basic functionality then you can use Sdp.Basic which has attribute type of:

type t = [ `Prop of string | `Value of string * string ]

With either Sdp.Make(A) or Sdp.Basic you then have access to an Encode module for building up SDPs, Decode for parsing them and Pp for printing them.

ocaml-sdp's People

Contributors

patricoferris avatar

Stargazers

Christiano Haesbaert avatar Daniel Quernheim avatar Sora Morimoto avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.