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