e122a5aadf76e443a71e5daccc2c07ba73dca5e7
[tpg/acess2.git] / Usermode / Libraries / libpsocket.so_src / getaddrinfo.c
1 /*
2  * Acess2 POSIX Sockets Library
3  * - By John Hodge (thePowersGang)
4  *
5  * getaddrinfo.c
6  * - getaddrinfo/freeaddrinfo/getnameinfo/gai_strerror
7  */
8 #include <netdb.h>
9 #include <netinet/in.h>
10
11 // === CODE ===
12 int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)
13 {
14         static struct addrinfo  info;
15         static struct sockaddr_in       addr;
16
17         addr.sin_family = 4;
18         addr.sin_addr.s_addr = 0x2701A8C0;
19         info.ai_family = 4;
20         info.ai_addr = (struct sockaddr *) &addr;
21
22         return 1;
23 }
24
25 void freeaddrinfo(struct addrinfo *res)
26 {
27         
28 }
29
30 const char *gai_strerror(int errnum)
31 {
32         switch(errnum)
33         {
34         case 0:         return "No error";
35         case 1:         return "Unimplemented";
36         default:        return "UNKNOWN";
37         }
38 }
39

UCC git Repository :: git.ucc.asn.au