| 261 | }; |
| 262 | |
| 263 | static void netlink_init(struct nlmsg* nlmsg, int typ, int flags, |
| 264 | const void* data, int size) |
| 265 | { |
| 266 | memset(nlmsg, 0, sizeof(*nlmsg)); |
| 267 | struct nlmsghdr* hdr = (struct nlmsghdr*)nlmsg->buf; |
| 268 | hdr->nlmsg_type = typ; |
| 269 | hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | flags; |
| 270 | memcpy(hdr + 1, data, size); |
| 271 | nlmsg->pos = (char*)(hdr + 1) + NLMSG_ALIGN(size); |
| 272 | } |
| 273 | |
| 274 | static void netlink_attr(struct nlmsg* nlmsg, int typ, const void* data, int size) |
| 275 | { |
no outgoing calls
no test coverage detected