-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnf-hishape_util.h
81 lines (64 loc) · 2.45 KB
/
nf-hishape_util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* Copyright 2007-2008 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
* or its licensors, as applicable.
*
* You may not use this file except under the terms of the accompanying license.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project: nf-HiShape
* File: nf-hishape_util.h
* Purpose: header file containing functions for interacting with the nf-hishape kernel module
* Responsible: Markus Goldstein
* Primary Repository: https://github.com/Markus-Go/nf-hishape
* Web Sites: www.madm.dfki.de, www.goldiges.de
*/
#ifndef TEST_H_
#define TEST_H_
#include <sys/ioctl.h>
#include <inttypes.h>
#include <list>
#include <iomanip>
#include <algorithm>
#include <fcntl.h> /* für open(..) */
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <string.h>
#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#include "nf-hishape.h"
using namespace std;
//compare two HiShapeRange according to their "uint32_t from"
//the function will later be used to sort a list of HiShapeRange
bool compare_HiShapeRange(const HiShapeRange &a, const HiShapeRange &b);
//this function checks of overlapping on the elements of the list l,
//returns true in case of overlapping, otherwise false
bool check_overlapping(list<HiShapeRange*> l);
//copies HiSHapeRange
inline void copy(HiShapeRange &target, const HiShapeRange &source);
//this function sorts the list and check for overlapping. If the list
//doesn't overlapp, its entries are copied to dst and true is returned.
//otherwise nothing is done and false is returned
bool getHiShapeArray(HiShapeRanges* dst, list<HiShapeRange> src);
//this function interacts with the nf-hishape kernel module. The list's entries
//are copied to the module
int setHiShapeRanges(list<HiShapeRange> ranges);
//this function interacts with the nf-hishape kernel module. The entire module
//contain is returned in a list
list<HiShapeRange> getHiShapeRanges();
void print_elements(list<HiShapeRange> list1);
////prints the -H option
//void print_help();
//
////executes the user command
//void do_command(int argc,char *argv[]);
typedef list<HiShapeRange>::iterator iter;
#endif /*TEST_H_*/