[vala] posix: Add SockAddrIn6, In6Addr and inet_pton
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] posix: Add SockAddrIn6, In6Addr and inet_pton
- Date: Tue, 21 Feb 2012 11:32:05 +0000 (UTC)
commit d2de11ad0b0678e78fd601ec9baa8045aee73671
Author: Stefano Debenedetti <ste demaledetti net>
Date: Tue Feb 21 12:30:21 2012 +0100
posix: Add SockAddrIn6, In6Addr and inet_pton
Fixes bug 670492.
vapi/posix.vapi | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/vapi/posix.vapi b/vapi/posix.vapi
index 4ec7c21..28b92d9 100644
--- a/vapi/posix.vapi
+++ b/vapi/posix.vapi
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]