1 /*
2  *  Copyright (C) 2014-2022 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
3  *
4  *  Authors: Kevin Lin <klin@sourcefire.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License version 2 as
8  *  published by the Free Software Foundation.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18  *  MA 02110-1301, USA.
19  */
20 
21 #ifndef __PRTN_INTXN_H
22 #define __PRTN_INTXN_H
23 
24 #if HAVE_CONFIG_H
25 #include "clamav-config.h"
26 #endif
27 
28 #include "clamav-types.h"
29 #include "others.h"
30 
31 #define PRTN_INTXN_DETECTION "heuristic.partitionintersection"
32 
33 struct partition_intersection_node;
34 typedef struct partition_intersection_node {
35     off_t Start;
36     size_t Size;
37     struct partition_intersection_node *Next;
38 } partition_intersection_node_t;
39 
40 typedef struct partition_intersection_list {
41     struct partition_intersection_node *Head;
42     size_t Size; /* for debug */
43 } partition_intersection_list_t;
44 
45 int partition_intersection_list_init(partition_intersection_list_t *list);
46 int partition_intersection_list_check(partition_intersection_list_t *list, unsigned *pitxn, off_t start, size_t size);
47 int partition_intersection_list_free(partition_intersection_list_t *list);
48 
49 #endif
50