gwenhywfar  4.99.24rc8
inetaddr.h
Go to the documentation of this file.
1 /***************************************************************************
2  $RCSfile$
3  -------------------
4  cvs : $Id$
5  begin : Tue Oct 02 2002
6  copyright : (C) 2002 by Martin Preuss
7  email : martin@libchipcard.de
8 
9  ***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU Lesser General Public *
13  * License as published by the Free Software Foundation; either *
14  * version 2.1 of the License, or (at your option) any later version. *
15  * *
16  * This library is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
19  * Lesser General Public License for more details. *
20  * *
21  * You should have received a copy of the GNU Lesser General Public *
22  * License along with this library; if not, write to the Free Software *
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
24  * MA 02111-1307 USA *
25  * *
26  ***************************************************************************/
27 
33 #ifndef GWEN_INETADDR_H
34 #define GWEN_INETADDR_H
35 
36 
38 #include "gwenhywfar/error.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 
55 
58 #define GWEN_INETADDR_ERROR_TYPE "InetAddr"
59 #define GWEN_INETADDR_ERROR_MEMORY_FULL 1
60 #define GWEN_INETADDR_ERROR_BAD_ADDRESS 2
61 #define GWEN_INETADDR_ERROR_BUFFER_OVERFLOW 3
62 #define GWEN_INETADDR_ERROR_HOST_NOT_FOUND 4
63 #define GWEN_INETADDR_ERROR_NO_ADDRESS 5
64 #define GWEN_INETADDR_ERROR_NO_RECOVERY 6
65 #define GWEN_INETADDR_ERROR_TRY_AGAIN 7
66 #define GWEN_INETADDR_ERROR_UNKNOWN_DNS_ERROR 8
67 #define GWEN_INETADDR_ERROR_BAD_ADDRESS_FAMILY 9
68 #define GWEN_INETADDR_ERROR_UNSUPPORTED 10
69 
75 #define GWEN_INETADDR_CAPS_AF_TCP 0x00000001
76 #define GWEN_INETADDR_CAPS_AF_UNIX 0x00000002
77 
85 typedef enum {
88  /* Unix Domain Socket */
91 
92 
97 typedef struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS;
98 
99 
106 
107 GWENHYWFAR_API GWEN_INETADDRESS *GWEN_InetAddr_new(GWEN_AddressFamily af);
110 
121 
128 GWENHYWFAR_API int GWEN_InetAddr_SetAddress(GWEN_INETADDRESS *ia, const char *addr);
129 
136 GWENHYWFAR_API int GWEN_InetAddr_SetName(GWEN_INETADDRESS *ia, const char *name);
137 
147  char *buffer, unsigned int bsize);
148 
159  char *buffer, unsigned int bsize);
168 
174 
182  int port);
187 #ifdef __cplusplus
188 }
189 #endif
190 
194 #endif /* GWEN_INETADDR_H */
195 
196 
197 
198 
GWENHYWFAR_API void GWEN_InetAddr_free(GWEN_INETADDRESS *ia)
GWENHYWFAR_API GWEN_INETADDRESS * GWEN_InetAddr_new(GWEN_AddressFamily af)
GWENHYWFAR_API GWEN_INETADDRESS * GWEN_InetAddr_dup(const GWEN_INETADDRESS *ia)
GWENHYWFAR_API int GWEN_InetAddr_GetName(const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS
Definition: inetaddr.h:97
GWENHYWFAR_API int GWEN_InetAddr_SetName(GWEN_INETADDRESS *ia, const char *name)
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWEN_AddressFamily
Definition: inetaddr.h:85
GWENHYWFAR_API int GWEN_InetAddr_GetPort(const GWEN_INETADDRESS *ia)
GWENHYWFAR_API int GWEN_InetAddr_SetAddress(GWEN_INETADDRESS *ia, const char *addr)
GWENHYWFAR_API uint32_t GWEN_InetAddr_GetCapabilities(void)
GWENHYWFAR_API int GWEN_InetAddr_GetAddress(const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
GWENHYWFAR_API int GWEN_InetAddr_SetPort(GWEN_INETADDRESS *ia, int port)