diff options
Diffstat (limited to 'dev-libs/libnl/files')
-rw-r--r-- | dev-libs/libnl/files/libnl-1.1-flags.patch | 11 | ||||
-rw-r--r-- | dev-libs/libnl/files/libnl-1.1-vlan-header.patch | 80 | ||||
-rw-r--r-- | dev-libs/libnl/files/libnl-1.1.3-offsetof.patch | 12 | ||||
-rw-r--r-- | dev-libs/libnl/files/libnl-3.2.20-cache-api.patch | 9 | ||||
-rw-r--r-- | dev-libs/libnl/files/libnl-3.2.20-rtnl_tc_get_ops.patch | 30 | ||||
-rw-r--r-- | dev-libs/libnl/files/libnl-3.2.23-python.patch | 26 | ||||
-rw-r--r-- | dev-libs/libnl/files/libnl-3.2.23-utils.h | 41 |
7 files changed, 209 insertions, 0 deletions
diff --git a/dev-libs/libnl/files/libnl-1.1-flags.patch b/dev-libs/libnl/files/libnl-1.1-flags.patch new file mode 100644 index 000000000000..dc512c587b9e --- /dev/null +++ b/dev-libs/libnl/files/libnl-1.1-flags.patch @@ -0,0 +1,11 @@ +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -48,7 +48,7 @@ + + $(OUT_SLIB): ../Makefile.opts $(OBJ) + @echo " LD $(OUT_SLIB)"; \ +- $(CC) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc ++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc + @echo " LN $(OUT_SLIB) $(LN1_SLIB)"; \ + rm -f $(LN1_SLIB) ; $(LN) -s $(OUT_SLIB) $(LN1_SLIB) + @echo " LN $(LN1_SLIB) $(LN_SLIB)"; \ diff --git a/dev-libs/libnl/files/libnl-1.1-vlan-header.patch b/dev-libs/libnl/files/libnl-1.1-vlan-header.patch new file mode 100644 index 000000000000..c4c2fc6382de --- /dev/null +++ b/dev-libs/libnl/files/libnl-1.1-vlan-header.patch @@ -0,0 +1,80 @@ +From: Patrick McHardy <kaber@trash.net> +Date: Fri, 18 Jan 2008 16:55:48 +0000 (+0100) +Subject: [LIBNL]: Add if_vlan.h +X-Git-Url: http://git.kernel.org/?p=libs%2Fnetlink%2Flibnl.git;a=commitdiff_plain;h=e91bb2ffb090955d443e643a25b250bf3d33534a;hp=7f6b7a8eea0334b34d58dec72c66121a76f08958 + +[LIBNL]: Add if_vlan.h + +vlan support needs VLAN_FLAG_REORDER_HDR, which is not available in +older if_vlan.h versions. Add the current version from the kernel. + +Signed-off-by: Patrick McHardy <kaber@trash.net> +--- + +diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h +new file mode 100644 +index 0000000..068cd7b +--- /dev/null ++++ include/linux/if_vlan.h +@@ -0,0 +1,61 @@ ++/* ++ * VLAN An implementation of 802.1Q VLAN tagging. ++ * ++ * Authors: Ben Greear <greearb@candelatech.com> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ * ++ */ ++ ++#ifndef _LINUX_IF_VLAN_H_ ++#define _LINUX_IF_VLAN_H_ ++ ++ ++/* VLAN IOCTLs are found in sockios.h */ ++ ++/* Passed in vlan_ioctl_args structure to determine behaviour. */ ++enum vlan_ioctl_cmds { ++ ADD_VLAN_CMD, ++ DEL_VLAN_CMD, ++ SET_VLAN_INGRESS_PRIORITY_CMD, ++ SET_VLAN_EGRESS_PRIORITY_CMD, ++ GET_VLAN_INGRESS_PRIORITY_CMD, ++ GET_VLAN_EGRESS_PRIORITY_CMD, ++ SET_VLAN_NAME_TYPE_CMD, ++ SET_VLAN_FLAG_CMD, ++ GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */ ++ GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */ ++}; ++ ++enum vlan_flags { ++ VLAN_FLAG_REORDER_HDR = 0x1, ++}; ++ ++enum vlan_name_types { ++ VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */ ++ VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */ ++ VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like: vlan5 */ ++ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like: eth0.5 */ ++ VLAN_NAME_TYPE_HIGHEST ++}; ++ ++struct vlan_ioctl_args { ++ int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */ ++ char device1[24]; ++ ++ union { ++ char device2[24]; ++ int VID; ++ unsigned int skb_priority; ++ unsigned int name_type; ++ unsigned int bind_type; ++ unsigned int flag; /* Matches vlan_dev_info flags */ ++ } u; ++ ++ short vlan_qos; ++}; ++ ++#endif /* !(_LINUX_IF_VLAN_H_) */ diff --git a/dev-libs/libnl/files/libnl-1.1.3-offsetof.patch b/dev-libs/libnl/files/libnl-1.1.3-offsetof.patch new file mode 100644 index 000000000000..e370a5e62fc6 --- /dev/null +++ b/dev-libs/libnl/files/libnl-1.1.3-offsetof.patch @@ -0,0 +1,12 @@ +--- a/include/netlink-local.h ++++ b/include/netlink-local.h +@@ -343,7 +343,9 @@ + } + + #define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0])) ++#ifndef offsetof + #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) ++#endif + + #define __init __attribute__ ((constructor)) + #define __exit __attribute__ ((destructor)) diff --git a/dev-libs/libnl/files/libnl-3.2.20-cache-api.patch b/dev-libs/libnl/files/libnl-3.2.20-cache-api.patch new file mode 100644 index 000000000000..ce6e47b7cfa7 --- /dev/null +++ b/dev-libs/libnl/files/libnl-3.2.20-cache-api.patch @@ -0,0 +1,9 @@ +--- a/tests/test-cache-mngr.c ++++ b/tests/test-cache-mngr.c +@@ -1,5 +1,5 @@ + #include <netlink/netlink.h> +-#include <netlink/cache.h> ++#include <netlink/cache-api.h> + #include <netlink/cli/utils.h> + #include <signal.h> + diff --git a/dev-libs/libnl/files/libnl-3.2.20-rtnl_tc_get_ops.patch b/dev-libs/libnl/files/libnl-3.2.20-rtnl_tc_get_ops.patch new file mode 100644 index 000000000000..09b2f0bb8ebb --- /dev/null +++ b/dev-libs/libnl/files/libnl-3.2.20-rtnl_tc_get_ops.patch @@ -0,0 +1,30 @@ +--- a/src/nl-class-add.c ++++ b/src/nl-class-add.c +@@ -14,6 +14,7 @@ + #include <netlink/cli/qdisc.h> + #include <netlink/cli/class.h> + #include <netlink/cli/link.h> ++#include <netlink/route/tc-api.h> /* rtnl_tc_get_ops() */ + + static int quiet = 0; + +--- a/src/nl-cls-add.c ++++ b/src/nl-cls-add.c +@@ -12,6 +12,7 @@ + #include <netlink/cli/tc.h> + #include <netlink/cli/cls.h> + #include <netlink/cli/link.h> ++#include <netlink/route/tc-api.h> /* rtnl_tc_get_ops() */ + + static int quiet = 0; + +--- a/src/nl-qdisc-add.c ++++ b/src/nl-qdisc-add.c +@@ -13,6 +13,7 @@ + #include <netlink/cli/tc.h> + #include <netlink/cli/qdisc.h> + #include <netlink/cli/link.h> ++#include <netlink/route/tc-api.h> /* rtnl_tc_get_ops() */ + + static int quiet = 0; + diff --git a/dev-libs/libnl/files/libnl-3.2.23-python.patch b/dev-libs/libnl/files/libnl-3.2.23-python.patch new file mode 100644 index 000000000000..559376b546c6 --- /dev/null +++ b/dev-libs/libnl/files/libnl-3.2.23-python.patch @@ -0,0 +1,26 @@ +--- a/python/setup.py.in ++++ b/python/setup.py.in +@@ -9,6 +9,7 @@ + sources = ['netlink/capi.i'], + include_dirs = include, + swig_opts = opts, ++ library_dirs=['@top_builddir@/lib/.libs'], + libraries = ['nl-3'], + ) + +@@ -16,6 +17,7 @@ + sources = ['netlink/route/capi.i'], + include_dirs = include, + swig_opts = opts, ++ library_dirs=['@top_builddir@/lib/.libs'], + libraries = ['nl-3', 'nl-route-3'], + ) + +@@ -23,6 +25,7 @@ + sources = ['netlink/genl/capi.i'], + include_dirs = include, + swig_opts = opts, ++ library_dirs=['@top_builddir@/lib/.libs'], + libraries = ['nl-3', 'nl-genl-3'], + ) + diff --git a/dev-libs/libnl/files/libnl-3.2.23-utils.h b/dev-libs/libnl/files/libnl-3.2.23-utils.h new file mode 100644 index 000000000000..7836c3076ff4 --- /dev/null +++ b/dev-libs/libnl/files/libnl-3.2.23-utils.h @@ -0,0 +1,41 @@ +struct list_head { + struct list_head *next; +}; + +#define LIST_HEAD(name) \ + struct list_head name = { &(name) } + +static inline int list_empty(const struct list_head *head) +{ + return head->next == head; +} + +static inline void list_add(struct list_head *new, struct list_head *head) +{ + new->next = head->next; + head->next = new; +} + +static inline void list_del(struct list_head *entry, struct list_head *prev) +{ + prev->next = entry->next; + entry->next = entry; +} + +#define list_for_each_safe(pos, n, head) \ + for (n = (head), pos = (head)->next; pos != (head); \ + n = pos, pos = n->next) + +#undef offsetof +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + +#ifdef DEBUG +#define pynl_dbg(fmt, ...) \ + fprintf(stderr, "%s: " fmt, __func__, __VA_ARGS__) +#else +#define pynl_dbg(fmt, ...) +#endif |