An open API service indexing awesome lists of open source software.

https://github.com/dlemel8/network_parser_combinator

POC of parsing network protocols using parser combinators pattern
https://github.com/dlemel8/network_parser_combinator

dtls12 functional-programming network-protocols parser-combinator rust tdd tls12 tls13

Last synced: 6 days ago
JSON representation

POC of parsing network protocols using parser combinators pattern

Awesome Lists containing this project

README

          

# Network Parser Combinator
This repo contains parser combinator framework and use it to partially parse some TLS protocol variants.

## Parser Combinators
A parser is a function that take bytes and return a result.
Parsers are defined by a trait and implemented by closures.

A combinator is a function that take other parsers and return new parser.
Combinators are implemented as methods with default implementation on parser trait.

## Network Protocols
Using parsers and combinators, network protocols can be parsed.
All supported protocols can be parsed via a single library function that take packet(s) payload and return parsed objects.

Currently, tested protocols are:
* TLS 1.2
* TLS 1.3
* DTLS 1.2

## Examples
There is a single example of multi-threaded executable that dumps packets of a pcap file.
The main thread is sending packets to parse and receiving parsed packets to worker threads via channels.
Parsed packets are temporarily stored in a binary heap until they get printed.