summaryrefslogtreecommitdiff
path: root/sysdep/linux/netlink-sys.h
diff options
context:
space:
mode:
authorAlexander Chernikov <melifaro@FreeBSD.org>2022-12-16 19:20:05 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2022-12-16 19:21:51 +0100
commit176fc68aed32a5675aa643e3b7c6f65ff9ad13d0 (patch)
tree3113e0d0a2d48bab4aec48134fd89c7db7d9b174 /sysdep/linux/netlink-sys.h
parent7b6c9649775b288653b0d61df6004d79f0d83ccf (diff)
Netlink: move OS-specific headers and defines to sysdep
Minor changes from committer.
Diffstat (limited to 'sysdep/linux/netlink-sys.h')
-rw-r--r--sysdep/linux/netlink-sys.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/sysdep/linux/netlink-sys.h b/sysdep/linux/netlink-sys.h
new file mode 100644
index 00000000..4c99307b
--- /dev/null
+++ b/sysdep/linux/netlink-sys.h
@@ -0,0 +1,63 @@
+/*
+ * BIRD -- Linux Netlink Interface
+ *
+ * (c) 1999--2000 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#ifndef _BIRD_NETLINK_SYS_H_
+#define _BIRD_NETLINK_SYS_H_
+
+#include <asm/types.h>
+#include <linux/if.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#ifdef HAVE_MPLS_KERNEL
+#include <linux/lwtunnel.h>
+#endif
+
+#ifndef MSG_TRUNC /* Hack: Several versions of glibc miss this one :( */
+#define MSG_TRUNC 0x20
+#endif
+
+#ifndef IFA_FLAGS
+#define IFA_FLAGS 8
+#endif
+
+#ifndef IFF_LOWER_UP
+#define IFF_LOWER_UP 0x10000
+#endif
+
+#ifndef RTA_TABLE
+#define RTA_TABLE 15
+#endif
+
+#ifndef RTA_VIA
+#define RTA_VIA 18
+#endif
+
+#ifndef RTA_NEWDST
+#define RTA_NEWDST 19
+#endif
+
+#ifndef RTA_ENCAP_TYPE
+#define RTA_ENCAP_TYPE 21
+#endif
+
+#ifndef RTA_ENCAP
+#define RTA_ENCAP 22
+#endif
+
+#ifndef NETLINK_GET_STRICT_CHK
+#define NETLINK_GET_STRICT_CHK 12
+#endif
+
+static inline int
+netlink_error_to_os(int error)
+{
+ return -error;
+}
+
+#endif