File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / iftop / iftop.h
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Oct 18 14:04:50 2016 UTC (7 years, 8 months ago) by misho
Branches: iftop, MAIN
CVS tags: v1_0rc4, HEAD
iftop 1.0pre4

    1: /*
    2:  * iftop.h:
    3:  *
    4:  */
    5: 
    6: #ifndef __IFTOP_H_ /* include guard */
    7: #define __IFTOP_H_
    8: 
    9: #include "config.h"
   10: 
   11: /* 40 / 2  */
   12: #define HISTORY_LENGTH  20
   13: #define RESOLUTION 2
   14: #define DUMP_RESOLUTION 300
   15: 
   16: /* At least OpenBSD and NexentaCore do not
   17:  * define s6_addr32 for user land settings.
   18:  */
   19: #if !defined s6_addr32 && defined __sun__
   20: #	define s6_addr32 _S6_un._S6_u32
   21: #elif !defined s6_addr32 && \
   22: 		( defined __OpenBSD__ || defined __FreeBSD__ )
   23: #	define s6_addr32 __u6_addr.__u6_addr32
   24: #endif	/* !defined s6_addr32 */
   25: 
   26: typedef struct {
   27:     long recv[HISTORY_LENGTH];
   28:     long sent[HISTORY_LENGTH];
   29:     double long total_sent;
   30:     double long total_recv;
   31:     int last_write;
   32: } history_type;
   33: 
   34: void tick(int print);
   35: 
   36: void *xmalloc(size_t n);
   37: void *xcalloc(size_t n, size_t m);
   38: void *xrealloc(void *w, size_t n);
   39: char *xstrdup(const char *s);
   40: void xfree(void *v);
   41: 
   42: /* options.c */
   43: void options_read(int argc, char **argv);
   44: 
   45: struct pfloghdr {
   46:       unsigned char		length;
   47:       unsigned char		af;
   48:       unsigned char		action;
   49:       unsigned char		reason;
   50:       char				ifname[16];
   51:       char				ruleset[16];
   52:       unsigned int		rulenr;
   53:       unsigned int		subrulenr;
   54:       unsigned char		dir;
   55:       unsigned char		pad[3];
   56: };
   57: 
   58: #endif /* __IFTOP_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>