6#include <netlink-private/netlink.h>
7#include <netlink/idiag/vegasinfo.h>
17struct idiagnl_vegasinfo *idiagnl_vegasinfo_alloc(
void)
19 return (
struct idiagnl_vegasinfo *)
nl_object_alloc(&idiagnl_vegasinfo_obj_ops);
22void idiagnl_vegasinfo_get(
struct idiagnl_vegasinfo *vinfo)
27void idiagnl_vegasinfo_put(
struct idiagnl_vegasinfo *vinfo)
36uint32_t idiagnl_vegasinfo_get_enabled(
const struct idiagnl_vegasinfo *vinfo)
38 return vinfo->tcpv_enabled;
41void idiagnl_vegasinfo_set_enabled(
struct idiagnl_vegasinfo *vinfo, uint32_t
44 vinfo->tcpv_enabled = enabled;
47uint32_t idiagnl_vegasinfo_get_rttcnt(
const struct idiagnl_vegasinfo *vinfo)
49 return vinfo->tcpv_rttcnt;
52void idiagnl_vegasinfo_set_rttcnt(
struct idiagnl_vegasinfo *vinfo, uint32_t
55 vinfo->tcpv_rttcnt = rttcnt;
58uint32_t idiagnl_vegasinfo_get_rtt(
const struct idiagnl_vegasinfo *vinfo)
60 return vinfo->tcpv_rtt;
63void idiagnl_vegasinfo_set_rtt(
struct idiagnl_vegasinfo *vinfo, uint32_t rtt)
65 vinfo->tcpv_rtt = rtt;
68uint32_t idiagnl_vegasinfo_get_minrtt(
const struct idiagnl_vegasinfo *vinfo)
70 return vinfo->tcpv_minrtt;
73void idiagnl_vegasinfo_set_minrtt(
struct idiagnl_vegasinfo *vinfo, uint32_t
76 vinfo->tcpv_minrtt = minrtt;
81static uint64_t idiagnl_vegasinfo_compare(
struct nl_object *_a,
struct nl_object *_b,
82 uint64_t attrs,
int flags)
84 struct idiagnl_vegasinfo *a = (
struct idiagnl_vegasinfo *) _a;
85 struct idiagnl_vegasinfo *b = (
struct idiagnl_vegasinfo *) _b;
89 return a->tcpv_enabled != b->tcpv_enabled ||
90 a->tcpv_rttcnt != b->tcpv_rttcnt ||
91 a->tcpv_rtt != b->tcpv_rtt ||
92 a->tcpv_minrtt != b->tcpv_minrtt;
95struct nl_object_ops idiagnl_vegasinfo_obj_ops = {
96 .oo_name =
"idiag/idiag_vegasinfo",
97 .oo_size =
sizeof(
struct idiagnl_vegasinfo),
98 .oo_compare = idiagnl_vegasinfo_compare,
void nl_object_put(struct nl_object *obj)
Release a reference from an object.
void nl_object_get(struct nl_object *obj)
Acquire a reference on a object.
struct nl_object * nl_object_alloc(struct nl_object_ops *ops)
Allocate a new object of kind specified by the operations handle.