]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
linux: add struct ifaddrs binding
authorEvan Nemerson <evan@coeus-group.com>
Fri, 23 Sep 2011 01:55:18 +0000 (18:55 -0700)
committerJürg Billeter <j@bitron.ch>
Wed, 30 Nov 2011 13:04:18 +0000 (14:04 +0100)
Fixes bug 659000.

vapi/linux.vapi

index 5300ae1547e4e711477a15c50f39f6dd816c3074..c58c3cfa132ce12b0ab8bfb54d3d2a91e7891e6d 100644 (file)
@@ -1318,6 +1318,23 @@ namespace Linux {
             public uint32 ifa_index;
         }
 
+        [Compact, CCode (cname = "struct ifaddrs", cheader_filename = "sys/types.h,ifaddrs.h", free_function = "freeifaddrs", has_type_id = false)]
+        public class IfAddrs {
+                public unowned IfAddrs? ifa_next;
+                public string ifa_name;
+                public uint ifa_flags;
+                public Posix.SockAddr* ifa_addr;
+                public Posix.SockAddr* ifa_netmask;
+                [CCode (cname = "ifa_ifu.ifu_broadaddr")]
+                public Posix.SockAddr* ifa_ifu_broadaddr;
+                [CCode (cname = "ifa_ifu.ifu_dstaddr")]
+                public Posix.SockAddr* ifa_ifu_dstaddr;
+                public void* ifa_data;
+        }
+
+        [CCode (cname = "getifaddrs")]
+        public static int getifaddrs (out IfAddrs ifap);
+
         [CCode (cprefix = "IFA_", has_type_id = false, cheader_filename = "linux/if_addr.h")]
         enum IfAddrType {
             UNSPEC,