Project

General

Profile

Actions

Optimization #2780

open
DB CT

Convert DNP3 from C to Rust

Optimization #2780: Convert DNP3 from C to Rust

Added by Danny Browning about 7 years ago. Updated about 5 years ago.

Status:
New
Priority:
Normal
Target version:
Effort:
medium
Difficulty:
Label:
Protocol

Description

Convert parser from C to Rust.

Related to https://redmine.openinfosecfoundation.org/issues/2778


Related issues 1 (1 open0 closed)

Related to Suricata - Task #2778: tracking: port app-layer parsers to RustNewOISF DevActions

DB Updated by Danny Browning about 7 years ago Actions #1

  • Related to Task #2778: tracking: port app-layer parsers to Rust added

VJ Updated by Victor Julien about 7 years ago Actions #2

  • Target version changed from 5.0beta1 to TBD

VJ Updated by Victor Julien about 7 years ago Actions #3

  • Tracker changed from Bug to Optimization

VJ Updated by Victor Julien about 7 years ago Actions #4

  • Assignee set to Community Ticket

VJ Updated by Victor Julien about 6 years ago Actions #5

  • Label Protocol added

SD Updated by Simon Dugas about 5 years ago Actions #6

We are working on a rust parser for DNP3 so I wouldn't mind taking on this ticket.

The move/implementation would be similar to modbus (https://github.com/OISF/suricata/pull/5810) once that code review is finalized.

Implementation Steps
  1. Move app-layer parser for DNP3 from C to Rust, leaving C tests as much as possible.
  2. Move detection module for DNP3 from C to Rust, leaving C tests as much as possible.
  3. Move tests from C to rust.

Out of Scope
Should we move eve json logging for DNP3 to rust or is this out of scope?

JI Updated by Jason Ish about 5 years ago Actions #7

Once the transaction objects are Rust, I think its only natural to have the logging in Rust as well, otherwise there will be a lot of getter's or unecessary restrictions keeping the structs C compatible. The C code uses the same input to generate the loggers as it does the parser.

Have you taked a look at https://github.com/rust-bakery/nom-derive? I thought something like that, or inspired by it might help with a migration of DNP3 to Rust.

SD Updated by Simon Dugas about 5 years ago Actions #8

Haven't heard of `nom-derive`. Thank you for the info.

Actions

Also available in: PDF Atom