From: Richard Wiedenhöft Date: Wed, 31 Jul 2013 10:26:19 +0000 (+0200) Subject: posix.vapi: Added bindings for getaddrinfo X-Git-Tag: 0.21.2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfa7361681b2a865a43c64c8130498c98766df78;p=thirdparty%2Fvala.git posix.vapi: Added bindings for getaddrinfo Fixes bug 705204. --- diff --git a/vapi/posix.vapi b/vapi/posix.vapi index 13994c0b3..c7256728d 100644 --- a/vapi/posix.vapi +++ b/vapi/posix.vapi @@ -1347,6 +1347,29 @@ namespace Posix { [CCode (cheader_filename = "sys/socket.h")] public const int SHUT_RDWR; + [CCode (cheader_filename = "netdb.h")] + public const int AI_PASSIVE; + [CCode (cheader_filename = "netdb.h")] + public const int AI_CANONNAME; + [CCode (cheader_filename = "netdb.h")] + public const int AI_NUMERICHOST; + [CCode (cheader_filename = "netdb.h")] + public const int AI_V4MAPPED; + [CCode (cheader_filename = "netdb.h")] + public const int AI_ALL; + [CCode (cheader_filename = "netdb.h")] + public const int AI_ADDRCONFIG; + [CCode (cheader_filename = "netdb.h")] + public const int AI_IDN; + [CCode (cheader_filename = "netdb.h")] + public const int AI_CANONIDN; + [CCode (cheader_filename = "netdb.h")] + public const int AI_IDN_ALLOW_UNASSIGNED; + [CCode (cheader_filename = "netdb.h")] + public const int AI_IDN_USE_STD3_ASCII_RULES; + [CCode (cheader_filename = "netdb.h")] + public const int AI_NUMERICSERV; + [CCode (cheader_filename = "sys/socket.h", sentinel = "")] public int accept (int sfd, ... ); [CCode (cheader_filename = "sys/socket.h", sentinel = "")] @@ -1373,6 +1396,12 @@ namespace Posix { public int socket (int domain, int type, int protocol); [CCode (cheader_filename = "sys/socket.h")] public int socketpair (int domain, int type, int protocol, [CCode (array_length = false)] int[] sv); + [CCode (cheader_filename = "netdb.h")] + public int getaddrinfo (string node, string service, AddrInfo hints, out AddrInfo *res); + [CCode (cheader_filename = "netdb.h")] + public void freeaddrinfo (AddrInfo *res); + [CCode (cheader_filename = "netdb.h")] + public unowned string gai_strerror (int errcode); [CCode (cname = "socklen_t", cheader_filename = "sys/socket.h", default_value = "0")] public struct socklen_t : int { @@ -1412,6 +1441,18 @@ namespace Posix { public uint32 sin6_scope_id; } + [CCode (cname = "struct addrinfo", cheader_filename = "netdb.h", destroy_function = "")] + public struct AddrInfo { + public int ai_flags; + public int ai_family; + public int ai_socktype; + public int ai_protocol; + public socklen_t ai_addrlen; + public SockAddr *ai_addr; + public string ai_canonname; + public AddrInfo *ai_next; + } + [CCode (cheader_filename = "sys/stat.h")] public int mkfifo (string filename, mode_t mode);