]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/doc: add docstring to rust module files.
authorDaniel Olatunji <danielolatunji20@outlook.com>
Wed, 11 Oct 2023 19:24:03 +0000 (19:24 +0000)
committerVictor Julien <victor@inliniac.net>
Sat, 28 Oct 2023 05:29:59 +0000 (07:29 +0200)
Issue: #4584

43 files changed:
rust/src/applayer.rs
rust/src/applayertemplate/mod.rs
rust/src/asn1/mod.rs
rust/src/bittorrent_dht/mod.rs
rust/src/common.rs
rust/src/conf.rs
rust/src/core.rs
rust/src/dcerpc/mod.rs
rust/src/detect/mod.rs
rust/src/dhcp/mod.rs
rust/src/dns/mod.rs
rust/src/ffi/mod.rs
rust/src/filecontainer.rs
rust/src/filetracker.rs
rust/src/frames.rs
rust/src/ftp/mod.rs
rust/src/http2/mod.rs
rust/src/ike/mod.rs
rust/src/jsonbuilder.rs
rust/src/kerberos.rs
rust/src/krb/mod.rs
rust/src/lib.rs
rust/src/log.rs
rust/src/lua.rs
rust/src/lzma.rs
rust/src/mime/mod.rs
rust/src/modbus/mod.rs
rust/src/mqtt/mod.rs
rust/src/nfs/mod.rs
rust/src/ntp/mod.rs
rust/src/pgsql/mod.rs
rust/src/plugin.rs
rust/src/quic/mod.rs
rust/src/rdp/mod.rs
rust/src/rfb/mod.rs
rust/src/sip/mod.rs
rust/src/smb/mod.rs
rust/src/snmp/mod.rs
rust/src/ssh/mod.rs
rust/src/telnet/mod.rs
rust/src/tftp/mod.rs
rust/src/util.rs
rust/src/x509/mod.rs

index 255fa1593c2bcf8b4afe06a6b7ca0d9438065d4e..97db321e2249a8eeb1473d7190552d8642cac24a 100644 (file)
@@ -15,7 +15,7 @@
  * 02110-1301, USA.
  */
 
-//! Parser registration functions and common interface
+//! Parser registration functions and common interface module.
 
 use std;
 use crate::core::{self,DetectEngineState,Flow,AppLayerEventType,AppProto,Direction};
index 63f4ed139e87e99f56511d1e96b7fb2e2ccd63ca..e22bd68e391bacd7c7c2c9333de30b911761f7b5 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Application layer template parser and logger module.
+
 mod parser;
 pub mod template;
 /* TEMPLATE_START_REMOVE */
index 7c52b4cb8563680f0c1ecf96d9a771729d15b788..4b77b0ca28d51e560c955f990d33cf41e7ae5f2a 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! ASN.1 parser module.
+
 use der_parser::ber::{parse_ber_recursive, BerObject, BerObjectContent, Tag};
 use nom7::Err;
 use std::convert::TryFrom;
index 0c79ecc92fa52d36cef9305f8fc57577c388c0c6..9e0d033d3003161a46a7b8c6f3e884c201f25f2e 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! BitTorrent DHT application layer, logger and parser module.
+
 pub mod bittorrent_dht;
 pub mod logger;
 pub mod parser;
index a8880b2c4c029be8e32c8d6b7da5f29453740d7d..1d10bbe443d0466b44e722f555ea1ea972687aa2 100644 (file)
@@ -1,3 +1,5 @@
+//! Utility library module for commonly used strings, hexadecimals and other elements.
+
 use super::build_slice;
 use crate::jsonbuilder::HEX;
 use std::ffi::CString;
index b176d5f71f201c0c85025f87019d83a94be07637..50acf6cae895852ad2cc9203542d734a0bb0221b 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Module for retrieving configuration details.
+
 use std::os::raw::c_char;
 use std::os::raw::c_void;
 use std::os::raw::c_int;
index 5b0a67afc0fb1bf99b07f890672e8e87e0195815..abb27ea578fe6c8abf9ce5b18cc46ed8a0dc2458 100644 (file)
@@ -15,7 +15,7 @@
  * 02110-1301, USA.
  */
 
-// This file exposes items from the core "C" code to Rust.
+//! This module exposes items from the core "C" code to Rust.
 
 use std;
 use crate::filecontainer::*;
index 7765e044ca81d19c3cc9cf7fb5a03e8e3505ab98..800d2ade7311a66d59742cc37f69e9ebb6dbbc8a 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! DCE/RPC protocol parser, logger and detection module.
+
 pub mod dcerpc;
 pub mod dcerpc_udp;
 pub mod parser;
index 84bd28e2863db1468fb4286e1c6c40b0195ff7a3..41c7ff2455bd9dab59e9df76a9022e745b5ec440 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Module for rule parsing.
+
 pub mod byte_math;
 pub mod error;
 pub mod iprep;
index bc859d7b54baf3a3d6b59b77c2900010aa39e011..fd783d961ff2e22b8acae8e62c6451bde2e5a57f 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! DHCP parser, detection and logger module.
+
 pub mod dhcp;
 pub mod parser;
 pub mod logger;
index 054bb50b259a28248364de7a275ab9c14bf744a1..b0ca00ffc9d489b9f9d5d905f4728c6abf6c136c 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! DNS parser, detection, logger and application layer module.
+
 pub mod detect;
 pub mod dns;
 pub mod log;
index ff9f7d1642c33fde6108c64790e6edc30a0a9433..e97e6c98c6394dc59b9965733678fd11b77f6c76 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Module that exposes C bindings to the Suricata Rust library.
+
 pub mod hashing;
 pub mod base64;
 pub mod strings;
index c51daaa8f1391db23422739d91e4b2d15382cbc9..3a8bde5f7d5b4ab536d8fd9c9f14db27cd123b4d 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! This module handles file container operations (open, append, close).
+
 use std::ptr;
 use std::os::raw::{c_void};
 
index ad1c4c0c3a2cdfcdd1fa245674cf699e7d2b4138..3ae65eecb559b6980675e6b60a2b88c08b164a9c 100644 (file)
  * 02110-1301, USA.
  */
 
-/**
- *  \file
- *  \author Victor Julien <victor@inliniac.net>
- *
- * Tracks chunk based file transfers. Chunks may be transferred out
- * of order, but cannot be transferred in parallel. So only one
- * chunk at a time.
- *
- * GAP handling. If a data gap is encountered, the file is truncated
- * and new data is no longer pushed down to the lower level APIs.
- * The tracker does continue to follow the file.
- */
+//! Gap handling and Chunk-based file transfer tracker module.
+//!
+//! GAP handling. If a data gap is encountered, the file is truncated
+//! and new data is no longer pushed down to the lower level APIs.
+//! The tracker does continue to follow the file
+//
+//! Tracks chunk based file transfers. Chunks may be transferred out
+//! of order, but cannot be transferred in parallel. So only one
+//! chunk at a time.
+//!
+//! Author: Victor Julien <victor@inliniac.net>
 
 use crate::core::*;
 use std::collections::HashMap;
index 3311a4b36f485d7bdb1ca0fdf86790eae94f6cab..3a45d014b47214793e5799fe3e0fb95993d409bd 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Module for bindings to the Suricata C frame API.
+
 use crate::applayer::StreamSlice;
 use crate::core::Flow;
 #[cfg(not(test))]
index 1a60ca470c34d5eb634bca16f0da339e3ce84d8e..3839c9661e0d9c0bf2d0c69c10d7656c6bc7b56b 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! FTP parser and application layer module.
+
 use nom7::bytes::complete::{tag, take_until};
 use nom7::character::complete::{digit1, multispace0};
 use nom7::combinator::{complete, map_res, opt, verify};
index f1d6f30bb274df98a3dfa76a834d765e04196a4c..910e968105d09560759875f3e3b3a59082cb0398 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! HTTP/2 parser, detection, logger and application layer module.
+
 #![allow(clippy::result_unit_err)]
 
 mod decompression;
index 4f8114d2a0af8fdc8dd608c844021f7b43bd2654..366688eae2eadb81319c3bdbb6417d2d53fe92e2 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! IKE parser, detection, logger and application layer module.
+
 // written by Pierre Chifflier  <chifflier@wzdftpd.net>
 
 extern crate ipsec_parser;
index c1f466563be79355f1c1d914e50fbb56ad85a4c9..82be09953c707ba697402883e827696e89f59d2e 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+ //! Module for building JSON documents.
+
 #![allow(clippy::missing_safety_doc)]
 
 use std::cmp::max;
index 0a5e9517abfe473b54de37c7a0d9bd54fdcfd2c0..e7c51cc2f28f2cc783eb289624d9c3f20b7452da 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Kerberos parser wrapper module.
+
 use nom7::IResult;
 use nom7::error::{ErrorKind, ParseError};
 use nom7::number::streaming::le_u16;
index c8be867a09363bf2ccff16c685fd6fba174eba7b..ca6237d7bb6bda64e4ae1511077e06fa86867ee6 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Kerberos-v5 application layer, logger and detection module.
+
 // written by Pierre Chifflier  <chifflier@wzdftpd.net>
 
 pub mod krb5;
index 4c238538273ace3284ed66d817b4cb3fa5a0b8b9..36098ffadd0ba07e09bc82644d8a1e311bda33f1 100644 (file)
  * 02110-1301, USA.
  */
 
+//! Suricata is a network intrusion prevention and monitoring engine.
+//!
+//! Suricata is a hybrid C and Rust application. What is found here are
+//! the components written in Rust.
+
 #![cfg_attr(feature = "strict", deny(warnings))]
 
 // Allow these patterns as its a style we like.
index 05344b6e6cd9c50ab4999f6c67f726bf9a41438a..744169a9703997c5c09bd8fa347b2c854794dd36 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Logging utility module.
+
 use std;
 use std::ffi::CString;
 use std::path::Path;
index 87cb8b3acf9cdf2b30965173d1a36f7395f7e08f..4fce2a824944fd3c99b6e29eb40e95d81f843b3d 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Lua wrapper module.
+
 use std::os::raw::c_char;
 use std::os::raw::c_int;
 use std::os::raw::c_long;
index b16c4e7b52552b457baaefb79ae187079f839368..e10d803a6e2c02b408b86410e5b5ad4a929115db 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! lzma decompression utility module.
+
 use lzma_rs::decompress::{Options, Stream};
 use lzma_rs::error::Error;
 use std::io::{Cursor, Write};
index 399500db9ac210613501a5f6bacc93e8a9bc1b76..6f4a9bc21301bda293e845fd10e369792758a9a8 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! MIME protocol parser module.
+
 use crate::common::nom7::take_until_and_consume;
 use nom7::branch::alt;
 use nom7::bytes::streaming::{tag, take_until, take_while};
index 50e65939047f74434e6ea30359c0326504cc89ca..6f3c434a0444589bf7593f10c144b056a524a551 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Modbus application layer, logger, parser and detection module.
+
 pub mod detect;
 pub mod log;
 pub mod modbus;
index c0225ecec31c47f493a044e432fb9e0b6cb57448..aefcc33e092b289d900671849e298302badbf97f 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! MQTT application layer, detection, logger and parser module.
+
 pub mod detect;
 pub mod logger;
 pub mod mqtt;
index 17cfc724d3e81b3562fc5844a0f88aa7af48a7c1..2f6fe84df917ef0b294bb74f25c9be43f8856fc0 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! NFS application layer, parser, logger module.
+
 pub mod types;
 pub mod rpc_records;
 pub mod nfs_records;
index 35f1a70f2e1ba9850d131563876df54ab1a2ae03..30ff834304cb496365573b7fcf0748381c78865d 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! NTP application layer and parser module.
+
 // written by Pierre Chifflier  <chifflier@wzdftpd.net>
 
 pub mod ntp;
index 054fd48865987de23573abbc96740d6911b8d73b..a4c79c03192f9dbae20241712ee36abfeb2f262b 100644 (file)
@@ -15,7 +15,7 @@
  * 02110-1301, USA.
  */
 
-//! PostgreSQL parser and application layer
+//! PostgreSQL parser, logger and application layer module.
 //!
 //! written by Juliana Fajardini <jufajardini@oisf.net>
 
index f9daef7de43951c73065c974e12d98cfdfdaefc0..ad214aaa47f55930e55eba84390b8eeacd583efc 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Plugin utility module.
+
 pub fn init() {
     unsafe {
         let context = super::core::SCGetContext();
index 91693059dccb5ca9da472034d2f166bd0b5977a9..8a8f1bbd7fce13b133625de58489705126bf6260 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! QUIC application layer, parser, detection and logger module.
+
 mod crypto;
 mod cyu;
 pub mod detect;
index ddfc511d4fa6494d25d61cd43b68fd440bd0766b..dc83db829940f16ddc6abc0438083a2500b2ff6d 100644 (file)
@@ -15,7 +15,7 @@
  * 02110-1301, USA.
  */
 
-//! RDP parser and application layer
+//! RDP parser, logger and application layer module.
 //!
 //! written by Zach Kelly <zach.kelly@lmco.com>
 
index 68d37ec8a0eb1d222153e4d8faabf4b65379719d..050ee7709b70e209fab602afee3b7fad025d27cf 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! RFB protocol parser, logger and detection module.
+
 // Author: Frank Honza <frank.honza@dcso.de>
 
 pub mod detect;
index 33eec45ccdb97b893e9cc6056f4ec5e64c28c780..de63aaa5201832ff5ea6a9996a49ed6150c63509 100755 (executable)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! SIP protocol parser, detection and logger module.
+
 // written by Giuseppe Longo <giuseppe@glongo.it>
 
 pub mod detect;
index ca1eb7771fd0cc892b4d9d81dc664829313b3873..5b74f1ca4e028e5a5cea29249606f4cf2c261edf 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! SMB application layer, detection, logger and parser module.
+
 pub mod error;
 pub mod smb_records;
 pub mod smb_status;
index 3bb90ab2f35dbf7b8703f1c1b70d7434f76d27b3..7c6ceb35884b98fcb69e87e46770c831595a096d 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! SNMP application layer, parser, detection and logger module.
+
 // written by Pierre Chifflier  <chifflier@wzdftpd.net>
 
 extern crate snmp_parser;
index 12efccd0a554f0b452ea8896b0f16da145678fbd..ff506e9439a18e0f492cca3d6731b76160c5901f 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! SSH application layer, logger, detection and parser module.
+
 pub mod detect;
 pub mod logger;
 mod parser;
index 2dfa97a2f1b3e181288c097d3ca1640fb94f20eb..38685c795443366ad789033ab527ad31f09bc3c9 100644 (file)
@@ -15,5 +15,7 @@
  * 02110-1301, USA.
  */
 
+//! Telnet application layer and parser module.
+
 pub mod telnet;
 mod parser;
index 7c3d292a00f8608885df2ee9f8350499091d52a3..6ae29ac90143fbc93f8edc8ee54321335b8d9660 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! TFTP parser, logger and application layer module.
+
 // written by ClĂ©ment Galland <clement.galland@epita.fr>
 
 pub mod tftp;
index a0933689164e843121f56258ea786115b651063b..d7109464f7733f70b2921fca5914ca1558547bf0 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Utility module.
+
 use std::ffi::CStr;
 use std::os::raw::c_char;
 
index fa9706e9021102e9d9a87fa4f868e4290ec1d200..c87928cf17a8f5d7e4fe4cdbc3d73a63edca4fdd 100644 (file)
@@ -15,6 +15,8 @@
  * 02110-1301, USA.
  */
 
+//! Module for SSL/TLS X.509 certificates parser and decoder.
+
 // written by Pierre Chifflier  <chifflier@wzdftpd.net>
 
 use crate::common::rust_string_to_c;