Lines Matching defs:nlh
209 static int inet_diag_parse_attrs(const struct nlmsghdr *nlh, int hdrlen,
215 nlmsg_for_each_attr(nla, nlh, hdrlen, remaining) {
247 struct nlmsghdr *nlh;
262 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
263 cb->nlh->nlmsg_type, sizeof(*r), nlmsg_flags);
264 if (!nlh)
267 r = nlmsg_data(nlh);
378 bool first_nlmsg = ((unsigned char *)nlh == skb->data);
384 msg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
416 nlmsg_end(skb, nlh);
420 nlmsg_cancel(skb, nlh);
432 struct nlmsghdr *nlh;
435 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid,
436 cb->nlh->nlmsg_seq, cb->nlh->nlmsg_type,
438 if (!nlh)
441 r = nlmsg_data(nlh);
458 nlmsg_cancel(skb, nlh);
462 nlmsg_end(skb, nlh);
472 struct nlmsghdr *nlh;
475 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
476 cb->nlh->nlmsg_type, sizeof(*r), nlmsg_flags);
477 if (!nlh)
480 r = nlmsg_data(nlh);
498 nlmsg_cancel(skb, nlh);
502 nlmsg_end(skb, nlh);
603 const struct nlmsghdr *nlh,
612 err = inet_diag_parse_attrs(nlh, hdrlen, dump_data.req_nlas);
624 .nlh = nlh,
1302 return __inet_diag_dump(skb, cb, nlmsg_data(cb->nlh));
1307 const struct nlmsghdr *nlh = cb->nlh;
1317 err = inet_diag_parse_attrs(nlh, hdrlen, cb_data->req_nlas);
1380 struct inet_diag_req *rc = nlmsg_data(cb->nlh);
1384 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type);
1394 const struct nlmsghdr *nlh)
1396 struct inet_diag_req *rc = nlmsg_data(nlh);
1400 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type);
1406 return inet_diag_cmd_exact(SOCK_DIAG_BY_FAMILY, in_skb, nlh,
1410 static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh)
1415 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX ||
1416 nlmsg_len(nlh) < hdrlen)
1419 if (nlh->nlmsg_flags & NLM_F_DUMP) {
1425 return netlink_dump_start(net->diag_nlsk, skb, nlh, &c);
1428 return inet_diag_get_exact_compat(skb, nlh);
1457 struct nlmsghdr *nlh;
1463 nlh = nlmsg_put(skb, 0, 0, SOCK_DIAG_BY_FAMILY, sizeof(*r), 0);
1464 if (!nlh)
1467 r = nlmsg_data(nlh);
1475 nlmsg_cancel(skb, nlh);
1481 nlmsg_cancel(skb, nlh);
1496 nlmsg_end(skb, nlh);