File: flow.h

package info (click to toggle)
pktstat 1.8.5-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 696 kB
  • sloc: ansic: 5,105; sh: 1,032; makefile: 34
file content (36 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (5)
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
/* David Leonard, 2002. Public domain. */
/* $Id: flow.h 1199 2008-02-29 16:11:24Z d $ */

#include <sys/time.h>

#define TAGLEN	1024
#define DESCLEN (TAGLEN - 2)

struct flow {
	char		tag[TAGLEN];
	char		desc[DESCLEN];
	unsigned int	taghash;
	uint64_t	octets;
	uint64_t	total_octets;
	uint64_t	packets;
	uint64_t	total_packets;
	double		keepalive;
	int		dontdel;
	unsigned long	seq[2];		/* seq no for TCP */
	void		*udata;
	void		(*freeudata)(void *);
	struct timeval	lastseen;
};

extern int nflows;
extern struct flow *flows;

struct flow *findflow(const char *tag);
void	     flow_zero(void);
void	     flow_del(struct flow *);
void	     flow_free(void);

int	     octetcmp(const void *, const void *);
int	     tagcmp(const void *, const void *);
int	     lastcmp(const void *, const void *);
int	     packetcmp(const void *, const void *);