Lines Matching defs:nlh
206 static int inet_diag_parse_attrs(const struct nlmsghdr *nlh, int hdrlen,
212 nlmsg_for_each_attr(nla, nlh, hdrlen, remaining) {
244 struct nlmsghdr *nlh;
252 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
253 cb->nlh->nlmsg_type, sizeof(*r), nlmsg_flags);
254 if (!nlh)
257 r = nlmsg_data(nlh);
367 bool first_nlmsg = ((unsigned char *)nlh == skb->data);
373 msg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
405 nlmsg_end(skb, nlh);
409 nlmsg_cancel(skb, nlh);
421 struct nlmsghdr *nlh;
424 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid,
425 cb->nlh->nlmsg_seq, cb->nlh->nlmsg_type,
427 if (!nlh)
430 r = nlmsg_data(nlh);
447 nlmsg_cancel(skb, nlh);
451 nlmsg_end(skb, nlh);
461 struct nlmsghdr *nlh;
464 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
465 cb->nlh->nlmsg_type, sizeof(*r), nlmsg_flags);
466 if (!nlh)
469 r = nlmsg_data(nlh);
487 nlmsg_cancel(skb, nlh);
491 nlmsg_end(skb, nlh);
592 const struct nlmsghdr *nlh,
601 err = inet_diag_parse_attrs(nlh, hdrlen, dump_data.req_nlas);
612 .nlh = nlh,
1198 return __inet_diag_dump(skb, cb, nlmsg_data(cb->nlh));
1203 const struct nlmsghdr *nlh = cb->nlh;
1213 err = inet_diag_parse_attrs(nlh, hdrlen, cb_data->req_nlas);
1278 struct inet_diag_req *rc = nlmsg_data(cb->nlh);
1282 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type);
1291 const struct nlmsghdr *nlh)
1293 struct inet_diag_req *rc = nlmsg_data(nlh);
1297 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type);
1302 return inet_diag_cmd_exact(SOCK_DIAG_BY_FAMILY, in_skb, nlh,
1306 static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh)
1311 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX ||
1312 nlmsg_len(nlh) < hdrlen)
1315 if (nlh->nlmsg_flags & NLM_F_DUMP) {
1321 return netlink_dump_start(net->diag_nlsk, skb, nlh, &c);
1324 return inet_diag_get_exact_compat(skb, nlh);
1353 struct nlmsghdr *nlh;
1359 nlh = nlmsg_put(skb, 0, 0, SOCK_DIAG_BY_FAMILY, sizeof(*r), 0);
1360 if (!nlh)
1363 r = nlmsg_data(nlh);
1371 nlmsg_cancel(skb, nlh);
1378 nlmsg_cancel(skb, nlh);
1393 nlmsg_end(skb, nlh);