[vala] Add libnl-1 bindings
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Add libnl-1 bindings
- Date: Thu, 3 Sep 2009 19:58:14 +0000 (UTC)
commit 0f680a7929e017ebaee83a2f3a6076bf448f0eed
Author: Michael 'Mickey' Lauer <mickey vanille-media de>
Date: Thu Sep 3 21:56:26 2009 +0200
Add libnl-1 bindings
Fixes bug 593769.
vapi/Makefile.am | 1 +
vapi/libnl-1.vapi | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 118 insertions(+), 0 deletions(-)
---
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 65f9a10..3351de0 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -107,6 +107,7 @@ dist_vapi_DATA = \
libgnomeui-2.0.vapi \
libgsf-1.deps \
libgsf-1.vapi \
+ libnl-1.vapi \
libnotify.deps \
libnotify.vapi \
liboobs-1.vapi \
diff --git a/vapi/libnl-1.vapi b/vapi/libnl-1.vapi
new file mode 100644
index 0000000..5e39f62
--- /dev/null
+++ b/vapi/libnl-1.vapi
@@ -0,0 +1,117 @@
+/* libnl-1.vapi
+ *
+ * Copyright (C) 2009 Michael 'Mickey' Lauer <mlauer vanille-media de>
+ *
+ * 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+[CCode (lower_case_cprefix = "nl_", cheader_filename = "netlink/netlink.h")]
+namespace Netlink {
+
+ public delegate void Callback (Object obj, void* data);
+
+ [Compact]
+ [CCode (cprefix = "nl_addr_", cname = "struct nl_addr", free_function = "", cheader_filename = "netlink/addr.h")]
+ public class Address : Object {
+ [CCode (cname = "nl_addr_alloc")]
+ public Address();
+
+ public void put();
+ public int build_add_request (int a, out Message m);
+ public int build_delete_request (int a, out Message m);
+
+ public int set_label (string label);
+ public string get_label ();
+
+ public void set_family (int family);
+ public int get_family ();
+
+ public void set_prefixlen (int len);
+ public int get_prefixlen ();
+
+ public void set_scope (int scope);
+ public int get_scope ();
+
+ public void set_flags (uint flags);
+ public void unset_flags (uint flags);
+ public uint get_flags ();
+
+ public void* get_binary_addr();
+
+ [CCode (cname = "nl_addr2str")]
+ public string to_string (char[] buf);
+
+ }
+
+ [Compact]
+ [CCode (cprefix = "rtnl_addr_", cname = "struct rtnl_addr", free_function = "", cheader_filename = "netlink/route/addr.h")]
+ public class RouteAddress : Address {
+ [CCode (cname = "rtnl_addr_alloc")]
+ public RouteAddress();
+
+ public void set_ifindex (int index );
+ public int get_ifindex ();
+
+ public weak RouteAddress get_local();
+ }
+
+ [Compact]
+ [CCode (cprefix = "nl_cache_", cname = "struct nl_cache", free_function = "nl_cache_free", cheader_filename = "netlink/cache.h")]
+ public class Cache {
+ public static int alloc_name (string name, out Cache c);
+
+ public void @foreach (Callback cb);
+ public void foreach_filter (Object obj, Callback cb);
+ }
+
+ [Compact]
+ [CCode (cprefix = "nl_link_cache_", cname = "struct nl_cache", free_function = "nl_cache_free", cheader_filename = "netlink/cache.h")]
+ public class LinkCache : Cache {
+ [CCode (cname = "rtnl_link_name2i")]
+ public int name2i (string name);
+ }
+
+ [Compact]
+ [CCode (cprefix = "nl_addr_cache", cname = "struct nl_cache", free_function = "nl_cache_free", cheader_filename = "netlink/cache.h")]
+ public class AddrCache : Cache {
+ }
+
+ [Compact]
+ [CCode (cname = "struct nl_msg", free_function = "nl_msg_free", cheader_filename = "netlink/msg.h")]
+ public class Message {
+ }
+
+ [Compact]
+ [CCode (cprefix = "nl_socket_", cname = "struct nl_socket", free_function = "nl_socket_free")]
+ public class Socket {
+ [CCode (cname = "nl_socket_alloc")]
+ public Socket();
+
+ [CCode (cname = "rtnl_link_alloc_cache")]
+ public int link_alloc_cache (out LinkCache c);
+ [CCode (cname = "rtnl_addr_alloc_cache")]
+ public int addr_alloc_cache (out AddrCache c);
+
+ [CCode (cname = "nl_connect")]
+ public int connect (int family);
+ }
+
+ [Compact]
+ [CCode (cname = "struct nl_object", free_function = "nl_object_free", cheader_filename = "netlink/object.h")]
+ public class Object {
+ }
+
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]