summaryrefslogtreecommitdiff
path: root/ui_common.h
diff options
context:
space:
mode:
authorpdw <>2014-01-01 14:37:31 +0000
committerpdw <>2014-01-01 14:37:31 +0000
commita9663192567697bfb217704cd67c34fd32a68389 (patch)
tree519a7c9cbc7d65b17d3c0a017f0de404be448326 /ui_common.h
parent59cf360690c99ad5149305ce3600151fa0f1483b (diff)
downloadiftop-a9663192567697bfb217704cd67c34fd32a68389.zip
Patch for text output mode by originally by Patrik Bless, updated by Roman Hoog
Antink <rha@open.ch>
Diffstat (limited to 'ui_common.h')
-rw-r--r--ui_common.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/ui_common.h b/ui_common.h
new file mode 100644
index 0000000..e4fcc2e
--- /dev/null
+++ b/ui_common.h
@@ -0,0 +1,48 @@
+/*
+ * ui_common.h
+ *
+ *
+ */
+
+#ifndef __UI_COMMON_H_ /* include guard */
+#define __UI_COMMON_H_
+
+#include <string.h>
+#include <stdio.h>
+
+#include "addr_hash.h"
+#include "serv_hash.h"
+#include "iftop.h"
+#include "resolver.h"
+#include "sorted_list.h"
+#include "options.h"
+
+#define HISTORY_DIVISIONS 3
+
+#define UNIT_DIVISIONS 4
+
+#define HOSTNAME_LENGTH 256
+
+typedef struct host_pair_line_tag {
+ addr_pair ap;
+ double long total_recv;
+ double long total_sent;
+ double long recv[HISTORY_DIVISIONS];
+ double long sent[HISTORY_DIVISIONS];
+} host_pair_line;
+
+extern options_t options;
+
+sorted_list_type screen_list;
+host_pair_line totals;
+int peaksent, peakrecv, peaktotal;
+extern history_type history_totals;
+hash_type* screen_hash;
+hash_type* service_hash;
+
+void analyse_data(void);
+void screen_list_init(void);
+void sprint_host(char * line, int af, struct in6_addr* addr, unsigned int port, unsigned int protocol, int L, int unspecified_as_star);
+void readable_size(float, char*, int, int, int);
+
+#endif /* __UI_COMMON_H_ */