ui_common.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * ui_common.h
  3. *
  4. *
  5. */
  6. #ifndef __UI_COMMON_H_ /* include guard */
  7. #define __UI_COMMON_H_
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include "addr_hash.h"
  11. #include "serv_hash.h"
  12. #include "iftop.h"
  13. #include "resolver.h"
  14. #include "sorted_list.h"
  15. #include "options.h"
  16. #define HISTORY_DIVISIONS 3
  17. #define UNIT_DIVISIONS 4
  18. #define HOSTNAME_LENGTH 256
  19. typedef struct host_pair_line_tag {
  20. addr_pair ap;
  21. double long total_recv;
  22. double long total_sent;
  23. double long recv[HISTORY_DIVISIONS];
  24. double long sent[HISTORY_DIVISIONS];
  25. } host_pair_line;
  26. extern options_t options;
  27. sorted_list_type screen_list;
  28. host_pair_line totals;
  29. int peaksent, peakrecv, peaktotal;
  30. extern history_type history_totals;
  31. hash_type* screen_hash;
  32. hash_type* service_hash;
  33. void analyse_data(void);
  34. void screen_list_init(void);
  35. void sprint_host(char * line, int af, struct in6_addr* addr, unsigned int port, unsigned int protocol, int L, int unspecified_as_star);
  36. void readable_size(float, char*, int, int, int);
  37. #endif /* __UI_COMMON_H_ */