]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
posix: Add SockAddrIn6, In6Addr and inet_pton
authorStefano Debenedetti <ste@demaledetti.net>
Tue, 21 Feb 2012 11:30:21 +0000 (12:30 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Tue, 21 Feb 2012 11:30:21 +0000 (12:30 +0100)
Fixes bug 670492.

vapi/posix.vapi

index 4ec7c21e44baaa75b2d5e283fb158d3dcffb791a..28b92d91a2b1b9a287c74a7c83c72533966d355c 100644 (file)
@@ -484,6 +484,8 @@ namespace Posix {
        [CCode (cheader_filename = "arpa/inet.h")]
        unowned string inet_ntop (int af, void* src, uint8[] dst);
        [CCode (cheader_filename = "arpa/inet.h")]
+       public int inet_pton (int af, string src, void* dst);
+       [CCode (cheader_filename = "arpa/inet.h")]
        public uint32 htonl (uint32 hostlong);
        [CCode (cheader_filename = "arpa/inet.h")]
        public uint32 ntohl (uint32 netlong);
@@ -1490,6 +1492,11 @@ namespace Posix {
                public uint32 s_addr;
        }
 
+       [CCode (cname = "struct in6_addr", cheader_filename = "sys/socket.h", destroy_function = "")]
+       public struct In6Addr {
+               public uchar[] s6_addr[16];
+       }
+
        [CCode (cname = "struct sockaddr", cheader_filename = "sys/socket.h", destroy_function = "")]
        public struct SockAddr {
         public int sa_family;
@@ -1504,6 +1511,15 @@ namespace Posix {
                public InAddr sin_addr;
        }
 
+       [CCode (cname = "struct sockaddr_in6", cheader_filename = "netinet/in.h", destroy_function = "")]
+       public struct SockAddrIn6 {
+               public int sin6_family;
+               public uint16 sin6_port;
+               public uint32 sin6_flowinfo;
+               public In6Addr sin6_addr;
+               public uint32 sin6_scope_id;
+       }
+
        [CCode (cheader_filename = "sys/stat.h")]
        public int mkfifo (string filename, mode_t mode);