File: data.h

package info (click to toggle)
ipfm 0.11.5-4.3
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 356 kB
  • sloc: ansic: 1,148; yacc: 328; sh: 210; makefile: 148; lex: 130
file content (53 lines) | stat: -rw-r--r-- 1,801 bytes parent folder | download | duplicates (4)
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
/*
 *  data.h - counts the data exchanged
 *
 *  (c) 1999-2001 Robert Cheramy <tibob@via.ecp.fr>
 *  (c) 1999      Andres Krapf <dae@via.ecp.fr>
 *  (c) 2001      Loc Tortay & IN2P3 Computing Center <tortay@cc.in2p3.fr>
 *
 */

/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef DATA_H
#define DATA_H

#include "filter.h"

#define MAX_DATA_SIZE 100

struct ipfm_data {
  struct ipfm_data *prev, *next;
  u_int32_t ip;
  /* NOTE : the type "unsigned long long" may not work with your compiler.
     please do write us <ipfm@via.ecp.fr> if you are experiencing problems
     with the following line */
  unsigned long long in, out;
};


void data_add(struct AllLogsType *pLog, u_int32_t ip, int in, int out);
void data_dump(struct AllLogsType *pLog);
void data_clear(struct AllLogsType *pLog);
void DataSort(struct AllLogsType *pLog);
int DataCompareOut(const void *ptr1, const void *ptr2);
int DataCompareIn(const void *ptr1, const void *ptr2);
int DataCompareTotal(const void *ptr1, const void *ptr2);
void DataFormat(struct AllLogsType *pLog, struct ipfm_data *pData,
                char *pFormatedData, int BufLen);

#endif