Skip to content

Commit fe6d2e1

Browse files
committed
flow-storage: bindgen to rust sys crate
1 parent f3c7b21 commit fe6d2e1

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

rust/sys/src/sys.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,38 @@ extern "C" {
18431843
#[doc = " \\internal\n\n Run all registered flow init callbacks."]
18441844
pub fn SCFlowRunFinishCallbacks(tv: *mut ThreadVars, f: *mut Flow);
18451845
}
1846+
#[repr(C)]
1847+
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
1848+
pub struct SCFlowStorageId {
1849+
pub id: ::std::os::raw::c_int,
1850+
}
1851+
extern "C" {
1852+
pub fn SCFlowStorageSize() -> ::std::os::raw::c_uint;
1853+
}
1854+
extern "C" {
1855+
pub fn SCFlowGetStorageById(h: *const Flow, id: SCFlowStorageId)
1856+
-> *mut ::std::os::raw::c_void;
1857+
}
1858+
extern "C" {
1859+
pub fn SCFlowSetStorageById(
1860+
h: *mut Flow, id: SCFlowStorageId, ptr: *mut ::std::os::raw::c_void,
1861+
) -> ::std::os::raw::c_int;
1862+
}
1863+
extern "C" {
1864+
pub fn SCFlowFreeStorageById(h: *mut Flow, id: SCFlowStorageId);
1865+
}
1866+
extern "C" {
1867+
pub fn SCFlowFreeStorage(h: *mut Flow);
1868+
}
1869+
extern "C" {
1870+
pub fn SCRegisterFlowStorageTests();
1871+
}
1872+
extern "C" {
1873+
pub fn SCFlowStorageRegister(
1874+
name: *const ::std::os::raw::c_char,
1875+
Free: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
1876+
) -> SCFlowStorageId;
1877+
}
18461878
extern "C" {
18471879
pub fn SCSRepCatGetByShortname(shortname: *const ::std::os::raw::c_char) -> u8;
18481880
}

src/bindgen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363

6464
#include "flow-bindgen.h"
6565
#include "flow-callbacks.h"
66+
#include "flow-storage.h"
6667

6768
#include "reputation.h"
6869
#include "feature.h"

src/flow-storage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#ifndef SURICATA_FLOW_STORAGE_H
2727
#define SURICATA_FLOW_STORAGE_H
2828

29+
#ifndef SURICATA_BINDGEN_H
2930
#include "flow.h"
31+
#endif
3032

3133
typedef struct SCFlowStorageId {
3234
int id;

0 commit comments

Comments
 (0)