Lines Matching defs:nm
30 struct nl_msg *nm;
34 nm = (struct nl_msg *) malloc(page_sz);
35 if (!nm)
39 nlh = (struct nlmsghdr *) ((char *) nm + sizeof(struct nl_msg));
42 memset(nm, 0, page_sz);
43 nm->nm_size = page_sz;
45 nm->nm_src.nl_family = AF_NETLINK;
46 nm->nm_src.nl_pid = getpid();
48 nm->nm_dst.nl_family = AF_NETLINK;
49 nm->nm_dst.nl_pid = 0; /* Kernel */
53 nm->nm_nlh = nlh;
56 nlmsg_get(nm);
57 return nm;
69 void nlmsg_get(struct nl_msg *nm)
71 nm->nm_refcnt++;
75 void nlmsg_free(struct nl_msg *nm)
77 if (nm) {
78 nm->nm_refcnt--;
79 if (nm->nm_refcnt <= 0)
80 free(nm);