10th os detection try

This commit is contained in:
2020-08-13 13:14:50 +02:00
parent ec0b20c8f1
commit 491a671576

View File

@ -103,18 +103,15 @@ IpAddressInfo get_ip_address_info(Address* addr) {
} }
string get_os_info(int fd) { string get_os_info(int fd) {
struct tcp_repair_window trw; struct tcp_info ti;
socklen_t trwsize = sizeof(trw); socklen_t tisize = sizeof(ti);
int a = getsockopt(fd, IPPROTO_TCP, TCP_REPAIR_WINDOW, &trw, &trwsize); getsockopt(fd, IPPROTO_TCP, TCP_INFO, &ti, &tisize);
string b = strerror(errno);
int ttl; int ttl;
socklen_t ttlsize = sizeof(ttl); socklen_t ttlsize = sizeof(ttl);
getsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, &ttlsize); getsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, &ttlsize);
return "win_size=" + to_string(trw.snd_wnd) + "/" + to_string(trw.rcv_wnd) + "/" + to_string(trw.max_window) + "/" + return "win_size=" + to_string(ti.tcpi_snd_ssthresh) + ", ttl=" + to_string(ttl);
to_string(trw.rcv_wup) + "/" + to_string(trw.snd_wl1) + "/" + to_string(a) + "/" + b + ", ttl=" + to_string(ttl);
} }
string getETag(string filename) { string getETag(string filename) {