Lines Matching refs:nlh
139 ynl_ext_ack_check(struct ynl_sock *ys, const struct nlmsghdr *nlh, in ynl_ext_ack_check() argument
148 if (!(nlh->nlmsg_flags & NLM_F_ACK_TLVS)) in ynl_ext_ack_check()
151 mnl_attr_for_each(attr, nlh, hlen) { in ynl_ext_ack_check()
191 start = mnl_nlmsg_get_payload_offset(ys->nlh, in ynl_ext_ack_check()
193 end = mnl_nlmsg_get_payload_tail(ys->nlh); in ynl_ext_ack_check()
217 start = mnl_nlmsg_get_payload_offset(ys->nlh, in ynl_ext_ack_check()
219 end = mnl_nlmsg_get_payload_tail(ys->nlh); in ynl_ext_ack_check()
256 static int ynl_cb_error(const struct nlmsghdr *nlh, void *data) in ynl_cb_error() argument
258 const struct nlmsgerr *err = mnl_nlmsg_get_payload(nlh); in ynl_cb_error()
268 if (!(nlh->nlmsg_flags & NLM_F_CAPPED)) in ynl_cb_error()
271 ynl_ext_ack_check(yarg->ys, nlh, hlen); in ynl_cb_error()
276 static int ynl_cb_done(const struct nlmsghdr *nlh, void *data) in ynl_cb_done() argument
281 err = *(int *)NLMSG_DATA(nlh); in ynl_cb_done()
286 ynl_ext_ack_check(yarg->ys, nlh, sizeof(int)); in ynl_cb_done()
293 static int ynl_cb_noop(const struct nlmsghdr *nlh, void *data) in ynl_cb_noop() argument
396 struct nlmsghdr *nlh; in ynl_msg_start() local
400 nlh = ys->nlh = mnl_nlmsg_put_header(ys->tx_buf); in ynl_msg_start()
401 nlh->nlmsg_type = id; in ynl_msg_start()
402 nlh->nlmsg_flags = flags; in ynl_msg_start()
403 nlh->nlmsg_seq = ++ys->seq; in ynl_msg_start()
405 return nlh; in ynl_msg_start()
413 struct nlmsghdr *nlh; in ynl_gemsg_start() local
416 nlh = ynl_msg_start(ys, id, flags); in ynl_gemsg_start()
422 data = mnl_nlmsg_put_extra_header(nlh, sizeof(gehdr)); in ynl_gemsg_start()
425 return nlh; in ynl_gemsg_start()
470 int ynl_cb_null(const struct nlmsghdr *nlh, void *data) in ynl_cb_null() argument
516 static int ynl_get_family_info_cb(const struct nlmsghdr *nlh, void *data) in ynl_get_family_info_cb() argument
523 mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) { in ynl_get_family_info_cb()
550 struct nlmsghdr *nlh; in ynl_sock_read_family() local
553 nlh = ynl_gemsg_start_req(ys, GENL_ID_CTRL, CTRL_CMD_GETFAMILY, 1); in ynl_sock_read_family()
554 mnl_attr_put_strz(nlh, CTRL_ATTR_FAMILY_NAME, family_name); in ynl_sock_read_family()
556 err = mnl_socket_sendto(ys->sock, nlh, nlh->nlmsg_len); in ynl_sock_read_family()
698 static int ynl_ntf_parse(struct ynl_sock *ys, const struct nlmsghdr *nlh) in ynl_ntf_parse() argument
706 gehdr = mnl_nlmsg_get_payload(nlh); in ynl_ntf_parse()
718 ret = info->cb(nlh, &yarg); in ynl_ntf_parse()
722 rsp->family = nlh->nlmsg_type; in ynl_ntf_parse()
735 static int ynl_ntf_trampoline(const struct nlmsghdr *nlh, void *data) in ynl_ntf_trampoline() argument
739 return ynl_ntf_parse(yarg->ys, nlh); in ynl_ntf_trampoline()
792 ynl_check_alien(struct ynl_sock *ys, const struct nlmsghdr *nlh, __u32 rsp_cmd) in ynl_check_alien() argument
796 if (mnl_nlmsg_get_payload_len(nlh) < sizeof(*gehdr)) { in ynl_check_alien()
802 gehdr = mnl_nlmsg_get_payload(nlh); in ynl_check_alien()
804 return ynl_ntf_parse(ys, nlh); in ynl_check_alien()
809 static int ynl_req_trampoline(const struct nlmsghdr *nlh, void *data) in ynl_req_trampoline() argument
814 ret = ynl_check_alien(yrs->yarg.ys, nlh, yrs->rsp_cmd); in ynl_req_trampoline()
818 return yrs->cb(nlh, &yrs->yarg); in ynl_req_trampoline()
847 static int ynl_dump_trampoline(const struct nlmsghdr *nlh, void *data) in ynl_dump_trampoline() argument
854 ret = ynl_check_alien(ds->ys, nlh, ds->rsp_cmd); in ynl_dump_trampoline()
872 return ds->cb(nlh, &yarg); in ynl_dump_trampoline()