]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
sip: apply rustfmt to a few functions
authorJuliana Fajardini <jufajardini@gmail.com>
Tue, 15 Feb 2022 16:14:50 +0000 (16:14 +0000)
committerVictor Julien <vjulien@oisf.net>
Wed, 16 Feb 2022 13:24:38 +0000 (14:24 +0100)
Our current rust code isn't always documentation friendly when it
comes to using code snippets. Used rustfmt to apply rust default
formatting on functions that we wanted to show in our documentation
for Frame support

rust/src/sip/sip.rs

index 02ee766f95d6172c6bdf9970300c969a18e1f158..a321ca7dae3fea823a7f79c7fc135a16bb2b6bfd 100755 (executable)
@@ -109,7 +109,13 @@ impl SIPState {
 
     fn parse_request(&mut self, flow: *const core::Flow, stream_slice: StreamSlice) -> bool {
         let input = stream_slice.as_slice();
-        let _pdu = Frame::new_ts(flow, &stream_slice, input, input.len() as i64, SIPFrameType::Pdu as u8);
+        let _pdu = Frame::new_ts(
+            flow,
+            &stream_slice,
+            input,
+            input.len() as i64,
+            SIPFrameType::Pdu as u8,
+        );
         SCLogDebug!("ts: pdu {:?}", _pdu);
 
         match sip_parse_request(input) {
@@ -178,14 +184,32 @@ impl SIPTransaction {
 
 fn sip_frames_ts(flow: *const core::Flow, stream_slice: &StreamSlice, r: &Request) {
     let oi = stream_slice.as_slice();
-    let _f = Frame::new_ts(flow, stream_slice, oi, r.request_line_len as i64, SIPFrameType::RequestLine as u8);
+    let _f = Frame::new_ts(
+        flow,
+        stream_slice,
+        oi,
+        r.request_line_len as i64,
+        SIPFrameType::RequestLine as u8,
+    );
     SCLogDebug!("ts: request_line {:?}", _f);
-    let hi = &oi[r.request_line_len as usize ..];
-    let _f = Frame::new_ts(flow, stream_slice, hi, r.headers_len as i64, SIPFrameType::RequestHeaders as u8);
+    let hi = &oi[r.request_line_len as usize..];
+    let _f = Frame::new_ts(
+        flow,
+        stream_slice,
+        hi,
+        r.headers_len as i64,
+        SIPFrameType::RequestHeaders as u8,
+    );
     SCLogDebug!("ts: request_headers {:?}", _f);
     if r.body_len > 0 {
-        let bi = &oi[r.body_offset as usize ..];
-        let _f = Frame::new_ts(flow, stream_slice, bi, r.body_len as i64, SIPFrameType::RequestBody as u8);
+        let bi = &oi[r.body_offset as usize..];
+        let _f = Frame::new_ts(
+            flow,
+            stream_slice,
+            bi,
+            r.body_len as i64,
+            SIPFrameType::RequestBody as u8,
+        );
         SCLogDebug!("ts: request_body {:?}", _f);
     }
 }