inetaddr.h
Go to the documentation of this file.
/***************************************************************************
begin : Tue Oct 02 2002
copyright : (C) 2002 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWEN_INETADDR_H
#define GWEN_INETADDR_H
#include <gwenhywfar/gwenhywfarapi.h>
#include "gwenhywfar/error.h"
#ifdef __cplusplus
extern "C" {
#endif
/*@TODO: remove this */
#define GWEN_INETADDR_ERROR_TYPE "InetAddr"
#define GWEN_INETADDR_ERROR_MEMORY_FULL 1
#define GWEN_INETADDR_ERROR_BAD_ADDRESS 2
#define GWEN_INETADDR_ERROR_BUFFER_OVERFLOW 3
#define GWEN_INETADDR_ERROR_HOST_NOT_FOUND 4
#define GWEN_INETADDR_ERROR_NO_ADDRESS 5
#define GWEN_INETADDR_ERROR_NO_RECOVERY 6
#define GWEN_INETADDR_ERROR_TRY_AGAIN 7
#define GWEN_INETADDR_ERROR_UNKNOWN_DNS_ERROR 8
#define GWEN_INETADDR_ERROR_BAD_ADDRESS_FAMILY 9
#define GWEN_INETADDR_ERROR_UNSUPPORTED 10
#define GWEN_INETADDR_CAPS_AF_TCP 0x00000001
#define GWEN_INETADDR_CAPS_AF_UNIX 0x00000002
GWENHYWFAR_API uint32_t GWEN_InetAddr_GetCapabilities(void);
typedef enum {
GWEN_AddressFamilyIP=0,
/* Unix Domain Socket */
GWEN_AddressFamilyUnix
} GWEN_AddressFamily;
typedef struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS;
GWENHYWFAR_API GWEN_INETADDRESS *GWEN_InetAddr_new(GWEN_AddressFamily af);
GWENHYWFAR_API void GWEN_InetAddr_free(GWEN_INETADDRESS *ia);
GWENHYWFAR_API GWEN_INETADDRESS *GWEN_InetAddr_dup(const GWEN_INETADDRESS *ia);
GWENHYWFAR_API int GWEN_InetAddr_SetAddress(GWEN_INETADDRESS *ia, const char *addr);
GWENHYWFAR_API int GWEN_InetAddr_SetName(GWEN_INETADDRESS *ia, const char *name);
GWENHYWFAR_API
int GWEN_InetAddr_GetAddress(const GWEN_INETADDRESS *ia,
char *buffer, unsigned int bsize);
GWENHYWFAR_API
int GWEN_InetAddr_GetName(const GWEN_INETADDRESS *ia,
char *buffer, unsigned int bsize);
GWENHYWFAR_API int GWEN_InetAddr_GetPort(const GWEN_INETADDRESS *ia);
GWENHYWFAR_API int GWEN_InetAddr_SetPort(GWEN_INETADDRESS *ia,
int port);
#ifdef __cplusplus
}
#endif
#endif /* GWEN_INETADDR_H */
error.h
gwenhywfarapi.h
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_InetAddr_GetCapabilities
GWENHYWFAR_API uint32_t GWEN_InetAddr_GetCapabilities(void)
GWEN_InetAddr_free
GWENHYWFAR_API void GWEN_InetAddr_free(GWEN_INETADDRESS *ia)
GWEN_INETADDRESS
struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS
Definition inetaddr.h:95
GWEN_InetAddr_GetAddress
GWENHYWFAR_API int GWEN_InetAddr_GetAddress(const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
GWEN_InetAddr_dup
GWENHYWFAR_API GWEN_INETADDRESS * GWEN_InetAddr_dup(const GWEN_INETADDRESS *ia)
GWEN_InetAddr_SetPort
GWENHYWFAR_API int GWEN_InetAddr_SetPort(GWEN_INETADDRESS *ia, int port)
GWEN_InetAddr_new
GWENHYWFAR_API GWEN_INETADDRESS * GWEN_InetAddr_new(GWEN_AddressFamily af)
GWEN_AddressFamily
GWEN_AddressFamily
Definition inetaddr.h:83
GWEN_AddressFamilyUnix
@ GWEN_AddressFamilyUnix
Definition inetaddr.h:87
GWEN_AddressFamilyIP
@ GWEN_AddressFamilyIP
Definition inetaddr.h:85
GWEN_InetAddr_SetAddress
GWENHYWFAR_API int GWEN_InetAddr_SetAddress(GWEN_INETADDRESS *ia, const char *addr)
GWEN_InetAddr_GetPort
GWENHYWFAR_API int GWEN_InetAddr_GetPort(const GWEN_INETADDRESS *ia)
GWEN_InetAddr_GetName
GWENHYWFAR_API int GWEN_InetAddr_GetName(const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
GWEN_InetAddr_SetName
GWENHYWFAR_API int GWEN_InetAddr_SetName(GWEN_INETADDRESS *ia, const char *name)