mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 15:51:32 +00:00
sockopt: add support for querying tcp round-trip-time
Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 6b2672f3c9493aef3495192e113f95a7db4b65bc)
This commit is contained in:
parent
f842f16640
commit
cf279b3abc
@ -518,6 +518,22 @@ sockopt_iphdrincl_swab_systoh (struct ip *iph)
|
||||
iph->ip_id = ntohs(iph->ip_id);
|
||||
}
|
||||
|
||||
int
|
||||
sockopt_tcp_rtt (int sock)
|
||||
{
|
||||
#ifdef TCP_INFO
|
||||
struct tcp_info ti;
|
||||
socklen_t len = sizeof(ti);
|
||||
|
||||
if (getsockopt (sock, IPPROTO_TCP, TCP_INFO, &ti, &len) != 0)
|
||||
return 0;
|
||||
|
||||
return ti.tcpi_rtt / 1000;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
sockopt_tcp_signature (int sock, union sockunion *su, const char *password)
|
||||
{
|
||||
|
@ -100,6 +100,7 @@ extern int getsockopt_ifindex (int, struct msghdr *);
|
||||
extern void sockopt_iphdrincl_swab_htosys (struct ip *iph);
|
||||
extern void sockopt_iphdrincl_swab_systoh (struct ip *iph);
|
||||
|
||||
extern int sockopt_tcp_rtt (int);
|
||||
extern int sockopt_tcp_signature(int sock, union sockunion *su,
|
||||
const char *password);
|
||||
#endif /*_ZEBRA_SOCKOPT_H */
|
||||
|
Loading…
Reference in New Issue
Block a user