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()
1197 return __inet_diag_dump(skb, cb, nlmsg_data(cb->nlh)); in inet_diag_dump()
1202 const struct nlmsghdr *nlh = cb->nlh; in __inet_diag_dump_start() local
1212 err = inet_diag_parse_attrs(nlh, hdrlen, cb_data->req_nlas); in __inet_diag_dump_start()
1277 struct inet_diag_req *rc = nlmsg_data(cb->nlh); in inet_diag_dump_compat()
1281 req.sdiag_protocol = inet_diag_type2proto(cb->nlh->nlmsg_type); in inet_diag_dump_compat()
1290 const struct nlmsghdr *nlh) in inet_diag_get_exact_compat() argument
1292 struct inet_diag_req *rc = nlmsg_data(nlh); in inet_diag_get_exact_compat()
1296 req.sdiag_protocol = inet_diag_type2proto(nlh->nlmsg_type); in inet_diag_get_exact_compat()
1301 return inet_diag_cmd_exact(SOCK_DIAG_BY_FAMILY, in_skb, nlh, in inet_diag_get_exact_compat()
1305 static int inet_diag_rcv_msg_compat(struct sk_buff *skb, struct nlmsghdr *nlh) in inet_diag_rcv_msg_compat() argument
1310 if (nlh->nlmsg_type >= INET_DIAG_GETSOCK_MAX || in inet_diag_rcv_msg_compat()
1311 nlmsg_len(nlh) < hdrlen) in inet_diag_rcv_msg_compat()
1314 if (nlh->nlmsg_flags & NLM_F_DUMP) { in inet_diag_rcv_msg_compat()
1320 return netlink_dump_start(net->diag_nlsk, skb, nlh, &c); in inet_diag_rcv_msg_compat()
1323 return inet_diag_get_exact_compat(skb, nlh); in inet_diag_rcv_msg_compat()
1352 struct nlmsghdr *nlh; in inet_diag_handler_get_info() local
1358 nlh = nlmsg_put(skb, 0, 0, SOCK_DIAG_BY_FAMILY, sizeof(*r), 0); in inet_diag_handler_get_info()
1359 if (!nlh) in inet_diag_handler_get_info()
1362 r = nlmsg_data(nlh); in inet_diag_handler_get_info()
1370 nlmsg_cancel(skb, nlh); in inet_diag_handler_get_info()
1377 nlmsg_cancel(skb, nlh); in inet_diag_handler_get_info()
1392 nlmsg_end(skb, nlh); in inet_diag_handler_get_info()