Hi

I'm trying to compile fsogsmd and it's dependencies.
My current step is to compile libnl-2.0 (as a dependency for libfsobasics).

So at first, I tried to clone the git repo at
http://git.kernel.org/?p=libs/netlink/libnl.git
But these sources seem to use an obsolete (or too new ?) version of a
structure (the members of 'tc_ratespec' have changed in the past).

Then I figured there was a tarball on freesmartphone.org/sources.


My first question would be: what is the difference between the git and
the tarball ? (I can see SHR is using the current HEAD of it)


Ok so I download it, run ./configure and make.
And I get the following error:

| In file included from netfilter/log.c:22:
| /usr/arm-linux-gnueabi/usr/include/linux/netfilter/nfnetlink_log.h:31:
| error: expected specifier-qualifier-list before 'aligned_be64'
| make[2]: *** [netfilter/log.lo] Error 1
| make[2]: Leaving directory `/tmp/libnl-2.0+fso1/lib'

I spent some time figuring why aligned_be64 wouldn't be defined: is it
defined in linux/types.h, which is included by lib/netfilter/log.c but
linux/types.h is protected by an #ifndef __KERNEL_STRICT_NAMES; and this
define is set by features.h which is included by tons of other headers...
Anyway, I found a quick fix: adding a new header, defining it (and 2
others that were missing too) and including this header in the
incriminating files.

The patch is in libnl.1.diff

yesterday, I had a problem on the linking in lib/ but I can't reproduce
it ...


Second problem:
include/netlink/cli/ is missing, so the compilation fails on src/lib/utils.c
libnl.2.diff contains the content of include/netlink/{cli,route}/ from
the git.


Now it builds ! (I don't know if it's clean, but it builds).


If anyone has a better solution or can make it possible to avoid these
fixes, I would be thankful.

Next steps:
 - make a debian package out of it.
 - compile libfsobasics and others.
 - make several debian packages out of it (separate the support of the
cli for instance), as openembedded does.


Thanks to all the people making FSO :)

David 'Deubeuliou'

--- libnl-2.0+fso1/include/types-fix.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl-2.0+fso1.bak/include/types-fix.h	2010-03-01 17:41:38.000000000 +0100
@@ -0,0 +1,12 @@
+#ifndef _TYPES_FIX_H
+#define _TYPES_FIX_H
+
+/* 
+ * Fixes missing declarations
+ */
+
+#define aligned_u64 __u64 __attribute__((aligned(8)))
+#define aligned_be64 __be64 __attribute__((aligned(8)))
+#define aligned_le64 __le64 __attribute__((aligned(8)))
+
+#endif /* _TYPES_FIX_H */
--- libnl-2.0+fso1/src/nf-log.c	2009-12-31 13:20:13.000000000 +0100
+++ libnl-2.0+fso1.bak/src/nf-log.c	2010-03-01 17:50:28.000000000 +0100
@@ -13,6 +13,7 @@
 
 #include <netlink/cli/utils.h>
 #include <netlink/cli/link.h>
+#include <types-fix.h>
 #include <linux/netfilter/nfnetlink_log.h>
 #include <netlink/netfilter/nfnl.h>
 #include <netlink/netfilter/log.h>
--- libnl-2.0+fso1/lib/netfilter/queue.c	2009-05-31 22:37:02.000000000 +0200
+++ libnl-2.0+fso1.bak/lib/netfilter/queue.c	2010-03-01 17:52:01.000000000 +0100
@@ -17,6 +17,7 @@
  */
 
 #include <sys/types.h>
+#include <types-fix.h>
 #include <linux/netfilter/nfnetlink_queue.h>
 
 #include <netlink-local.h>
--- libnl-2.0+fso1/lib/netfilter/log.c	2009-05-31 22:37:02.000000000 +0200
+++ libnl-2.0+fso1.bak/lib/netfilter/log.c	2010-03-01 17:46:34.000000000 +0100
@@ -19,6 +19,7 @@
  */
 
 #include <sys/types.h>
+#include <types-fix.h>
 #include <linux/netfilter/nfnetlink_log.h>
 
 #include <netlink-local.h>
--- libnl-2.0+fso1/lib/netfilter/log_msg.c	2009-05-31 22:37:02.000000000 +0200
+++ libnl-2.0+fso1.bak/lib/netfilter/log_msg.c	2010-03-01 17:49:29.000000000 +0100
@@ -20,6 +20,7 @@
  */
 
 #include <sys/types.h>
+#include <types-fix.h>
 #include <linux/netfilter/nfnetlink_log.h>
 
 #include <netlink-local.h>
--- libnl-2.0+fso1/lib/netfilter/queue_msg.c	2009-05-31 22:37:02.000000000 +0200
+++ libnl-2.0+fso1.bak/lib/netfilter/queue_msg.c	2010-03-01 17:53:43.000000000 +0100
@@ -17,6 +17,7 @@
  */
 
 #include <sys/types.h>
+#include <types-fix.h>
 #include <linux/netfilter/nfnetlink_queue.h>
 
 #include <netlink-local.h>

diff -Naur libnl-2.0+fso1.new/include/netlink/cli/addr.h libnl/include/netlink/cli/addr.h
--- libnl-2.0+fso1.new/include/netlink/cli/addr.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/addr.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,32 @@
+/*
+ * netlink/cli/addr.h    CLI Address Helpers
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_ADDR_H_
+#define __NETLINK_CLI_ADDR_H_
+
+#include <netlink/route/addr.h>
+
+#define nl_cli_addr_alloc_cache(sk) \
+		nl_cli_alloc_cache((sk), "address", rtnl_addr_alloc_cache)
+
+extern struct rtnl_addr *nl_cli_addr_alloc(void);
+
+extern void nl_cli_addr_parse_family(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_local(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_dev(struct rtnl_addr *, struct nl_cache *,char *);
+extern void nl_cli_addr_parse_label(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_peer(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_scope(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_broadcast(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_preferred(struct rtnl_addr *, char *);
+extern void nl_cli_addr_parse_valid(struct rtnl_addr *, char *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/ct.h libnl/include/netlink/cli/ct.h
--- libnl-2.0+fso1.new/include/netlink/cli/ct.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/ct.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,34 @@
+/*
+ * netlink/cli/ct.h	CLI Conntrack Helper
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_CT_H_
+#define __NETLINK_CLI_CT_H_
+
+#include <netlink/netfilter/ct.h>
+#include <linux/netfilter/nf_conntrack_common.h>
+
+extern struct nfnl_ct *nl_cli_ct_alloc(void);
+extern struct nl_cache *nl_cli_ct_alloc_cache(struct nl_sock *);
+
+extern void nl_cli_ct_parse_family(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_protocol(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_mark(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_timeout(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_id(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_use(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_src(struct nfnl_ct *, int, char *);
+extern void nl_cli_ct_parse_dst(struct nfnl_ct *, int, char *);
+extern void nl_cli_ct_parse_src_port(struct nfnl_ct *, int, char *);
+extern void nl_cli_ct_parse_dst_port(struct nfnl_ct *, int, char *);
+extern void nl_cli_ct_parse_tcp_state(struct nfnl_ct *, char *);
+extern void nl_cli_ct_parse_status(struct nfnl_ct *, char *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/link.h libnl/include/netlink/cli/link.h
--- libnl-2.0+fso1.new/include/netlink/cli/link.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/link.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,30 @@
+/*
+ * netlink/cli/link.h     CLI Link Helpers
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_LINK_H_
+#define __NETLINK_CLI_LINK_H_
+
+#include <netlink/route/link.h>
+#include <netlink/cli/utils.h>
+
+#define nl_cli_link_alloc_cache(sk) \
+		nl_cli_alloc_cache((sk), "link", rtnl_link_alloc_cache)
+
+extern struct rtnl_link *nl_cli_link_alloc(void);
+
+extern void nl_cli_link_parse_family(struct rtnl_link *, char *);
+extern void nl_cli_link_parse_name(struct rtnl_link *, char *);
+extern void nl_cli_link_parse_mtu(struct rtnl_link *, char *);
+extern void nl_cli_link_parse_ifindex(struct rtnl_link *, char *);
+extern void nl_cli_link_parse_txqlen(struct rtnl_link *, char *);
+extern void nl_cli_link_parse_weight(struct rtnl_link *, char *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/neigh.h libnl/include/netlink/cli/neigh.h
--- libnl-2.0+fso1.new/include/netlink/cli/neigh.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/neigh.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,27 @@
+/*
+ * netlink/cli/neighbour.h     CLI Neighbour Helpers
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_NEIGH_H_
+#define __NETLINK_CLI_NEIGH_H_
+
+#include <netlink/route/neighbour.h>
+
+#define nl_cli_neigh_alloc_cache(sk) \
+		nl_cli_alloc_cache((sk), "neighbour", rtnl_neigh_alloc_cache)
+
+extern struct rtnl_neigh *nl_cli_neigh_alloc(void);
+extern void nl_cli_neigh_parse_dst(struct rtnl_neigh *, char *);
+extern void nl_cli_neigh_parse_lladdr(struct rtnl_neigh *, char *);
+extern void nl_cli_neigh_parse_dev(struct rtnl_neigh *, struct nl_cache *, char *);
+extern void nl_cli_neigh_parse_family(struct rtnl_neigh *, char *);
+extern void nl_cli_neigh_parse_state(struct rtnl_neigh *, char *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/qdisc.h libnl/include/netlink/cli/qdisc.h
--- libnl-2.0+fso1.new/include/netlink/cli/qdisc.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/qdisc.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,28 @@
+/*
+ * netlink/cli/qdisc.h     CLI QDisc Helpers
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_QDISC_H_
+#define __NETLINK_CLI_QDISC_H_
+
+#include <netlink/route/qdisc.h>
+
+#define nl_cli_qdisc_alloc_cache(sk) \
+		nl_cli_alloc_cache((sk), "queueing disciplines", \
+				   rtnl_qdisc_alloc_cache)
+
+extern struct rtnl_qdisc *nl_cli_qdisc_alloc(void);
+
+extern void nl_cli_qdisc_parse_dev(struct rtnl_qdisc *, struct nl_cache *, char *);
+extern void nl_cli_qdisc_parse_parent(struct rtnl_qdisc *, char *);
+extern void nl_cli_qdisc_parse_handle(struct rtnl_qdisc *, char *);
+extern void nl_cli_qdisc_parse_kind(struct rtnl_qdisc *, char *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/route.h libnl/include/netlink/cli/route.h
--- libnl-2.0+fso1.new/include/netlink/cli/route.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/route.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,34 @@
+/*
+ * netlink/cli//route.h     CLI Route Helpers
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_ROUTE_H_
+#define __NETLINK_CLI_ROUTE_H_
+
+#include <netlink/route/route.h>
+
+extern struct rtnl_route *nl_cli_route_alloc(void);
+
+extern struct nl_cache *nl_cli_route_alloc_cache(struct nl_sock *, int);
+
+extern void	nl_cli_route_parse_family(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_dst(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_src(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_pref_src(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_metric(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_nexthop(struct rtnl_route *, char *, struct nl_cache *);
+extern void	nl_cli_route_parse_table(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_prio(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_scope(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_protocol(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_type(struct rtnl_route *, char *);
+extern void	nl_cli_route_parse_iif(struct rtnl_route *, char *, struct nl_cache *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/rule.h libnl/include/netlink/cli/rule.h
--- libnl-2.0+fso1.new/include/netlink/cli/rule.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/rule.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,21 @@
+/*
+ * netlink/cli/rule.h     CLI Routing Rule Helpers
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_RULE_H_
+#define __NETLINK_CLI_RULE_H_
+
+#include <netlink/route/rule.h>
+
+extern struct rtnl_rule *nl_cli_rule_alloc(void);
+extern struct nl_cache *nl_cli_rule_alloc_cache(struct nl_sock *);
+extern void nl_cli_rule_parse_family(struct rtnl_rule *, char *);
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/cli/utils.h libnl/include/netlink/cli/utils.h
--- libnl-2.0+fso1.new/include/netlink/cli/utils.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/cli/utils.h	2010-03-02 12:24:49.000000000 +0100
@@ -0,0 +1,80 @@
+/*
+ * src/utils.h		Utilities
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2003-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef __NETLINK_CLI_UTILS_H_
+#define __NETLINK_CLI_UTILS_H_
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <stdint.h>
+#include <ctype.h>
+#include <getopt.h>
+#include <dlfcn.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <netlink/netlink.h>
+#include <netlink/utils.h>
+#include <netlink/addr.h>
+#include <netlink/list.h>
+#include <netlink/route/rtnl.h>
+#include <netlink/route/link.h>
+#include <netlink/route/addr.h>
+#include <netlink/route/neighbour.h>
+#include <netlink/route/neightbl.h>
+#include <netlink/route/route.h>
+#include <netlink/route/rule.h>
+#include <netlink/route/qdisc.h>
+#include <netlink/route/class.h>
+#include <netlink/route/classifier.h>
+#include <netlink/route/cls/ematch.h>
+#include <netlink/fib_lookup/lookup.h>
+#include <netlink/fib_lookup/request.h>
+#include <netlink/genl/genl.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/genl/mngt.h>
+#include <netlink/netfilter/ct.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __init
+#define __init __attribute__((constructor))
+#endif
+
+#ifndef __exit
+#define __exit __attribute__((destructor))
+#endif
+
+extern uint32_t		nl_cli_parse_u32(const char *);
+extern void		nl_cli_print_version(void);
+extern void		nl_cli_fatal(int, const char *, ...);
+extern struct nl_addr *	nl_cli_addr_parse(const char *, int);
+extern int		nl_cli_connect(struct nl_sock *, int);
+extern struct nl_sock *	nl_cli_alloc_socket(void);
+extern int		nl_cli_parse_dumptype(const char *);
+extern int		nl_cli_confirm(struct nl_object *,
+				       struct nl_dump_params *, int);
+
+extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *,
+			     int (*ac)(struct nl_sock *, struct nl_cache **));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/route/cls/basic.h libnl/include/netlink/route/cls/basic.h
--- libnl-2.0+fso1.new/include/netlink/route/cls/basic.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/route/cls/basic.h	2010-03-01 14:12:56.000000000 +0100
@@ -0,0 +1,33 @@
+/*
+ * netlink/route/cls/basic.h	Basic Classifier
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008-2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef NETLINK_BASIC_H_
+#define NETLINK_BASIC_H_
+
+#include <netlink/netlink.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct rtnl_cls_ops *rtnl_basic_get_ops(void);
+extern int	rtnl_basic_set_classid(struct rtnl_cls *, uint32_t);
+extern uint32_t	rtnl_basic_get_classid(struct rtnl_cls *);
+extern int	rtnl_basic_set_ematch(struct rtnl_cls *,
+				      struct rtnl_ematch_tree *);
+extern struct rtnl_ematch_tree *
+		rtnl_basic_get_ematch(struct rtnl_cls *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/route/cls/cgroup.h libnl/include/netlink/route/cls/cgroup.h
--- libnl-2.0+fso1.new/include/netlink/route/cls/cgroup.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/route/cls/cgroup.h	2010-03-01 14:12:56.000000000 +0100
@@ -0,0 +1,31 @@
+/*
+ * netlink/route/cls/cgroup.h	Control Groups Classifier
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2009 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef NETLINK_CLS_CGROUP_H_
+#define NETLINK_CLS_CGROUP_H_
+
+#include <netlink/netlink.h>
+#include <netlink/cache.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int	rtnl_cgroup_set_ematch(struct rtnl_cls *,
+				       struct rtnl_ematch_tree *);
+extern struct rtnl_ematch_tree *
+		rtnl_cgroup_get_ematch(struct rtnl_cls *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/route/cls/ematch/cmp.h libnl/include/netlink/route/cls/ematch/cmp.h
--- libnl-2.0+fso1.new/include/netlink/route/cls/ematch/cmp.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/route/cls/ematch/cmp.h	2010-03-01 14:12:56.000000000 +0100
@@ -0,0 +1,31 @@
+/*
+ * netlink/route/cls/ematch/cmp.h	Simple Comparison
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef NETLINK_CLS_EMATCH_CMP_H_
+#define NETLINK_CLS_EMATCH_CMP_H_
+
+#include <netlink/netlink.h>
+#include <netlink/route/cls/ematch.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void	rtnl_ematch_cmp_set(struct rtnl_ematch *,
+				    struct tcf_em_cmp *);
+extern struct tcf_em_cmp *
+		rtnl_ematch_cmp_get(struct rtnl_ematch *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -Naur libnl-2.0+fso1.new/include/netlink/route/cls/ematch.h libnl/include/netlink/route/cls/ematch.h
--- libnl-2.0+fso1.new/include/netlink/route/cls/ematch.h	1970-01-01 01:00:00.000000000 +0100
+++ libnl/include/netlink/route/cls/ematch.h	2010-03-01 14:12:56.000000000 +0100
@@ -0,0 +1,73 @@
+/*
+ * netlink/route/cls/ematch.h		Extended Matches
+ *
+ *	This library is free software; you can redistribute it and/or
+ *	modify it under the terms of the GNU Lesser General Public
+ *	License as published by the Free Software Foundation version 2.1
+ *	of the License.
+ *
+ * Copyright (c) 2008 Thomas Graf <tg...@suug.ch>
+ */
+
+#ifndef NETLINK_CLS_EMATCH_H_
+#define NETLINK_CLS_EMATCH_H_
+
+#include <netlink/netlink.h>
+#include <netlink/route/classifier.h>
+#include <linux/pkt_cls.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rtnl_ematch;
+struct rtnl_ematch_tree;
+
+struct rtnl_ematch_ops
+{
+	int				eo_kind;
+	const char *			eo_name;
+	size_t				eo_datalen;
+
+	int			      (*eo_parse)(struct rtnl_ematch *,
+						  void *, size_t);
+	void			      (*eo_dump)(struct rtnl_ematch *,
+						 struct nl_dump_params *);
+	struct nl_list_head		eo_list;
+};
+
+extern int	rtnl_ematch_register(struct rtnl_ematch_ops *);
+extern int	rtnl_ematch_unregister(struct rtnl_ematch_ops *);
+
+extern struct rtnl_ematch_ops *
+		rtnl_ematch_lookup_ops(int);
+extern struct rtnl_ematch_ops *
+		rtnl_ematch_lookup_ops_name(const char *);
+
+extern struct rtnl_ematch *
+		rtnl_ematch_alloc(struct rtnl_ematch_ops *);
+extern void	rtnl_ematch_add_child(struct rtnl_ematch *,
+				      struct rtnl_ematch *);
+extern void	rtnl_ematch_unlink(struct rtnl_ematch *);
+extern void	rtnl_ematch_free(struct rtnl_ematch *);
+
+extern void *	rtnl_ematch_data(struct rtnl_ematch *);
+extern void	rtnl_ematch_set_flags(struct rtnl_ematch *, uint16_t);
+extern void	rtnl_ematch_unset_flags(struct rtnl_ematch *, uint16_t);
+extern uint16_t	rtnl_ematch_get_flags(struct rtnl_ematch *);
+
+extern struct rtnl_ematch_tree *
+		rtnl_ematch_tree_alloc(uint16_t);
+extern void	rtnl_ematch_tree_free(struct rtnl_ematch_tree *);
+
+extern int	rtnl_ematch_parse(struct nlattr *, struct rtnl_ematch_tree **);
+extern void	rtnl_ematch_tree_add_tail(struct rtnl_ematch_tree *,
+					  struct rtnl_ematch *);
+extern void	rtnl_ematch_tree_dump(struct rtnl_ematch_tree *,
+				      struct nl_dump_params *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

_______________________________________________
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland

Reply via email to