Project

General

Profile

Actions

Optimization #4517

open
PA OD

cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1), and remove duplicate definitions between rust and C

Optimization #4517: cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1), and remove duplicate definitions between rust and C

Added by Philippe Antoine almost 5 years ago. Updated about 2 months ago.

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

Description

So that we do not have 2 definitions on the 2 sides
Which can end up having a different value
cf https://github.com/OISF/suricata/pull/6168

That is the line item_types = ["enums","structs","opaque","functions"] in rust/cbindgen.toml

cbindgen doesn't like our BIT_ macros, maybe there is a work-around, maybe not. In Rust bit flags are often written out like 0b00000001.

This would lead us more to a big super include. Should we care? I noticed I can run cbindgen aginst particular .rs files to make more granular header files which might be something to explore as well...


Related issues 2 (0 open2 closed)

Related to Suricata - Bug #5012: Remove duplicate definition of constants between C and RustClosedActions
Related to Suricata - Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgenClosedPhilippe AntoineActions

PA Updated by Philippe Antoine almost 4 years ago Actions #1

  • Related to Bug #5012: Remove duplicate definition of constants between C and Rust added

PA Updated by Philippe Antoine almost 3 years ago Actions #2

Cinstants are exported but APP_LAYER_PARSER_NO_INSPECTION_PAYLOAD defined by a macro is not

PA Updated by Philippe Antoine almost 3 years ago Actions #3

  • Subject changed from cbindgen export the constants from Rust to C to cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1)

PA Updated by Philippe Antoine almost 3 years ago Actions #4

  • Subject changed from cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1) to cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1), and remove duplicate definitions between rust and C

PA Updated by Philippe Antoine almost 3 years ago Actions #5

  • Assignee set to OISF Dev

PA Updated by Philippe Antoine almost 2 years ago Actions #6

I think this optimization can be postponed after 8

VJ Updated by Victor Julien about 1 year ago Actions #7

  • Target version changed from 8.0.0-beta1 to 9.0.0-beta1

PA Updated by Philippe Antoine 9 months ago Actions #8

  • Related to Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgen added

PA Updated by Philippe Antoine about 2 months ago Actions #9

  • Status changed from New to Assigned
Actions

Also available in: PDF Atom