-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust: remove unused #9256
rust: remove unused #9256
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -373,36 +373,6 @@ impl JsonBuilder { | |
} | ||
} | ||
|
||
/// Add a byte array to a JSON array encoded as hex. | ||
pub fn append_hex(&mut self, val: &[u8]) -> Result<&mut Self, JsonError> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can go, I see it coming back at some point tho. It kind of falls in the public API space, but we don't have plugin support for protos so is largely not usable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok Side note that for plugin support for photos (for which I have a POC), you cannot export rust. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, thats a known unfortunately. Rust plugins have to link in with the C api. We can provide Rust wrappers to make it feel more like Rust tho. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But Rust plugins can use standalone modules provided in Suricata proper like JSONBuilder, etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How so ? |
||
match self.current_state() { | ||
State::ArrayFirst => { | ||
self.push('"')?; | ||
for i in 0..val.len() { | ||
self.push(HEX[(val[i] >> 4) as usize] as char)?; | ||
self.push(HEX[(val[i] & 0xf) as usize] as char)?; | ||
} | ||
self.push('"')?; | ||
self.set_state(State::ArrayNth); | ||
Ok(self) | ||
} | ||
State::ArrayNth => { | ||
self.push(',')?; | ||
self.push('"')?; | ||
for i in 0..val.len() { | ||
self.push(HEX[(val[i] >> 4) as usize] as char)?; | ||
self.push(HEX[(val[i] & 0xf) as usize] as char)?; | ||
} | ||
self.push('"')?; | ||
Ok(self) | ||
} | ||
_ => { | ||
debug_validate_fail!("invalid state"); | ||
Err(JsonError::InvalidState) | ||
} | ||
} | ||
} | ||
|
||
/// Add an unsigned integer to an array. | ||
pub fn append_uint(&mut self, val: u64) -> Result<&mut Self, JsonError> { | ||
match self.current_state() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider this part of the public api footprint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok