|
@@ -102,10 +102,12 @@
|
|
|
* nla_put_s8(skb, type, value) add s8 attribute to skb
|
|
|
* nla_put_s16(skb, type, value) add s16 attribute to skb
|
|
|
* nla_put_s32(skb, type, value) add s32 attribute to skb
|
|
|
- * nla_put_s64(skb, type, value) add s64 attribute to skb
|
|
|
+ * nla_put_s64(skb, type, value,
|
|
|
+ * padattr) add s64 attribute to skb
|
|
|
* nla_put_string(skb, type, str) add string attribute to skb
|
|
|
* nla_put_flag(skb, type) add flag attribute to skb
|
|
|
- * nla_put_msecs(skb, type, jiffies) add msecs attribute to skb
|
|
|
+ * nla_put_msecs(skb, type, jiffies,
|
|
|
+ * padattr) add msecs attribute to skb
|
|
|
* nla_put_in_addr(skb, type, addr) add IPv4 address attribute to skb
|
|
|
* nla_put_in6_addr(skb, type, addr) add IPv6 address attribute to skb
|
|
|
*
|
|
@@ -856,36 +858,56 @@ static inline int nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer
|
|
|
+ * nla_put_u64_64bit - Add a u64 netlink attribute to a skb and align it
|
|
|
* @skb: socket buffer to add attribute to
|
|
|
* @attrtype: attribute type
|
|
|
* @value: numeric value
|
|
|
+ * @padattr: attribute type for the padding
|
|
|
*/
|
|
|
-static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value)
|
|
|
+static inline int nla_put_u64_64bit(struct sk_buff *skb, int attrtype,
|
|
|
+ u64 value, int padattr)
|
|
|
{
|
|
|
- return nla_put(skb, attrtype, sizeof(__be64), &value);
|
|
|
+ return nla_put_64bit(skb, attrtype, sizeof(u64), &value, padattr);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * nla_put_net64 - Add 64-bit network byte order netlink attribute to a socket buffer
|
|
|
+ * nla_put_be64 - Add a __be64 netlink attribute to a socket buffer and align it
|
|
|
* @skb: socket buffer to add attribute to
|
|
|
* @attrtype: attribute type
|
|
|
* @value: numeric value
|
|
|
+ * @padattr: attribute type for the padding
|
|
|
*/
|
|
|
-static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
|
|
|
+static inline int nla_put_be64(struct sk_buff *skb, int attrtype, __be64 value,
|
|
|
+ int padattr)
|
|
|
{
|
|
|
- return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value);
|
|
|
+ return nla_put_64bit(skb, attrtype, sizeof(__be64), &value, padattr);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer
|
|
|
+ * nla_put_net64 - Add 64-bit network byte order nlattr to a skb and align it
|
|
|
* @skb: socket buffer to add attribute to
|
|
|
* @attrtype: attribute type
|
|
|
* @value: numeric value
|
|
|
+ * @padattr: attribute type for the padding
|
|
|
*/
|
|
|
-static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value)
|
|
|
+static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value,
|
|
|
+ int padattr)
|
|
|
{
|
|
|
- return nla_put(skb, attrtype, sizeof(__le64), &value);
|
|
|
+ return nla_put_be64(skb, attrtype | NLA_F_NET_BYTEORDER, value,
|
|
|
+ padattr);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer and align it
|
|
|
+ * @skb: socket buffer to add attribute to
|
|
|
+ * @attrtype: attribute type
|
|
|
+ * @value: numeric value
|
|
|
+ * @padattr: attribute type for the padding
|
|
|
+ */
|
|
|
+static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value,
|
|
|
+ int padattr)
|
|
|
+{
|
|
|
+ return nla_put_64bit(skb, attrtype, sizeof(__le64), &value, padattr);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -922,14 +944,16 @@ static inline int nla_put_s32(struct sk_buff *skb, int attrtype, s32 value)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * nla_put_s64 - Add a s64 netlink attribute to a socket buffer
|
|
|
+ * nla_put_s64 - Add a s64 netlink attribute to a socket buffer and align it
|
|
|
* @skb: socket buffer to add attribute to
|
|
|
* @attrtype: attribute type
|
|
|
* @value: numeric value
|
|
|
+ * @padattr: attribute type for the padding
|
|
|
*/
|
|
|
-static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value)
|
|
|
+static inline int nla_put_s64(struct sk_buff *skb, int attrtype, s64 value,
|
|
|
+ int padattr)
|
|
|
{
|
|
|
- return nla_put(skb, attrtype, sizeof(s64), &value);
|
|
|
+ return nla_put_64bit(skb, attrtype, sizeof(s64), &value, padattr);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -955,16 +979,18 @@ static inline int nla_put_flag(struct sk_buff *skb, int attrtype)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * nla_put_msecs - Add a msecs netlink attribute to a socket buffer
|
|
|
+ * nla_put_msecs - Add a msecs netlink attribute to a skb and align it
|
|
|
* @skb: socket buffer to add attribute to
|
|
|
* @attrtype: attribute type
|
|
|
* @njiffies: number of jiffies to convert to msecs
|
|
|
+ * @padattr: attribute type for the padding
|
|
|
*/
|
|
|
static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
|
|
|
- unsigned long njiffies)
|
|
|
+ unsigned long njiffies, int padattr)
|
|
|
{
|
|
|
u64 tmp = jiffies_to_msecs(njiffies);
|
|
|
- return nla_put(skb, attrtype, sizeof(u64), &tmp);
|
|
|
+
|
|
|
+ return nla_put_64bit(skb, attrtype, sizeof(u64), &tmp, padattr);
|
|
|
}
|
|
|
|
|
|
/**
|