6#include <netlink-private/netlink.h>
7#include <netlink/idiag/meminfo.h>
17struct idiagnl_meminfo *idiagnl_meminfo_alloc(
void)
19 return (
struct idiagnl_meminfo *)
nl_object_alloc(&idiagnl_meminfo_obj_ops);
22void idiagnl_meminfo_get(
struct idiagnl_meminfo *minfo)
27void idiagnl_meminfo_put(
struct idiagnl_meminfo *minfo)
36uint32_t idiagnl_meminfo_get_rmem(
const struct idiagnl_meminfo *minfo)
38 return minfo->idiag_rmem;
41void idiagnl_meminfo_set_rmem(
struct idiagnl_meminfo *minfo, uint32_t rmem)
43 minfo->idiag_rmem = rmem;
46uint32_t idiagnl_meminfo_get_wmem(
const struct idiagnl_meminfo *minfo)
48 return minfo->idiag_wmem;
51void idiagnl_meminfo_set_wmem(
struct idiagnl_meminfo *minfo, uint32_t wmem)
53 minfo->idiag_wmem = wmem;
56uint32_t idiagnl_meminfo_get_fmem(
const struct idiagnl_meminfo *minfo)
58 return minfo->idiag_fmem;
61void idiagnl_meminfo_set_fmem(
struct idiagnl_meminfo *minfo, uint32_t fmem)
63 minfo->idiag_fmem = fmem;
66uint32_t idiagnl_meminfo_get_tmem(
const struct idiagnl_meminfo *minfo)
68 return minfo->idiag_tmem;
71void idiagnl_meminfo_set_tmem(
struct idiagnl_meminfo *minfo, uint32_t tmem)
73 minfo->idiag_tmem = tmem;
78static uint64_t idiagnl_meminfo_compare(
struct nl_object *_a,
struct nl_object *_b,
79 uint64_t attrs,
int flags)
81 struct idiagnl_meminfo *a = (
struct idiagnl_meminfo *) _a;
82 struct idiagnl_meminfo *b = (
struct idiagnl_meminfo *) _b;
86 return a->idiag_rmem != b->idiag_rmem ||
87 a->idiag_wmem != b->idiag_wmem ||
88 a->idiag_fmem != b->idiag_fmem ||
89 a->idiag_tmem != b->idiag_tmem;
92struct nl_object_ops idiagnl_meminfo_obj_ops = {
93 .oo_name =
"idiag/idiag_meminfo",
94 .oo_size =
sizeof(
struct idiagnl_meminfo),
95 .oo_compare = idiagnl_meminfo_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.