gwenhywfar  5.11.1beta
inetaddr.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Tue Oct 02 2002
3  copyright : (C) 2002 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU Lesser General Public *
10  * License as published by the Free Software Foundation; either *
11  * version 2.1 of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * Lesser General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Lesser General Public *
19  * License along with this library; if not, write to the Free Software *
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21  * MA 02111-1307 USA *
22  * *
23  ***************************************************************************/
24 
30 #ifndef GWEN_INETADDR_H
31 #define GWEN_INETADDR_H
32 
33 
35 #include "gwenhywfar/error.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 
52 
55 /*@TODO: remove this */
56 #define GWEN_INETADDR_ERROR_TYPE "InetAddr"
57 #define GWEN_INETADDR_ERROR_MEMORY_FULL 1
58 #define GWEN_INETADDR_ERROR_BAD_ADDRESS 2
59 #define GWEN_INETADDR_ERROR_BUFFER_OVERFLOW 3
60 #define GWEN_INETADDR_ERROR_HOST_NOT_FOUND 4
61 #define GWEN_INETADDR_ERROR_NO_ADDRESS 5
62 #define GWEN_INETADDR_ERROR_NO_RECOVERY 6
63 #define GWEN_INETADDR_ERROR_TRY_AGAIN 7
64 #define GWEN_INETADDR_ERROR_UNKNOWN_DNS_ERROR 8
65 #define GWEN_INETADDR_ERROR_BAD_ADDRESS_FAMILY 9
66 #define GWEN_INETADDR_ERROR_UNSUPPORTED 10
73 #define GWEN_INETADDR_CAPS_AF_TCP 0x00000001
74 #define GWEN_INETADDR_CAPS_AF_UNIX 0x00000002
75 
83 typedef enum {
86  /* Unix Domain Socket */
89 
90 
95 typedef struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS;
96 
97 
104 
108 
119 
127 
135 
145  char *buffer, unsigned int bsize);
146 
157  char *buffer, unsigned int bsize);
166 
172 
180  int port);
185 #ifdef __cplusplus
186 }
187 #endif
188 
192 #endif /* GWEN_INETADDR_H */
193 
194 
195 
196 
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
GWENHYWFAR_API uint32_t GWEN_InetAddr_GetCapabilities(void)
GWENHYWFAR_API void GWEN_InetAddr_free(GWEN_INETADDRESS *ia)
GWENHYWFAR_API GWEN_INETADDRESS * GWEN_InetAddr_new(GWEN_AddressFamily af)
struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS
Definition: inetaddr.h:95
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)
GWEN_AddressFamily
Definition: inetaddr.h:83
@ GWEN_AddressFamilyUnix
Definition: inetaddr.h:87
@ GWEN_AddressFamilyIP
Definition: inetaddr.h:85
GWENHYWFAR_API int GWEN_InetAddr_SetAddress(GWEN_INETADDRESS *ia, const char *addr)
GWENHYWFAR_API int GWEN_InetAddr_GetPort(const GWEN_INETADDRESS *ia)
GWENHYWFAR_API int GWEN_InetAddr_GetName(const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
GWENHYWFAR_API GWEN_INETADDRESS * GWEN_InetAddr_dup(const GWEN_INETADDRESS *ia)
GWENHYWFAR_API int GWEN_InetAddr_SetName(GWEN_INETADDRESS *ia, const char *name)