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 | #include "renetcolAgg.h" |
---|
36 | |
---|
37 | struct SHMForAgg *shmForAgg; |
---|
38 | |
---|
39 | int |
---|
40 | main(int argc, char *argv[]) |
---|
41 | { |
---|
42 | int shmid; |
---|
43 | int i, j, k = 0; |
---|
44 | int index = 1; |
---|
45 | int rrd_update_er_ct = 0; |
---|
46 | int rrd_update_ok_ct = 0; |
---|
47 | int rrd_already_created_ct = 0; |
---|
48 | int rrd_create_er_ct = 0; |
---|
49 | int rrd_create_ok_ct = 0; |
---|
50 | int rrd_ct = 0; |
---|
51 | int isFirstUpdate = 1; |
---|
52 | key_t key; |
---|
53 | static char buf[2048]; |
---|
54 | static char name[2048]; |
---|
55 | static char ipStr[24]; |
---|
56 | static char indexStr[24]; |
---|
57 | static char createstr[2048]; |
---|
58 | char *opt[27]; |
---|
59 | char *optUpdate[3]; |
---|
60 | int res_rrd = 0; |
---|
61 | FILE *fp; |
---|
62 | static time_t now, now2; |
---|
63 | struct shmid_ds shminfo; |
---|
64 | |
---|
65 | key = 8765; |
---|
66 | if ((shmid = shmget(key, SHMSIZE, 0666)) < 0) { |
---|
67 | perror("shmget"); |
---|
68 | exit(1); |
---|
69 | } |
---|
70 | if ((shmForAgg = (struct SHMForAgg *)shmat(shmid, (void *)0, 0)) == (void *) -1) { |
---|
71 | perror("shmat"); |
---|
72 | exit(1); |
---|
73 | } |
---|
74 | |
---|
75 | fprintf(stderr, "renetcolAgg: I become a deamon, next messages via syslogd. By.\n"); |
---|
76 | if (fork () != 0) |
---|
77 | exit (0); |
---|
78 | if (setsid() == -1){ |
---|
79 | exit(4); |
---|
80 | } |
---|
81 | |
---|
82 | do { |
---|
83 | if (shmForAgg->readed == 1) { |
---|
84 | shmForAgg->readed = 0; |
---|
85 | if (shmForAgg->currentTable == 0) { |
---|
86 | index = 1; |
---|
87 | }else{ |
---|
88 | index = 0; |
---|
89 | } |
---|
90 | now = time((time_t *)NULL); |
---|
91 | if (isFirstUpdate == 0) { |
---|
92 | |
---|
93 | for (i=0; i<shmForAgg->v4PrefixNb; i++){ |
---|
94 | |
---|
95 | if (shmForAgg->prefixV4Tab[index][i].sampling != 0) { |
---|
96 | for (j=0; j<strlen(name); j++) {name[j] = '\0';} |
---|
97 | for (j=0; j<strlen(createstr); j++) {createstr[j] = '\0';} |
---|
98 | for (j=0; j<strlen(ipStr); j++) {ipStr[j] = '\0';} |
---|
99 | for (j=0; j<strlen(buf); j++) {buf[j] = '\0';} |
---|
100 | strcat(name, PREFIX_RRD_LOCATION); |
---|
101 | sprintf(ipStr, "%lu_%lu_%lu_%lu_%hu_%lu", |
---|
102 | shmForAgg->prefixV4Tab[index][i].beginning>>24, |
---|
103 | shmForAgg->prefixV4Tab[index][i].beginning<<8>>24, |
---|
104 | shmForAgg->prefixV4Tab[index][i].beginning<<16>>24, |
---|
105 | shmForAgg->prefixV4Tab[index][i].beginning<<24>>24, |
---|
106 | shmForAgg->prefixV4Tab[index][i].mask, |
---|
107 | shmForAgg->prefixV4Tab[index][i].sampling |
---|
108 | ); |
---|
109 | strcat(name, ipStr); |
---|
110 | strcat(name, RRD_EXTENSION); |
---|
111 | if ( (fp=fopen(name,"r")) == NULL ){ |
---|
112 | opt[0]= (char *) malloc((strlen(RRD_PARAM_PREFIX_0) + 1) * sizeof(char)); |
---|
113 | strcpy(opt[0], RRD_PARAM_PREFIX_0); |
---|
114 | opt[1]= (char *) malloc((strlen(name) + 1) * sizeof(char)); |
---|
115 | strcpy(opt[1], name); |
---|
116 | opt[2]= (char *) malloc((strlen(RRD_PARAM_PREFIX_1) + 1) * sizeof(char)); |
---|
117 | strcpy(opt[2], RRD_PARAM_PREFIX_1); |
---|
118 | opt[3]= (char *) malloc((strlen(RRD_PARAM_PREFIX_2) + 1) * sizeof(char)); |
---|
119 | strcpy(opt[3], RRD_PARAM_PREFIX_2); |
---|
120 | opt[4]= (char *) malloc((strlen(RRD_PARAM_PREFIX_3) + 1) * sizeof(char)); |
---|
121 | strcpy(opt[4], RRD_PARAM_PREFIX_3); |
---|
122 | opt[5]= (char *) malloc((strlen(RRD_PARAM_PREFIX_4) + 1) * sizeof(char)); |
---|
123 | strcpy(opt[5], RRD_PARAM_PREFIX_4); |
---|
124 | opt[6]= (char *) malloc((strlen(RRD_PARAM_PREFIX_5) + 1) * sizeof(char)); |
---|
125 | strcpy(opt[6], RRD_PARAM_PREFIX_5); |
---|
126 | opt[7]= (char *) malloc((strlen(RRD_PARAM_PREFIX_6) + 1) * sizeof(char)); |
---|
127 | strcpy(opt[7], RRD_PARAM_PREFIX_6); |
---|
128 | opt[8]= (char *) malloc((strlen(RRD_PARAM_PREFIX_7) + 1) * sizeof(char)); |
---|
129 | strcpy(opt[8], RRD_PARAM_PREFIX_7); |
---|
130 | opt[9]= (char *) malloc((strlen(RRD_PARAM_PREFIX_8) + 1) * sizeof(char)); |
---|
131 | strcpy(opt[9], RRD_PARAM_PREFIX_8); |
---|
132 | opt[10]= (char *) malloc((strlen(RRD_PARAM_PREFIX_9) + 1) * sizeof(char)); |
---|
133 | strcpy(opt[10], RRD_PARAM_PREFIX_9); |
---|
134 | opt[11]= (char *) malloc((strlen(RRD_PARAM_PREFIX_10) + 1) * sizeof(char)); |
---|
135 | strcpy(opt[11], RRD_PARAM_PREFIX_10); |
---|
136 | opt[12]= (char *) malloc((strlen(RRD_PARAM_PREFIX_11) + 1) * sizeof(char)); |
---|
137 | strcpy(opt[12], RRD_PARAM_PREFIX_11); |
---|
138 | opt[13]= (char *) malloc((strlen(RRD_PARAM_PREFIX_12) + 1) * sizeof(char)); |
---|
139 | strcpy(opt[13], RRD_PARAM_PREFIX_12); |
---|
140 | opt[14]= (char *) malloc((strlen(RRD_PARAM_PREFIX_13) + 1) * sizeof(char)); |
---|
141 | strcpy(opt[14], RRD_PARAM_PREFIX_13); |
---|
142 | opt[15]= (char *) malloc((strlen(RRD_PARAM_PREFIX_14) + 1) * sizeof(char)); |
---|
143 | strcpy(opt[15], RRD_PARAM_PREFIX_14); |
---|
144 | opt[16]= (char *) malloc((strlen(RRD_PARAM_PREFIX_15) + 1) * sizeof(char)); |
---|
145 | strcpy(opt[16], RRD_PARAM_PREFIX_15); |
---|
146 | opt[17]= (char *) malloc((strlen(RRD_PARAM_PREFIX_16) + 1) * sizeof(char)); |
---|
147 | strcpy(opt[17], RRD_PARAM_PREFIX_16); |
---|
148 | opt[18]= (char *) malloc((strlen(RRD_PARAM_PREFIX_17) + 1) * sizeof(char)); |
---|
149 | strcpy(opt[18], RRD_PARAM_PREFIX_17); |
---|
150 | opt[19]= (char *) malloc((strlen(RRD_PARAM_PREFIX_18) + 1) * sizeof(char)); |
---|
151 | strcpy(opt[19], RRD_PARAM_PREFIX_18); |
---|
152 | opt[20]= (char *) malloc((strlen(RRD_PARAM_PREFIX_19) + 1) * sizeof(char)); |
---|
153 | strcpy(opt[20], RRD_PARAM_PREFIX_19); |
---|
154 | opt[21]= (char *) malloc((strlen(RRD_PARAM_PREFIX_20) + 1) * sizeof(char)); |
---|
155 | strcpy(opt[21], RRD_PARAM_PREFIX_20); |
---|
156 | opt[22]= (char *) malloc((strlen(RRD_PARAM_PREFIX_21) + 1) * sizeof(char)); |
---|
157 | strcpy(opt[22], RRD_PARAM_PREFIX_21); |
---|
158 | opt[23]= (char *) malloc((strlen(RRD_PARAM_PREFIX_22) + 1) * sizeof(char)); |
---|
159 | strcpy(opt[23], RRD_PARAM_PREFIX_22); |
---|
160 | opt[24]= (char *) malloc((strlen(RRD_PARAM_PREFIX_23) + 1) * sizeof(char)); |
---|
161 | strcpy(opt[24], RRD_PARAM_PREFIX_23); |
---|
162 | opt[25]= (char *) malloc((strlen(RRD_PARAM_PREFIX_24) + 1) * sizeof(char)); |
---|
163 | strcpy(opt[25], RRD_PARAM_PREFIX_24); |
---|
164 | opt[26]= (char *) malloc((strlen(RRD_PARAM_PREFIX_25) + 1) * sizeof(char)); |
---|
165 | strcpy(opt[26], RRD_PARAM_PREFIX_25); |
---|
166 | optind = opterr = 0; |
---|
167 | rrd_clear_error(); |
---|
168 | if ( rrd_create(27,opt) < 0) { |
---|
169 | syslog(LOG_ERR, "RRD create file %s, error: %s\n", name, rrd_get_error()); |
---|
170 | rrd_create_er_ct++; |
---|
171 | } else { |
---|
172 | rrd_create_ok_ct++; |
---|
173 | } |
---|
174 | for ( j=0; j<27; j++) { |
---|
175 | free(opt[j]); |
---|
176 | opt[j] = NULL; |
---|
177 | } |
---|
178 | }else{ |
---|
179 | fclose(fp); |
---|
180 | rrd_already_created_ct++; |
---|
181 | snprintf(buf, |
---|
182 | 2048, |
---|
183 | "%lu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu:%llu", |
---|
184 | now-300, |
---|
185 | shmForAgg->prefixV4Tab[index][i].flowNbIN, |
---|
186 | shmForAgg->prefixV4Tab[index][i].flowNbOUT, |
---|
187 | shmForAgg->prefixV4Tab[index][i].bytesNbIN, |
---|
188 | shmForAgg->prefixV4Tab[index][i].bytesNbOUT, |
---|
189 | shmForAgg->prefixV4Tab[index][i].pktsNbIN, |
---|
190 | shmForAgg->prefixV4Tab[index][i].pktsNbOUT, |
---|
191 | shmForAgg->prefixV4Tab[index][i].firstCoSIN, |
---|
192 | shmForAgg->prefixV4Tab[index][i].firstCoSOUT, |
---|
193 | shmForAgg->prefixV4Tab[index][i].secondCoSIN, |
---|
194 | shmForAgg->prefixV4Tab[index][i].secondCoSOUT, |
---|
195 | shmForAgg->prefixV4Tab[index][i].thirdCoSIN, |
---|
196 | shmForAgg->prefixV4Tab[index][i].thirdCoSOUT, |
---|
197 | shmForAgg->prefixV4Tab[index][i].fourthCoSIN, |
---|
198 | shmForAgg->prefixV4Tab[index][i].fourthCoSOUT |
---|
199 | ); |
---|
200 | optUpdate[0]= (char *) malloc((strlen(RRD_UPDATE_0) + 1) * sizeof(char)); |
---|
201 | strcpy(optUpdate[0], RRD_UPDATE_0); |
---|
202 | optUpdate[1]= (char *) malloc((strlen(name) + 1) * sizeof(char)); |
---|
203 | strcpy(optUpdate[1], name); |
---|
204 | optUpdate[2]= (char *) malloc((strlen(buf) + 1) * sizeof(char)); |
---|
205 | strcpy(optUpdate[2], buf); |
---|
206 | optind = opterr = 0; |
---|
207 | rrd_clear_error(); |
---|
208 | if ( rrd_update(3, optUpdate) < 0 ) { |
---|
209 | syslog(LOG_ERR, "RRD update file %s, error: %s\n", name, rrd_get_error()); |
---|
210 | rrd_update_er_ct++; |
---|
211 | } else { |
---|
212 | rrd_update_ok_ct++; |
---|
213 | } |
---|
214 | for ( j=0; j<3; j++) { |
---|
215 | free(optUpdate[j]); |
---|
216 | optUpdate[j] = NULL; |
---|
217 | } |
---|
218 | } |
---|
219 | |
---|
220 | shmForAgg->prefixV4Tab[index][i].flowNbIN = 0; |
---|
221 | shmForAgg->prefixV4Tab[index][i].bytesNbIN = 0; |
---|
222 | shmForAgg->prefixV4Tab[index][i].pktsNbIN = 0; |
---|
223 | shmForAgg->prefixV4Tab[index][i].flowNbOUT = 0; |
---|
224 | shmForAgg->prefixV4Tab[index][i].bytesNbOUT = 0; |
---|
225 | shmForAgg->prefixV4Tab[index][i].pktsNbOUT = 0; |
---|
226 | shmForAgg->prefixV4Tab[index][i].firstCoSIN = 0; |
---|
227 | shmForAgg->prefixV4Tab[index][i].secondCoSIN = 0; |
---|
228 | shmForAgg->prefixV4Tab[index][i].thirdCoSIN = 0; |
---|
229 | shmForAgg->prefixV4Tab[index][i].fourthCoSIN = 0; |
---|
230 | shmForAgg->prefixV4Tab[index][i].firstCoSOUT = 0; |
---|
231 | shmForAgg->prefixV4Tab[index][i].secondCoSOUT = 0; |
---|
232 | shmForAgg->prefixV4Tab[index][i].thirdCoSOUT = 0; |
---|
233 | shmForAgg->prefixV4Tab[index][i].fourthCoSOUT = 0; |
---|
234 | } |
---|
235 | } |
---|
236 | |
---|
237 | |
---|
238 | for (i=0; i<ROUTER_INDEX_MAX; i++){ |
---|
239 | for (j=0; j<ROUTER_INDEX_MAX; j++){ |
---|
240 | |
---|
241 | for (k=0; k<strlen(name); k++) {name[k] = '\0';} |
---|
242 | for (k=0; k<strlen(createstr); k++) {createstr[k] = '\0';} |
---|
243 | for (k=0; k<strlen(indexStr); k++) {indexStr[k] = '\0';} |
---|
244 | for (k=0; k<strlen(buf); k++) {buf[k] = '\0';} |
---|
245 | strcat(name, MATRIX_RRD_LOCATION); |
---|
246 | sprintf(indexStr, "%d_%d", |
---|
247 | i, |
---|
248 | j |
---|
249 | ); |
---|
250 | strcat(name, indexStr); |
---|
251 | strcat(name, RRD_EXTENSION); |
---|
252 | if ( (fp=fopen(name,"r")) == NULL ){ |
---|
253 | opt[0]= (char *) malloc((strlen(RRD_PARAM_MATRIX_0) + 1) * sizeof(char)); |
---|
254 | strcpy(opt[0], RRD_PARAM_MATRIX_0); |
---|
255 | opt[1]= (char *) malloc((strlen(name) + 1) * sizeof(char)); |
---|
256 | strcpy(opt[1], name); |
---|
257 | opt[2]= (char *) malloc((strlen(RRD_PARAM_MATRIX_1) + 1) * sizeof(char)); |
---|
258 | strcpy(opt[2], RRD_PARAM_MATRIX_1); |
---|
259 | opt[3]= (char *) malloc((strlen(RRD_PARAM_MATRIX_2) + 1) * sizeof(char)); |
---|
260 | strcpy(opt[3], RRD_PARAM_MATRIX_2); |
---|
261 | opt[4]= (char *) malloc((strlen(RRD_PARAM_MATRIX_3) + 1) * sizeof(char)); |
---|
262 | strcpy(opt[4], RRD_PARAM_MATRIX_3); |
---|
263 | opt[5]= (char *) malloc((strlen(RRD_PARAM_MATRIX_4) + 1) * sizeof(char)); |
---|
264 | strcpy(opt[5], RRD_PARAM_MATRIX_4); |
---|
265 | opt[6]= (char *) malloc((strlen(RRD_PARAM_MATRIX_5) + 1) * sizeof(char)); |
---|
266 | strcpy(opt[6], RRD_PARAM_MATRIX_5); |
---|
267 | opt[7]= (char *) malloc((strlen(RRD_PARAM_MATRIX_6) + 1) * sizeof(char)); |
---|
268 | strcpy(opt[7], RRD_PARAM_MATRIX_6); |
---|
269 | opt[8]= (char *) malloc((strlen(RRD_PARAM_MATRIX_7) + 1) * sizeof(char)); |
---|
270 | strcpy(opt[8], RRD_PARAM_MATRIX_7); |
---|
271 | opt[9]= (char *) malloc((strlen(RRD_PARAM_MATRIX_8) + 1) * sizeof(char)); |
---|
272 | strcpy(opt[9], RRD_PARAM_MATRIX_8); |
---|
273 | opt[10]= (char *) malloc((strlen(RRD_PARAM_MATRIX_9) + 1) * sizeof(char)); |
---|
274 | strcpy(opt[10], RRD_PARAM_MATRIX_9); |
---|
275 | opt[11]= (char *) malloc((strlen(RRD_PARAM_MATRIX_10) + 1) * sizeof(char)); |
---|
276 | strcpy(opt[11], RRD_PARAM_MATRIX_10); |
---|
277 | opt[12]= (char *) malloc((strlen(RRD_PARAM_MATRIX_11) + 1) * sizeof(char)); |
---|
278 | strcpy(opt[12], RRD_PARAM_MATRIX_11); |
---|
279 | opt[13]= (char *) malloc((strlen(RRD_PARAM_MATRIX_12) + 1) * sizeof(char)); |
---|
280 | strcpy(opt[13], RRD_PARAM_MATRIX_12); |
---|
281 | opt[14]= (char *) malloc((strlen(RRD_PARAM_MATRIX_13) + 1) * sizeof(char)); |
---|
282 | strcpy(opt[14], RRD_PARAM_MATRIX_13); |
---|
283 | opt[15]= (char *) malloc((strlen(RRD_PARAM_MATRIX_14) + 1) * sizeof(char)); |
---|
284 | strcpy(opt[15], RRD_PARAM_MATRIX_14); |
---|
285 | optind = opterr = 0; |
---|
286 | rrd_clear_error(); |
---|
287 | if ( rrd_create(16,opt) < 0) { |
---|
288 | syslog(LOG_ERR, "RRD create file %s, error: %s\n", name, rrd_get_error()); |
---|
289 | rrd_create_er_ct++; |
---|
290 | } else { |
---|
291 | rrd_create_ok_ct++; |
---|
292 | } |
---|
293 | for ( k=0; k<16; k++) { |
---|
294 | free(opt[k]); |
---|
295 | opt[k] = NULL; |
---|
296 | } |
---|
297 | }else{ |
---|
298 | fclose(fp); |
---|
299 | rrd_already_created_ct++; |
---|
300 | snprintf(buf, |
---|
301 | 2048, |
---|
302 | "%lu:%llu:%llu:%llu", |
---|
303 | now-300, |
---|
304 | shmForAgg->matrixPOP[index][i][j].flowNb, |
---|
305 | shmForAgg->matrixPOP[index][i][j].bytesNb, |
---|
306 | shmForAgg->matrixPOP[index][i][j].pktsNb |
---|
307 | ); |
---|
308 | optUpdate[0]= (char *) malloc((strlen(RRD_UPDATE_0) + 1) * sizeof(char)); |
---|
309 | strcpy(optUpdate[0], RRD_UPDATE_0); |
---|
310 | optUpdate[1]= (char *) malloc((strlen(name) + 1) * sizeof(char)); |
---|
311 | strcpy(optUpdate[1], name); |
---|
312 | optUpdate[2]= (char *) malloc((strlen(buf) + 1) * sizeof(char)); |
---|
313 | strcpy(optUpdate[2], buf); |
---|
314 | optind = opterr = 0; |
---|
315 | rrd_clear_error(); |
---|
316 | if ( rrd_update(3, optUpdate) < 0 ) { |
---|
317 | syslog(LOG_ERR, "RRD update file %s, error: %s\n", name, rrd_get_error()); |
---|
318 | rrd_update_er_ct++; |
---|
319 | } else { |
---|
320 | rrd_update_ok_ct++; |
---|
321 | } |
---|
322 | for ( k=0; k<3; k++) { |
---|
323 | free(optUpdate[k]); |
---|
324 | optUpdate[k] = NULL; |
---|
325 | } |
---|
326 | } |
---|
327 | |
---|
328 | } |
---|
329 | } |
---|
330 | |
---|
331 | for (i=0; i<ROUTER_INDEX_MAX; i++){ |
---|
332 | for (j=0; j<ROUTER_INDEX_MAX; j++) { |
---|
333 | shmForAgg->matrixPOP[index][i][j].bytesNb = 0; |
---|
334 | shmForAgg->matrixPOP[index][i][j].pktsNb = 0; |
---|
335 | shmForAgg->matrixPOP[index][i][j].flowNb = 0; |
---|
336 | } |
---|
337 | } |
---|
338 | |
---|
339 | now2 = time((time_t *)NULL); |
---|
340 | |
---|
341 | fprintf(stderr, "IPv4 subnet managment (rrd update) : \n %d sec, %d files updated, %d errors, total %d\n %d rrd file already created, %d errors in creation, %d new rrd file creations", |
---|
342 | now2-now, |
---|
343 | rrd_update_ok_ct, |
---|
344 | rrd_update_er_ct, |
---|
345 | rrd_update_ok_ct+rrd_update_er_ct, |
---|
346 | rrd_already_created_ct, |
---|
347 | rrd_create_er_ct, |
---|
348 | rrd_create_ok_ct); |
---|
349 | |
---|
350 | rrd_update_ok_ct = 0; |
---|
351 | rrd_update_er_ct = 0; |
---|
352 | rrd_already_created_ct = 0; |
---|
353 | rrd_create_er_ct = 0; |
---|
354 | rrd_create_ok_ct = 0; |
---|
355 | rrd_clear_error(); |
---|
356 | } else { |
---|
357 | isFirstUpdate = 0; |
---|
358 | |
---|
359 | for (i=0; i<shmForAgg->v4PrefixNb; i++){ |
---|
360 | shmForAgg->prefixV4Tab[index][i].flowNbIN = 0; |
---|
361 | shmForAgg->prefixV4Tab[index][i].bytesNbIN = 0; |
---|
362 | shmForAgg->prefixV4Tab[index][i].pktsNbIN = 0; |
---|
363 | shmForAgg->prefixV4Tab[index][i].flowNbOUT = 0; |
---|
364 | shmForAgg->prefixV4Tab[index][i].bytesNbOUT = 0; |
---|
365 | shmForAgg->prefixV4Tab[index][i].pktsNbOUT = 0; |
---|
366 | shmForAgg->prefixV4Tab[index][i].firstCoSIN = 0; |
---|
367 | shmForAgg->prefixV4Tab[index][i].secondCoSIN = 0; |
---|
368 | shmForAgg->prefixV4Tab[index][i].thirdCoSIN = 0; |
---|
369 | shmForAgg->prefixV4Tab[index][i].fourthCoSIN = 0; |
---|
370 | shmForAgg->prefixV4Tab[index][i].firstCoSOUT = 0; |
---|
371 | shmForAgg->prefixV4Tab[index][i].secondCoSOUT = 0; |
---|
372 | shmForAgg->prefixV4Tab[index][i].thirdCoSOUT = 0; |
---|
373 | shmForAgg->prefixV4Tab[index][i].fourthCoSOUT = 0; |
---|
374 | } |
---|
375 | |
---|
376 | for (i=0; i<ROUTER_INDEX_MAX; i++){ |
---|
377 | for (j=0; j<ROUTER_INDEX_MAX; j++) { |
---|
378 | shmForAgg->matrixPOP[index][i][j].bytesNb = 0; |
---|
379 | shmForAgg->matrixPOP[index][i][j].pktsNb = 0; |
---|
380 | shmForAgg->matrixPOP[index][i][j].flowNb = 0; |
---|
381 | } |
---|
382 | } |
---|
383 | } |
---|
384 | } |
---|
385 | sleep(10); |
---|
386 | } while (1); |
---|
387 | exit(0); |
---|
388 | } |
---|