suricata
detect-cipservice.h
Go to the documentation of this file.
1 /* Copyright (C) 2015-2022 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 /**
19  * \file
20  *
21  * \author Kevin Wong <kwong@solananetworks.com>
22  */
23 
24 #ifndef _DETECT_CIPSERVICE_H
25 #define _DETECT_CIPSERVICE_H
26 
27 /**
28  * CIP Service rule data structure
29  */
30 typedef struct DetectCipServiceData_
31 {
32  uint8_t cipservice; /* cip service type */
33  uint16_t cipclass;
34  uint16_t cipattribute;
35  uint8_t matchattribute; /* whether to match on attribute*/
36  uint8_t tokens; /* number of parameters*/
38 
39 /**
40  * ENIP Command rule data structure
41  */
42 typedef struct DetectEnipCommandData_
43 {
44  uint16_t enipcommand; /* enip command */
46 
47 void DetectCipServiceRegister(void);
48 void DetectEnipCommandRegister(void);
49 
50 /**
51  * link list node for storing CIP service data
52  */
53 typedef struct CIPServiceData_
54 {
55  uint8_t service; //cip service
56  union
57  {
58  struct
59  {
60  uint8_t path_size; //cip path size
61  uint16_t path_offset; //offset to cip path
63  struct
64  {
65  uint8_t status;
67  };
70 
71 #endif /* _DETECT_CIPSERVICE_H */
DetectCipServiceData_::matchattribute
uint8_t matchattribute
Definition: detect-cipservice.h:35
DetectCipServiceData_::tokens
uint8_t tokens
Definition: detect-cipservice.h:36
DetectCipServiceRegister
void DetectCipServiceRegister(void)
Registration function for cip_service: keyword.
Definition: detect-cipservice.c:53
CIPServiceData_::path_offset
uint16_t path_offset
Definition: detect-cipservice.h:61
CIPServiceData_::service
uint8_t service
Definition: detect-cipservice.h:55
CIPServiceData_::next
struct CIPServiceData * next
Definition: detect-cipservice.h:68
CIPServiceData_::path_size
uint8_t path_size
Definition: detect-cipservice.h:60
DetectCipServiceData_::cipservice
uint8_t cipservice
Definition: detect-cipservice.h:32
CIPServiceData_::status
uint8_t status
Definition: detect-cipservice.h:65
DetectEnipCommandData_::enipcommand
uint16_t enipcommand
Definition: detect-cipservice.h:44
CIPServiceData_::request
struct CIPServiceData_::@51::@53 request
DetectEnipCommandData_
Definition: detect-cipservice.h:43
CIPServiceData_::response
struct CIPServiceData_::@51::@54 response
DetectEnipCommandData
struct DetectEnipCommandData_ DetectEnipCommandData
CIPServiceData
struct CIPServiceData_ CIPServiceData
CIPServiceData_
Definition: detect-cipservice.h:54
DetectEnipCommandRegister
void DetectEnipCommandRegister(void)
Registration function for enip_command: keyword.
Definition: detect-cipservice.c:299
DetectCipServiceData_::cipattribute
uint16_t cipattribute
Definition: detect-cipservice.h:34
DetectCipServiceData_::cipclass
uint16_t cipclass
Definition: detect-cipservice.h:33
DetectCipServiceData_
Definition: detect-cipservice.h:31
DetectCipServiceData
struct DetectCipServiceData_ DetectCipServiceData