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
459 * @nlh: Netlink message header of original request
466 struct nlmsghdr *nlh;
578 * @nlh: netlink message header
580 static inline void *nlmsg_data(const struct nlmsghdr *nlh)
582 return (unsigned char *) nlh + NLMSG_HDRLEN;
587 * @nlh: netlink message header
589 static inline int nlmsg_len(const struct nlmsghdr *nlh)
591 return nlh->nlmsg_len - NLMSG_HDRLEN;
596 * @nlh: netlink message header
599 static inline struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh,
602 unsigned char *data = nlmsg_data(nlh);
608 * @nlh: netlink message header
611 static inline int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen)
613 return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen);
618 * @nlh: netlink message header
621 static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining)
624 nlh->nlmsg_len >= sizeof(struct nlmsghdr) &&
625 nlh->nlmsg_len <= remaining);
630 * @nlh: netlink message header
637 nlmsg_next(const struct nlmsghdr *nlh, int *remaining)
639 int totlen = NLMSG_ALIGN(nlh->nlmsg_len);
643 return (struct nlmsghdr *) ((unsigned char *) nlh + totlen);
724 * @nlh: netlink message header
734 static inline int __nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
740 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) {
745 return __nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen),
746 nlmsg_attrlen(nlh, hdrlen), policy, validate,
752 * @nlh: netlink message header
761 static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
766 return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy,
772 * @nlh: netlink message header
781 static inline int nlmsg_parse_deprecated(const struct nlmsghdr *nlh, int hdrlen,
786 return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy,
792 * @nlh: netlink message header
802 nlmsg_parse_deprecated_strict(const struct nlmsghdr *nlh, int hdrlen,
807 return __nlmsg_parse(nlh, hdrlen, tb, maxtype, policy,
813 * @nlh: netlink message header
819 static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh,
822 return nla_find(nlmsg_attrdata(nlh, hdrlen),
823 nlmsg_attrlen(nlh, hdrlen), attrtype);
873 * @nlh: netlinket message header
879 static inline int nlmsg_validate_deprecated(const struct nlmsghdr *nlh,
884 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
887 return __nla_validate(nlmsg_attrdata(nlh, hdrlen),
888 nlmsg_attrlen(nlh, hdrlen), maxtype,
896 * @nlh: netlink message header
900 static inline int nlmsg_report(const struct nlmsghdr *nlh)
902 return nlh ? !!(nlh->nlmsg_flags & NLM_F_ECHO) : 0;
907 * @nlh: netlink message header
911 static inline u32 nlmsg_seq(const struct nlmsghdr *nlh)
913 return nlh ? nlh->nlmsg_seq : 0;
919 * @nlh: netlink message header
923 #define nlmsg_for_each_attr(pos, nlh, hdrlen, rem) \
924 nla_for_each_attr(pos, nlmsg_attrdata(nlh, hdrlen), \
925 nlmsg_attrlen(nlh, hdrlen), rem)
985 return nlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
1005 * @nlh: netlink message header
1011 static inline void nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh)
1013 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh;
1045 * @nlh: netlink message header
1050 static inline void nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh)
1052 nlmsg_trim(skb, nlh);
1118 * @nlh: netlink message header to write the flag to
1132 struct nlmsghdr *nlh)
1135 nlh->nlmsg_flags |= NLM_F_DUMP_INTR;