Lines Matching refs:skb
228 extern int netlink_rcv_skb(struct sk_buff *skb,
231 extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
250 extern struct nlattr * __nla_reserve(struct sk_buff *skb, int attrtype,
252 extern void * __nla_reserve_nohdr(struct sk_buff *skb, int attrlen);
253 extern struct nlattr * nla_reserve(struct sk_buff *skb, int attrtype,
255 extern void * nla_reserve_nohdr(struct sk_buff *skb, int attrlen);
256 extern void __nla_put(struct sk_buff *skb, int attrtype,
258 extern void __nla_put_nohdr(struct sk_buff *skb, int attrlen,
260 extern int nla_put(struct sk_buff *skb, int attrtype,
262 extern int nla_put_nohdr(struct sk_buff *skb, int attrlen,
264 extern int nla_append(struct sk_buff *skb, int attrlen,
456 static inline struct nlmsghdr *nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, in nlmsg_put() argument
459 if (unlikely(skb_tailroom(skb) < nlmsg_total_size(payload))) in nlmsg_put()
462 return __nlmsg_put(skb, pid, seq, type, payload, flags); in nlmsg_put()
476 static inline struct nlmsghdr *nlmsg_put_answer(struct sk_buff *skb, in nlmsg_put_answer() argument
481 return nlmsg_put(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, in nlmsg_put_answer()
509 static inline int nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) in nlmsg_end() argument
511 nlh->nlmsg_len = skb_tail_pointer(skb) - (unsigned char *)nlh; in nlmsg_end()
513 return skb->len; in nlmsg_end()
522 static inline void *nlmsg_get_pos(struct sk_buff *skb) in nlmsg_get_pos() argument
524 return skb_tail_pointer(skb); in nlmsg_get_pos()
534 static inline void nlmsg_trim(struct sk_buff *skb, const void *mark) in nlmsg_trim() argument
537 skb_trim(skb, (unsigned char *) mark - skb->data); in nlmsg_trim()
548 static inline void nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh) in nlmsg_cancel() argument
550 nlmsg_trim(skb, nlh); in nlmsg_cancel()
557 static inline void nlmsg_free(struct sk_buff *skb) in nlmsg_free() argument
559 kfree_skb(skb); in nlmsg_free()
570 static inline int nlmsg_multicast(struct sock *sk, struct sk_buff *skb, in nlmsg_multicast() argument
575 NETLINK_CB(skb).dst_group = group; in nlmsg_multicast()
577 err = netlink_broadcast(sk, skb, pid, group, flags); in nlmsg_multicast()
590 static inline int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 pid) in nlmsg_unicast() argument
594 err = netlink_unicast(sk, skb, pid, MSG_DONTWAIT); in nlmsg_unicast()
758 static inline int nla_put_u8(struct sk_buff *skb, int attrtype, u8 value) in nla_put_u8() argument
760 return nla_put(skb, attrtype, sizeof(u8), &value); in nla_put_u8()
769 static inline int nla_put_u16(struct sk_buff *skb, int attrtype, u16 value) in nla_put_u16() argument
771 return nla_put(skb, attrtype, sizeof(u16), &value); in nla_put_u16()
780 static inline int nla_put_u32(struct sk_buff *skb, int attrtype, u32 value) in nla_put_u32() argument
782 return nla_put(skb, attrtype, sizeof(u32), &value); in nla_put_u32()
791 static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) in nla_put_u64() argument
793 return nla_put(skb, attrtype, sizeof(u64), &value); in nla_put_u64()
802 static inline int nla_put_string(struct sk_buff *skb, int attrtype, in nla_put_string() argument
805 return nla_put(skb, attrtype, strlen(str) + 1, str); in nla_put_string()
813 static inline int nla_put_flag(struct sk_buff *skb, int attrtype) in nla_put_flag() argument
815 return nla_put(skb, attrtype, 0, NULL); in nla_put_flag()
824 static inline int nla_put_msecs(struct sk_buff *skb, int attrtype, in nla_put_msecs() argument
828 return nla_put(skb, attrtype, sizeof(u64), &tmp); in nla_put_msecs()
831 #define NLA_PUT(skb, attrtype, attrlen, data) \ argument
833 if (unlikely(nla_put(skb, attrtype, attrlen, data) < 0)) \
837 #define NLA_PUT_TYPE(skb, type, attrtype, value) \ argument
840 NLA_PUT(skb, attrtype, sizeof(type), &__tmp); \
843 #define NLA_PUT_U8(skb, attrtype, value) \ argument
844 NLA_PUT_TYPE(skb, u8, attrtype, value)
846 #define NLA_PUT_U16(skb, attrtype, value) \ argument
847 NLA_PUT_TYPE(skb, u16, attrtype, value)
849 #define NLA_PUT_LE16(skb, attrtype, value) \ argument
850 NLA_PUT_TYPE(skb, __le16, attrtype, value)
852 #define NLA_PUT_BE16(skb, attrtype, value) \ argument
853 NLA_PUT_TYPE(skb, __be16, attrtype, value)
855 #define NLA_PUT_NET16(skb, attrtype, value) \ argument
856 NLA_PUT_BE16(skb, attrtype | NLA_F_NET_BYTEORDER, value)
858 #define NLA_PUT_U32(skb, attrtype, value) \ argument
859 NLA_PUT_TYPE(skb, u32, attrtype, value)
861 #define NLA_PUT_BE32(skb, attrtype, value) \ argument
862 NLA_PUT_TYPE(skb, __be32, attrtype, value)
864 #define NLA_PUT_NET32(skb, attrtype, value) \ argument
865 NLA_PUT_BE32(skb, attrtype | NLA_F_NET_BYTEORDER, value)
867 #define NLA_PUT_U64(skb, attrtype, value) \ argument
868 NLA_PUT_TYPE(skb, u64, attrtype, value)
870 #define NLA_PUT_BE64(skb, attrtype, value) \ argument
871 NLA_PUT_TYPE(skb, __be64, attrtype, value)
873 #define NLA_PUT_NET64(skb, attrtype, value) \ argument
874 NLA_PUT_BE64(skb, attrtype | NLA_F_NET_BYTEORDER, value)
876 #define NLA_PUT_STRING(skb, attrtype, value) \ argument
877 NLA_PUT(skb, attrtype, strlen(value) + 1, value)
879 #define NLA_PUT_FLAG(skb, attrtype) \ argument
880 NLA_PUT(skb, attrtype, 0, NULL)
882 #define NLA_PUT_MSECS(skb, attrtype, jiffies) \ argument
883 NLA_PUT_U64(skb, attrtype, jiffies_to_msecs(jiffies))
994 static inline struct nlattr *nla_nest_start(struct sk_buff *skb, int attrtype) in nla_nest_start() argument
996 struct nlattr *start = (struct nlattr *)skb_tail_pointer(skb); in nla_nest_start()
998 if (nla_put(skb, attrtype, 0, NULL) < 0) in nla_nest_start()
1014 static inline int nla_nest_end(struct sk_buff *skb, struct nlattr *start) in nla_nest_end() argument
1016 start->nla_len = skb_tail_pointer(skb) - (unsigned char *)start; in nla_nest_end()
1017 return skb->len; in nla_nest_end()
1028 static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start) in nla_nest_cancel() argument
1030 nlmsg_trim(skb, start); in nla_nest_cancel()