suricata
detect-rpc.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 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 Pablo Rincon <pablo.rincon.crespo@gmail.com>
22  */
23 
24 #ifndef __DETECT_RPC_H__
25 #define __DETECT_RPC_H__
26 
27 /* At least we check the program, the version is optional,
28  * and the procedure is optional if we are checking the version.
29  * If we parse the wildcard "*" we will allow any value (no check) */
30 #define DETECT_RPC_CHECK_PROGRAM 0x01
31 #define DETECT_RPC_CHECK_VERSION 0x02
32 #define DETECT_RPC_CHECK_PROCEDURE 0x04
33 
34 /** Simple struct for a rpc msg call */
35 typedef struct RpcMsg_ {
36  uint32_t xid;
37  uint32_t type; /**< CALL = 0 (We only search for CALLS */
38  uint32_t rpcvers; /**< must be equal to two (2) */
39  uint32_t prog;
40  uint32_t vers;
41  uint32_t proc;
42 } RpcMsg;
43 
44 /* Extract uint32_t */
45 #define EXT_GET_UINT32T(buf) ((long)SCNtohl((long)*(buf)++))
46 
47 typedef struct DetectRpcData_ {
48  uint32_t program;
49  uint32_t program_version;
50  uint32_t procedure;
51  uint8_t flags;
53 
54 /* prototypes */
55 void DetectRpcRegister (void);
56 
57 #endif /* __DETECT_RPC_H__ */
58 
uint32_t prog
Definition: detect-rpc.h:39
uint32_t vers
Definition: detect-rpc.h:40
uint8_t flags
Definition: detect-rpc.h:51
void DetectRpcRegister(void)
Registration function for rpc keyword.
Definition: detect-rpc.c:60
uint32_t type
Definition: detect-rpc.h:37
uint32_t xid
Definition: detect-rpc.h:36
uint32_t rpcvers
Definition: detect-rpc.h:38
uint32_t program_version
Definition: detect-rpc.h:49
uint32_t proc
Definition: detect-rpc.h:41
uint32_t procedure
Definition: detect-rpc.h:50
struct DetectRpcData_ DetectRpcData
struct RpcMsg_ RpcMsg
uint32_t program
Definition: detect-rpc.h:48