Lines Matching defs:nb
54 static bool nl_process_nbuf(struct nl_buf *nb, struct nlpcb *nlp);
59 struct nl_buf *nb;
64 nb = malloc(sizeof(struct nl_buf) + len, M_NETLINK, mflag);
65 if (__predict_true(nb != NULL)) {
66 nb->buflen = len;
67 nb->datalen = nb->offset = 0;
70 return (nb);
74 nl_buf_free(struct nl_buf *nb)
77 free(nb, M_NETLINK);
97 struct nl_buf *nb;
118 while ((nb = TAILQ_FIRST(&sb->nl_queue)) != NULL) {
119 TAILQ_REMOVE(&sb->nl_queue, nb, tailq);
121 reschedule = nl_process_nbuf(nb, nlp);
124 sb->sb_acc -= nb->datalen;
125 sb->sb_ccc -= nb->datalen;
128 nl_buf_free(nb);
131 TAILQ_INSERT_HEAD(&sb->nl_queue, nb, tailq);
204 struct nl_buf *nb;
225 nb = nw->buf;
232 nlp->nl_dropped_bytes += nb->datalen;
236 (unsigned long)nlp->nl_dropped_bytes, nb->datalen);
238 nl_buf_free(nb);
243 TAILQ_INSERT_TAIL(&sb->nl_queue, nb, tailq);
244 sb->sb_acc += nb->datalen;
245 sb->sb_ccc += nb->datalen;
321 nl_process_nbuf(struct nl_buf *nb, struct nlpcb *nlp)
327 NL_LOG(LOG_DEBUG3, "RX netlink buf %p on %p", nb, nlp->nl_socket);
338 .lb.base = &nb->data[roundup2(nb->datalen, 8)],
339 .lb.size = nb->buflen - roundup2(nb->datalen, 8),
344 for (; nb->offset + sizeof(struct nlmsghdr) <= nb->datalen;) {
345 hdr = (struct nlmsghdr *)&nb->data[nb->offset];
349 nb->offset, nb->datalen);
351 error = nl_receive_message(hdr, nb->datalen - nb->offset, nlp,
353 nb->offset += msglen;