Revision 113, 2.9 KB
(checked in by andreu, 14 years ago)
|
ticket#27 : new global structure for counters.
some bug correction in renetcol.c
|
-
Property svn:eol-style set to
native
|
Line | |
---|
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 | #define _GNU_SOURCE |
---|
27 | |
---|
28 | #include <unistd.h> |
---|
29 | #include <stdio.h> |
---|
30 | #include <string.h> |
---|
31 | #include <stdlib.h> |
---|
32 | #include <syslog.h> |
---|
33 | #include <sys/types.h> |
---|
34 | #include <sys/socket.h> |
---|
35 | #include <netinet/in.h> |
---|
36 | #include <time.h> |
---|
37 | #include <errno.h> |
---|
38 | #include <sys/ipc.h> |
---|
39 | #include <sys/shm.h> |
---|
40 | #include <sys/sem.h> |
---|
41 | #include <ctype.h> |
---|
42 | #include <netdb.h> |
---|
43 | #include <net/if.h> |
---|
44 | #include <sys/ioctl.h> |
---|
45 | #include <arpa/inet.h> |
---|
46 | #include <signal.h> |
---|
47 | #include <setjmp.h> |
---|
48 | |
---|
49 | #ifdef READFROMFILE |
---|
50 | #include <pcap.h> |
---|
51 | #endif |
---|
52 | |
---|
53 | #include "routers_mgmt.h" |
---|
54 | #include "fields_mgmt.h" |
---|
55 | #include "routers_mgmt.h" |
---|
56 | #include "tplflset_mgmt.h" |
---|
57 | #include "fields_mgmt.h" |
---|
58 | #include "headers_mgmt.h" |
---|
59 | #include "V9Header_mgmt.h" |
---|
60 | #include "template.h" |
---|
61 | #include "dataFlowSet.h" |
---|
62 | #include "get_conf.h" |
---|
63 | #include "rules_mgmt.h" |
---|
64 | #include "msg_mgmt.h" |
---|
65 | #include "pop.h" |
---|
66 | #include "renetcolParam.h" |
---|
67 | #include "as.h" |
---|
68 | #include "renetcol_mib.h" |
---|
69 | #include "engine_mgmt.h" |
---|
70 | |
---|
71 | struct SHMForAgg { |
---|
72 | unsigned short currentTable; |
---|
73 | unsigned short secondTable; |
---|
74 | unsigned short readed; |
---|
75 | unsigned short v4PrefixNb; |
---|
76 | unsigned short v4SubnetNb; |
---|
77 | unsigned short v6PrefixNb; |
---|
78 | #ifdef ASACC |
---|
79 | unsigned short ASNb; |
---|
80 | struct AS ASTab[2][MAX_AS]; |
---|
81 | #endif |
---|
82 | struct PrefixV4 prefixV4Tab[2][MAX_IPV4_PREFIX]; |
---|
83 | struct PrefixV4 prefixV4SubnetTab[2][MAX_IPV4_SUBNET]; |
---|
84 | #ifdef MATRIX |
---|
85 | struct POP matrixPOP[2][ROUTER_INDEX_MAX][ROUTER_INDEX_MAX]; |
---|
86 | #endif |
---|
87 | struct PrefixV6 prefixV6Tab[2][MAX_IPV6_PREFIX]; |
---|
88 | #if defined(IPV6LINKAGG) && defined(IPV6AGGIDSNMP) |
---|
89 | struct IndexV6 indexV6Tab[2][ROUTER_INDEX_MAX][MAX_INDEX_BY_ROUTER]; |
---|
90 | #endif |
---|
91 | struct RenetcolMIB myMIB[2][1]; |
---|
92 | }; |
---|
93 | |
---|
94 | void setCache(RulesPtr); |
---|
95 | void initCache(); |
---|
96 | void waitingRoom(); |
---|
97 | void initRule(); |
---|
98 | void sigusr1Mgmt(int); |
---|
99 | void sendMyPid(int); |
---|
100 | void sendReadRulesSignal(int); |
---|
101 | void initStream(); |
---|
102 | void catchAlarm(int); |
---|
103 | int socketLoop(); |
---|
104 | short initSocket(); |
---|
105 | short initFile(); |
---|
106 | short socketReading(); |
---|
107 | short fileReading(); |
---|
108 | short getFlow(short); |
---|
109 | short checkFlow(short); |
---|
110 | void showAllTplFlSet(); |
---|
111 | void writeAllTplFlSet(); |
---|
112 | int initMIB(struct RenetcolMIB *); |
---|