Coverage Report

Created: 2025-07-23 07:29

/src/suricata7/rust/src/smb/funcs.rs
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (C) 2017 Open Information Security Foundation
2
 *
3
 * You can copy, redistribute or modify this Program under the terms of
4
 * the GNU General Public License version 2 as published by the Free
5
 * Software Foundation.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 * GNU General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU General Public License
13
 * version 2 along with this program; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15
 * 02110-1301, USA.
16
 */
17
18
// Based on the list in Wiresharks packet-smb2.c
19
// Names match names from Microsoft.
20
21
1.49k
pub fn fsctl_func_to_string(f: u32) -> String {
22
1.49k
    match f {
23
1.44k
        0x00060194 => "FSCTL_DFS_GET_REFERRALS",
24
0
        0x000601B0 => "FSCTL_DFS_GET_REFERRALS_EX",
25
0
        0x00090000 => "FSCTL_REQUEST_OPLOCK_LEVEL_1",
26
0
        0x00090004 => "FSCTL_REQUEST_OPLOCK_LEVEL_2", 
27
0
        0x00090008 => "FSCTL_REQUEST_BATCH_OPLOCK",
28
0
        0x0009000C => "FSCTL_OPLOCK_BREAK_ACKNOWLEDGE",
29
0
        0x00090010 => "FSCTL_OPBATCH_ACK_CLOSE_PENDING",
30
0
        0x00090014 => "FSCTL_OPLOCK_BREAK_NOTIFY",
31
0
        0x00090018 => "FSCTL_LOCK_VOLUME",
32
0
        0x0009001C => "FSCTL_UNLOCK_VOLUME",
33
0
        0x00090020 => "FSCTL_DISMOUNT_VOLUME",
34
0
        0x00090028 => "FSCTL_IS_VOLUME_MOUNTED",
35
0
        0x0009002C => "FSCTL_IS_PATHNAME_VALID",
36
0
        0x00090030 => "FSCTL_MARK_VOLUME_DIRTY",
37
0
        0x0009003B => "FSCTL_QUERY_RETRIEVAL_POINTERS",
38
0
        0x0009003C => "FSCTL_GET_COMPRESSION",
39
0
        0x0009004F => "FSCTL_MARK_AS_SYSTEM_HIVE",
40
0
        0x00090050 => "FSCTL_OPLOCK_BREAK_ACK_NO_2",
41
0
        0x00090054 => "FSCTL_INVALIDATE_VOLUMES", 
42
0
        0x00090058 => "FSCTL_QUERY_FAT_BPB",
43
0
        0x0009005C => "FSCTL_REQUEST_FILTER_OPLOCK",
44
0
        0x00090060 => "FSCTL_FILESYSTEM_GET_STATISTICS",
45
0
        0x00090064 => "FSCTL_GET_NTFS_VOLUME_DATA",
46
0
        0x00090068 => "FSCTL_GET_NTFS_FILE_RECORD",
47
0
        0x0009006F => "FSCTL_GET_VOLUME_BITMAP",
48
0
        0x00090073 => "FSCTL_GET_RETRIEVAL_POINTERS",
49
0
        0x00090074 => "FSCTL_MOVE_FILE",
50
0
        0x00090078 => "FSCTL_IS_VOLUME_DIRTY",
51
0
        0x0009007C => "FSCTL_GET_HFS_INFORMATION", 
52
0
        0x00090083 => "FSCTL_ALLOW_EXTENDED_DASD_IO",
53
0
        0x00090087 => "FSCTL_READ_PROPERTY_DATA",
54
0
        0x0009008B => "FSCTL_WRITE_PROPERTY_DATA",
55
0
        0x0009008F => "FSCTL_FIND_FILES_BY_SID",
56
0
        0x00090097 => "FSCTL_DUMP_PROPERTY_DATA",
57
0
        0x0009009C => "FSCTL_GET_OBJECT_ID",
58
0
        0x000900A4 => "FSCTL_SET_REPARSE_POINT",
59
0
        0x000900A8 => "FSCTL_GET_REPARSE_POINT",
60
0
        0x000900C0 => "FSCTL_CREATE_OR_GET_OBJECT_ID",
61
0
        0x000900C4 => "FSCTL_SET_SPARSE",
62
0
        0x000900D4 => "FSCTL_SET_ENCRYPTION",
63
0
        0x000900DB => "FSCTL_ENCRYPTION_FSCTL_IO",
64
0
        0x000900DF => "FSCTL_WRITE_RAW_ENCRYPTED",
65
0
        0x000900E3 => "FSCTL_READ_RAW_ENCRYPTED",
66
0
        0x000900F0 => "FSCTL_EXTEND_VOLUME",
67
0
        0x00090244 => "FSCTL_CSV_TUNNEL_REQUEST",
68
0
        0x0009027C => "FSCTL_GET_INTEGRITY_INFORMATION",
69
0
        0x00090284 => "FSCTL_QUERY_FILE_REGIONS",
70
0
        0x000902c8 => "FSCTL_CSV_SYNC_TUNNEL_REQUEST",
71
0
        0x00090300 => "FSCTL_QUERY_SHARED_VIRTUAL_DISK_SUPPORT",
72
0
        0x00090304 => "FSCTL_SVHDX_SYNC_TUNNEL_REQUEST",
73
0
        0x00090308 => "FSCTL_SVHDX_SET_INITIATOR_INFORMATION",
74
0
        0x0009030C => "FSCTL_SET_EXTERNAL_BACKING",
75
0
        0x00090310 => "FSCTL_GET_EXTERNAL_BACKING",
76
0
        0x00090314 => "FSCTL_DELETE_EXTERNAL_BACKING",
77
0
        0x00090318 => "FSCTL_ENUM_EXTERNAL_BACKING",
78
0
        0x0009031F => "FSCTL_ENUM_OVERLAY",
79
0
        0x00090350 => "FSCTL_STORAGE_QOS_CONTROL",
80
0
        0x00090364 => "FSCTL_SVHDX_ASYNC_TUNNEL_REQUEST",
81
0
        0x000940B3 => "FSCTL_ENUM_USN_DATA",
82
0
        0x000940B7 => "FSCTL_SECURITY_ID_CHECK",
83
0
        0x000940BB => "FSCTL_READ_USN_JOURNAL",
84
0
        0x000940CF => "FSCTL_QUERY_ALLOCATED_RANGES",
85
0
        0x000940E7 => "FSCTL_CREATE_USN_JOURNAL",
86
0
        0x000940EB => "FSCTL_READ_FILE_USN_DATA",
87
0
        0x000940EF => "FSCTL_WRITE_USN_CLOSE_RECORD",
88
0
        0x00094264 => "FSCTL_OFFLOAD_READ",
89
0
        0x00098098 => "FSCTL_SET_OBJECT_ID",
90
0
        0x000980A0 => "FSCTL_DELETE_OBJECT_ID",
91
0
        0x000980A4 => "FSCTL_SET_REPARSE_POINT",
92
0
        0x000980AC => "FSCTL_DELETE_REPARSE_POINT",
93
0
        0x000980BC => "FSCTL_SET_OBJECT_ID_EXTENDED",
94
0
        0x000980C8 => "FSCTL_SET_ZERO_DATA",
95
0
        0x000980D0 => "FSCTL_ENABLE_UPGRADE",
96
0
        0x00098208 => "FSCTL_FILE_LEVEL_TRIM",
97
0
        0x00098268 => "FSCTL_OFFLOAD_WRITE",
98
0
        0x0009C040 => "FSCTL_SET_COMPRESSION",
99
0
        0x0009C280 => "FSCTL_SET_INTEGRITY_INFORMATION",
100
0
        0x00110018 => "FSCTL_PIPE_WAIT",
101
0
        0x0011400C => "FSCTL_PIPE_PEEK",
102
30
        0x0011C017 => "FSCTL_PIPE_TRANSCEIVE",
103
0
        0x00140078 => "FSCTL_SRV_REQUEST_RESUME_KEY",
104
0
        0x001401D4 => "FSCTL_LMR_REQUEST_RESILIENCY",
105
0
        0x001401FC => "FSCTL_QUERY_NETWORK_INTERFACE_INFO",
106
0
        0x00140200 => "FSCTL_VALIDATE_NEGOTIATE_INFO_224",
107
8
        0x00140204 => "FSCTL_VALIDATE_NEGOTIATE_INFO",
108
0
        0x00144064 => "FSCTL_SRV_ENUMERATE_SNAPSHOTS",
109
0
        0x001440F2 => "FSCTL_SRV_COPYCHUNK",
110
0
        0x001441bb => "FSCTL_SRV_READ_HASH",
111
0
        0x001480F2 => "FSCTL_SRV_COPYCHUNK_WRITE",
112
12
        _ => { return (f).to_string(); },
113
1.48k
    }.to_string()
114
1.49k
}