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
- Host: GitHub
- URL: https://github.com/dlemel8/network_parser_combinator
- Owner: dlemel8
- Created: 2020-08-13T18:31:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T18:37:44.000Z (over 5 years ago)
- Last Synced: 2025-02-23T18:45:40.450Z (over 1 year ago)
- Topics: dtls12, functional-programming, network-protocols, parser-combinator, rust, tdd, tls12, tls13
- Language: Rust
- Homepage:
- Size: 156 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.