summaryrefslogtreecommitdiff
path: root/src/platform/nm-netlink.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-01-15 09:27:22 +0100
committerThomas Haller <thaller@redhat.com>2018-01-15 20:29:26 +0100
commita21a5558b1e50c05e0094dda2b76c8e128873366 (patch)
tree87820415b7551298ceb8d020837478ffd8f87e82 /src/platform/nm-netlink.h
parentd7025818123631e893948f389ab2ec428359b238 (diff)
downloadNetworkManager-a21a5558b1e50c05e0094dda2b76c8e128873366.tar.gz
platform: move genl functions to nm-netlink.c
So they can be reused outside of wifi, like for implementing wireguard support.
Diffstat (limited to 'src/platform/nm-netlink.h')
-rw-r--r--src/platform/nm-netlink.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/platform/nm-netlink.h b/src/platform/nm-netlink.h
index f94e6de7ea..64fcbfa4ad 100644
--- a/src/platform/nm-netlink.h
+++ b/src/platform/nm-netlink.h
@@ -53,6 +53,23 @@ _nl_nla_parse_nested (struct nlattr *tb[], int maxtype, struct nlattr *nla,
#define nla_parse_nested(...) _nl_nla_parse_nested(__VA_ARGS__)
/*****************************************************************************
+ * Reimplementations/copied from libnl3/genl
+ *****************************************************************************/
+
+void *genlmsg_put (struct nl_msg *msg, uint32_t port, uint32_t seq, int family,
+ int hdrlen, int flags, uint8_t cmd, uint8_t version);
+void *genlmsg_data (const struct genlmsghdr *gnlh);
+void *genlmsg_user_hdr (const struct genlmsghdr *gnlh);
+struct genlmsghdr *genlmsg_hdr (struct nlmsghdr *nlh);
+void *genlmsg_user_data (const struct genlmsghdr *gnlh, const int hdrlen);
+struct nlattr *genlmsg_attrdata (const struct genlmsghdr *gnlh, int hdrlen);
+int genlmsg_len (const struct genlmsghdr *gnlh);
+int genlmsg_attrlen (const struct genlmsghdr *gnlh, int hdrlen);
+int genlmsg_valid_hdr (struct nlmsghdr *nlh, int hdrlen);
+int genlmsg_parse (struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[],
+ int maxtype, const struct nla_policy *policy);
+
+/*****************************************************************************
* helpers
*****************************************************************************/