Files
iftop/iftop.h
chris 2dc4a06dda ""
2003-02-06 10:51:24 +00:00

49 lines
900 B
C

/*
* iftop.h:
*
*/
#ifndef __IFTOP_H_ /* include guard */
#define __IFTOP_H_
#include "config.h"
/* 60 / 3 */
#define HISTORY_LENGTH 20
#define RESOLUTION 2
typedef struct {
long recv[HISTORY_LENGTH];
long sent[HISTORY_LENGTH];
double long total_sent;
double long total_recv;
int last_write;
} history_type;
void tick(void);
void *xmalloc(size_t n);
void *xcalloc(size_t n, size_t m);
void *xrealloc(void *w, size_t n);
char *xstrdup(const char *s);
void xfree(void *v);
/* ui.c */
void analyse_data(void);
void ui_init(void);
/* options.c */
void options_read(int argc, char **argv);
/* Make use of SIOCGIFHWADDR work on FreeBSD and Solaris. */
#ifndef SIOCGIFHWADDR
# ifdef HAVE_SYS_SOCKIO_H
# include <sys/sockio.h> /* Solaris and others?? */
# endif
# define SIOCGIFHWADDR SIOCGIFADDR
# define ifr_hwaddr ifr_addr
#endif
#endif /* __IFTOP_H_ */