forked from br101/horst
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay.h
80 lines (64 loc) · 2.11 KB
/
display.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* horst - Highly Optimized Radio Scanning Tool
*
* Copyright (C) 2005-2011 Bruno Randolf (br1@einfach.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _DISPLAY_H_
#define _DISPLAY_H_
#include <curses.h>
#define WHITE COLOR_PAIR(1)
#define GREEN COLOR_PAIR(2)
#define RED COLOR_PAIR(3)
#define CYAN COLOR_PAIR(4)
#define BLUE COLOR_PAIR(5)
#define BLACKONWHITE COLOR_PAIR(6)
#define MAGENTA COLOR_PAIR(7)
#define ALLGREEN COLOR_PAIR(8)
#define ALLRED COLOR_PAIR(9)
#define ALLBLUE COLOR_PAIR(10)
#define ALLCYAN COLOR_PAIR(11)
#define YELLOW COLOR_PAIR(12)
#define ALLYELLOW COLOR_PAIR(13)
#define WHITEONRED COLOR_PAIR(14)
struct packet_info;
struct node_info;
void
get_per_second(unsigned int bytes, unsigned int duration,
unsigned int packets, unsigned int retries,
int *bps, int *dps, int *pps, int *rps);
void __attribute__ ((format (printf, 4, 5)))
print_centered(WINDOW* win, int line, int cols, const char *fmt, ...);
int
get_packet_type_color(int type);
void
signal_average_bar(WINDOW *win, int sig, int siga, int y, int x,
int height, int width);
void
general_average_bar(WINDOW *win, int val, int avg, int y, int x,
int height, int width, short color, short color_avg);
void
update_display(struct packet_info* pkg, struct node_info* node);
void
update_display_clock(void);
void
display_log(const char *string);
void
handle_user_input(void);
void
init_display(void);
void
finish_display(void);
#endif