Project

General

Profile

Actions

Optimization #4154

closed
JI JI

Task #4772: tracking: parity between fields logged and fields available for detection

Feature #4153: app-layer: rust derive style macros to generate common code

Rust Parsers: Abstract AppLayer events to a derive macro

Optimization #4154: Rust Parsers: Abstract AppLayer events to a derive macro

Added by Jason Ish over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

Description

Most parsers duplicate code to deal with application layer events. Instead, a parser should be able to define the events in an enum and have the rest of the code generated via a derive macro.

For example, given an enum like:

#[derive(Debug, PartialEq, AppLayerEvent)]
pub enum DNSEvent {
    MalformedData,
    NotRequest,
    NotResponse,
    ZFlagSet,
}

the following utility functions will be generated:

  • from_id
  • as_i32
  • to_cstring
  • from_cstring
  • get_event_info
  • get_event_info_by_id

JI Updated by Jason Ish over 5 years ago Actions #1

  • Related to Feature #4153: app-layer: rust derive style macros to generate common code added

VJ Updated by Victor Julien over 5 years ago Actions #3

  • Target version set to 7.0.0-beta1

VJ Updated by Victor Julien over 4 years ago Actions #4

  • Status changed from Assigned to In Progress

VJ Updated by Victor Julien over 4 years ago Actions #5

  • Parent task set to #4153

JI Updated by Jason Ish over 4 years ago Actions #6

  • Status changed from In Progress to In Review

JI Updated by Jason Ish over 4 years ago Actions #7

  • Status changed from In Review to Feedback

Merged into master. No backports required.

JI Updated by Jason Ish over 4 years ago Actions #8

  • Status changed from Feedback to Closed
Actions

Also available in: PDF Atom