]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
sip: add TX orientation
authorEric Leblond <el@stamus-networks.com>
Mon, 23 Jan 2023 21:01:18 +0000 (22:01 +0100)
committerVictor Julien <vjulien@oisf.net>
Fri, 31 Mar 2023 17:30:07 +0000 (19:30 +0200)
Set no inspection in the opposite side of the transaction.

Ticket: #5799

rust/src/sip/sip.rs

index a52f5560687e10dd062c763393a1db2c576b15ce..7f4716f1e8bef77bf624fdd16621631ef6f9154f 100755 (executable)
@@ -86,7 +86,7 @@ impl SIPState {
         self.transactions.clear();
     }
 
-    fn new_tx(&mut self) -> SIPTransaction {
+    fn new_tx(&mut self, _direction: crate::core::Direction) -> SIPTransaction {
         self.tx_id += 1;
         SIPTransaction::new(self.tx_id)
     }
@@ -127,7 +127,7 @@ impl SIPState {
         match sip_parse_request(input) {
             Ok((_, request)) => {
                 sip_frames_ts(flow, &stream_slice, &request);
-                let mut tx = self.new_tx();
+                let mut tx = self.new_tx(crate::core::Direction::ToServer);
                 tx.request = Some(request);
                 if let Ok((_, req_line)) = sip_take_line(input) {
                     tx.request_line = req_line;
@@ -155,7 +155,7 @@ impl SIPState {
         match sip_parse_response(input) {
             Ok((_, response)) => {
                 sip_frames_tc(flow, &stream_slice, &response);
-                let mut tx = self.new_tx();
+                let mut tx = self.new_tx(crate::core::Direction::ToClient);
                 tx.response = Some(response);
                 if let Ok((_, resp_line)) = sip_take_line(input) {
                     tx.response_line = resp_line;