netchecker_profile.h
2.16 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//
// netchecker_profile.h
//
// Created by cairui01 on 18/11/9.
// Copyright (c) 2018年 baidu. All rights reserved.
//
#ifndef SDT_SRC_NETCHECKER_PROFILE_H_
#define SDT_SRC_NETCHECKER_PROFILE_H_
#include <string>
#include <vector>
#include <map>
#include <stdint.h>
#include "sdt.h"
namespace apirequest {
namespace sdt {
struct CheckResultProfile {
CheckResultProfile() {
Reset();
}
void Reset() {
netcheck_type = -1;
error_code = 1;
ip.clear();
port = 0;
conntime = 0;
rtt = 0;
total_jumps = 0;
url.clear();
checkcount = 0;
loss_rate = -1;
res.clear();
domain_name.clear();
local_dns.clear();
ipList.clear();
ipv6List.clear();
socket_error_no = 0;
local_dns_server.clear();
}
int netcheck_type; //ping dns tcp http tracert
int error_code;
std::string domain; //ping
std::string ip; //ping tcp http tracert
unsigned int port; //tcp http
uint64_t conntime;
uint64_t rtt; //tcp http rtt, dns resolve time
std::string rtt_str; //ping
int total_jumps; //tracert
std::string url;
unsigned int checkcount; //ping
double loss_rate; //ping
std::string res; //ping tracert result
std::string domain_name; //dns host
std::string local_dns; //dns
std::vector<std::string> ipList; //dns
std::vector<std::string> ipv6List; // dns ipv6
int socket_error_no; // socket errno
std::vector<std::string> local_dns_server; // dns servers
};
struct CheckRequestProfile {
CheckRequestProfile() {
Reset();
}
void Reset() {
shortlink_items.clear();
checkresult_profiles.clear();
check_status = kCheckContinue;
timeout = 0;
}
CheckIPPorts shortlink_items;
CheckStatus check_status;
uint32_t timeout;
uint32_t maxjumps;
std::vector<CheckResultProfile> checkresult_profiles;
bool enable_dns_query_failover; // 是否开启DNS Query容错机制(包括过滤无效DNS Server ip和多IP重试)
std::string dns_server_ip; // 指定探测DNS服务器IP
std::string interface_name; // 绑定探测网卡
};
}}
#endif