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);
445 nlmsg_end(skb, nlh);
455 struct nlmsghdr *nlh;
458 nlh = nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
459 cb->nlh->nlmsg_type, sizeof(*r), nlmsg_flags);
460 if (!nlh)
463 r = nlmsg_data(nlh);
481 nlmsg_cancel(skb, nlh);
485 nlmsg_end(skb, nlh);
589 const struct nlmsghdr *nlh,
598 err = inet_diag_parse_attrs(nlh, hdrlen, dump_data.req_nlas);
609 .nlh = nlh,
1192 return __inet_diag_dump(skb, cb, nlmsg_data(cb->nlh));
1197 const struct nlmsghdr *nlh = cb->nlh;
1207 err = inet_diag_parse_attrs(nlh, hdrlen, cb_data->req_nlas);
1272 struct inet_diag_req *rc = nlmsg_data(cb->nlh);
1276 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type);
1286 const struct nlmsghdr *nlh)
1288 struct inet_diag_req *rc = nlmsg_data(nlh);
1292 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type);
1298 return inet_diag_cmd_exact(SOCK_DIAG_BY_FAMILY, in_skb, nlh,
1302 static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh)
1307 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX ||
1308 nlmsg_len(nlh) < hdrlen)
1311 if (nlh->nlmsg_flags & NLM_F_DUMP) {
1317 return netlink_dump_start(net->diag_nlsk, skb, nlh, &c);
1320 return inet_diag_get_exact_compat(skb, nlh);
1349 struct nlmsghdr *nlh;
1355 nlh = nlmsg_put(skb, 0, 0, SOCK_DIAG_BY_FAMILY, sizeof(*r), 0);
1356 if (!nlh)
1359 r = nlmsg_data(nlh);
1367 nlmsg_cancel(skb, nlh);
1374 nlmsg_cancel(skb, nlh);
1389 nlmsg_end(skb, nlh);