-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathdata_types.h
More file actions
49 lines (39 loc) · 2.03 KB
/
Copy pathdata_types.h
File metadata and controls
49 lines (39 loc) · 2.03 KB
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
#ifndef FPING_DATA_TYPES_H
#define FPING_DATA_TYPES_H
#include <inttypes.h>
#include <sys/socket.h>
struct event;
typedef struct host_entry {
int i; /* index into array */
char *name; /* name as given by user */
char *host; /* text description of host */
struct sockaddr_storage saddr; /* internet address */
socklen_t saddr_len;
int64_t timeout; /* time to wait for response */
int64_t last_send_time; /* time of last packet sent */
int num_sent; /* number of ping packets sent (for statistics) */
int num_recv; /* number of pings received (duplicates ignored) */
int num_recv_total; /* number of pings received, including duplicates */
int64_t max_reply; /* longest response time */
int64_t min_reply; /* shortest response time */
int64_t total_time; /* sum of response times */
/* _i -> splits (reset on every report interval) */
int num_sent_i; /* number of ping packets sent */
int num_recv_i; /* number of pings received */
int64_t max_reply_i; /* longest response time */
int64_t min_reply_i; /* shortest response time */
int64_t total_time_i; /* sum of response times */
int64_t *resp_times; /* individual response times */
int top_view_print_pos; /* line where the host is printed */
int64_t top_view_last_timeouts; /* timeout Counter */
int64_t top_view_last_timeouts_count; /* how many timeout occurred */
int64_t top_view_last_timeouts_seq; /* how many packets where lost till the next answer arrived */
char top_view_last_timeout_time[100]; /* buffer to print how long the last timeout was ( packets * period ) */
char top_view_icmp_message[200]; /* buffer to print how long the last timeout was ( packets * period ) */
/* to avoid allocating two struct events each time that we send a ping, we
* preallocate here two struct events for each ping that we might send for
* this host. */
struct event *event_storage_ping;
struct event *event_storage_timeout;
} HOST_ENTRY;
#endif