Lines Matching refs:nlh

22  *   nlmsg_data(nlh)---^                   ^
23 * nlmsg_next(nlh)-----------------------+
26 * <---------------------- nlmsg_len(nlh) --------------------->
27 * <------ hdrlen ------> <- nlmsg_attrlen(nlh, hdrlen) ->
31 * nlmsg_attrdata(nlh, hdrlen)---^
57 * nlmsg_data(nlh) head of message payload
58 * nlmsg_len(nlh) length of message payload
59 * nlmsg_attrdata(nlh, hdrlen) head of attributes data
60 * nlmsg_attrlen(nlh, hdrlen) length of attributes data
63 * nlmsg_ok(nlh, remaining) does nlh fit into remaining bytes?
64 * nlmsg_next(nlh, remaining) get next netlink message
447 * @nlh: Netlink message header of original request
454 struct nlmsghdr *nlh;
566 * @nlh: netlink message header
568 static inline void *nlmsg_data(const struct nlmsghdr *nlh)
570 return (unsigned char *) nlh + NLMSG_HDRLEN;
575 * @nlh: netlink message header
577 static inline int nlmsg_len(const struct nlmsghdr *nlh)
579 return nlh->nlmsg_len - NLMSG_HDRLEN;
584 * @nlh: netlink message header
587 static inline struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh,
590 unsigned char *data = nlmsg_data(nlh);
596 * @nlh: netlink message header
599 static inline int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen)
601 return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen);
606 * @nlh: netlink message header
609 static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining)
612 nlh->nlmsg_len >= sizeof(struct nlmsghdr) &&
613 nlh->nlmsg_len <= remaining);
618 * @nlh: netlink message header
625 nlmsg_next(const struct nlmsghdr *nlh, int *remaining)
627 int totlen = NLMSG_ALIGN(nlh->nlmsg_len);
631 return (struct nlmsghdr *) ((unsigned char *) nlh + totlen);
712 * @nlh: netlink message header
722 static inline int __nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
728 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) {
733 return __nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen),
734 nlmsg_attrlen(nlh, hdrlen), policy, validate,
740 * @nlh: netlink message header
748 static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
753 return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy,
759 * @nlh: netlink message header
767 static inline int nlmsg_parse_deprecated(const struct nlmsghdr *nlh, int hdrlen,
772 return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy,
778 * @nlh: netlink message header
787 nlmsg_parse_deprecated_strict(const struct nlmsghdr *nlh, int hdrlen,
792 return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy,
798 * @nlh: netlink message header
804 static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh,
807 return nla_find(nlmsg_attrdata(nlh, hdrlen),
808 nlmsg_attrlen(nlh, hdrlen), attrtype);
859 * @nlh: netlinket message header
865 static inline int nlmsg_validate_deprecated(const struct nlmsghdr *nlh,
870 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
873 return __nla_validate(nlmsg_attrdata(nlh, hdrlen),
874 nlmsg_attrlen(nlh, hdrlen), maxtype,
882 * @nlh: netlink message header
886 static inline int nlmsg_report(const struct nlmsghdr *nlh)
888 return !!(nlh->nlmsg_flags & NLM_F_ECHO);
894 * @nlh: netlink message header
898 #define nlmsg_for_each_attr(pos, nlh, hdrlen, rem) \
899 nla_for_each_attr(pos, nlmsg_attrdata(nlh, hdrlen), \
900 nlmsg_attrlen(nlh, hdrlen), rem)
939 return nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
959 * @nlh: netlink message header
965 static inline void nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh)
967 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
999 * @nlh: netlink message header
1004 static inline void nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh)
1006 nlmsg_trim(skb, nlh);
1072 * @nlh: netlink message header to write the flag to
1086 struct nlmsghdr *nlh)
1089 nlh->nlmsg_flags |= NLM_F_DUMP_INTR;