33 #define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__
35 #include <linux/export.h>
49 static struct sock *nls;
53 const struct ibnl_client_cbs cb_table[])
69 if (cur->
index == index) {
70 pr_warn(
"Client for %d already exists\n", index);
91 if (cur->
index == index) {
98 pr_warn(
"Can't remove callback for client idx %d. Not found\n", index);
108 unsigned char *prev_tail;
110 prev_tail = skb_tail_pointer(skb);
115 (*nlh)->nlmsg_len = skb_tail_pointer(skb) - prev_tail;
116 return nlmsg_data(*nlh);
119 nlmsg_trim(skb, prev_tail);
127 unsigned char *prev_tail;
129 prev_tail = skb_tail_pointer(skb);
130 if (
nla_put(skb, type, len, data))
131 goto nla_put_failure;
132 nlh->
nlmsg_len += skb_tail_pointer(skb) - prev_tail;
136 nlmsg_trim(skb, prev_tail - nlh->
nlmsg_len);
149 if (client->
index == index) {
159 return netlink_dump_start(nls, skb, nlh, &c);
164 pr_info(
"Index %d wasn't found in client list\n", index);
168 static void ibnl_rcv(
struct sk_buff *skb)
183 pr_warn(
"Failed to create netlink socket\n");