datapath: Add missing definitions for building GRE on older kernels
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / net / netlink.h
index e0d594d..2f979fe 100644 (file)
@@ -19,4 +19,22 @@ static inline int VERIFY_NUL_STRING(struct nlattr *attr)
 }
 #endif /* !HAVE_NLA_NUL_STRING */
 
+
+#ifndef NLA_PUT_BE16
+#define NLA_PUT_BE16(skb, attrtype, value) \
+        NLA_PUT_TYPE(skb, __be16, attrtype, value)
+#endif  /* !NLA_PUT_BE16 */
+
+
+#ifndef HAVE_NLA_GET_BE16
+/**
+ * nla_get_be16 - return payload of __be16 attribute
+ * @nla: __be16 netlink attribute
+ */
+static inline __be16 nla_get_be16(struct nlattr *nla)
+{
+        return *(__be16 *) nla_data(nla);
+}
+#endif  /* !HAVE_NLA_GET_BE16 */
+
 #endif /* net/netlink.h */