Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h
instead of adding these fallback definitions to every file.
* netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG.
* socketutils.c: Include "netlink.h" instead of <linux/netlink.h>,
remove fallback definition of NETLINK_SOCK_DIAG.
#include <sys/socket.h>
#include <linux/netlink.h>
+#ifndef NETLINK_SOCK_DIAG
+# define NETLINK_SOCK_DIAG 4
+#endif
+
#undef NLMSG_HDRLEN
#define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
-#include <linux/netlink.h>
+#include "netlink.h"
#include <linux/sock_diag.h>
#include <linux/inet_diag.h>
#include <linux/unix_diag.h>
# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path)
#endif
-#ifndef NETLINK_SOCK_DIAG
-# define NETLINK_SOCK_DIAG 4
-#endif
-
typedef struct {
unsigned long inode;
char *details;