forked from Lochnair/tsping
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsping.h
More file actions
45 lines (39 loc) · 725 Bytes
/
Copy pathtsping.h
File metadata and controls
45 lines (39 loc) · 725 Bytes
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
#ifndef TSPING_TSPING_H
#define TSPING_TSPING_H
#include <stdint.h>
#include "args.h"
struct icmp_echo_hdr
{
uint8_t type;
uint8_t code;
uint16_t checksum;
uint16_t identifier;
uint16_t sequence;
uint32_t payload;
};
struct icmp_timestamp_hdr
{
uint8_t type;
uint8_t code;
uint16_t checksum;
uint16_t identifier;
uint16_t sequence;
uint32_t originateTime;
uint32_t receiveTime;
uint32_t transmitTime;
};
typedef struct
{
uint16_t sequence;
uint32_t originateTime;
uint32_t receiveTime;
uint32_t transmitTime;
uint32_t finishedTime;
} icmp_result;
struct thread_data
{
struct arguments * args;
uint16_t id; // would have used icmp_id here, but it's a macro
int sock_fd;
};
#endif //TSPING_TSPING_H