# inetaddr.h File Reference

This file contains the internet address handling module. More...

`#include <gwenhywfar/gwenhywfarapi.h>`
`#include "gwenhywfar/error.h"`

Go to the source code of this file.

## Capabilities of this module

#define | GWEN_INETADDR_CAPS_AF_TCP 0x00000001
#define | GWEN_INETADDR_CAPS_AF_UNIX 0x00000002
GWENHYWFAR_API GWEN_TYPE_UINT32 | GWEN_InetAddr_GetCapabilities ()

## Error Codes

#define | GWEN_INETADDR_ERROR_BAD_ADDRESS 2
#define | GWEN_INETADDR_ERROR_BAD_ADDRESS_FAMILY 9
#define | GWEN_INETADDR_ERROR_BUFFER_OVERFLOW 3
#define | GWEN_INETADDR_ERROR_HOST_NOT_FOUND 4
#define | GWEN_INETADDR_ERROR_MEMORY_FULL 1
#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_TYPE "InetAddr"
#define | GWEN_INETADDR_ERROR_UNKNOWN_DNS_ERROR 8
#define | GWEN_INETADDR_ERROR_UNSUPPORTED 10

## Construction and destruction

These functions allocate and free administrative data about IP addresses.
GWENHYWFAR_API GWEN_INETADDRESS * | GWEN_InetAddr_dup (const GWEN_INETADDRESS *ia)
GWENHYWFAR_API void | GWEN_InetAddr_free (GWEN_INETADDRESS *ia)
GWENHYWFAR_API GWEN_INETADDRESS * | GWEN_InetAddr_new (GWEN_AddressFamily af)

## Get and set address

These functions allow getting and setting of IP addresses either by hostname or host address.
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_InetAddr_GetAddress (const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_InetAddr_GetName (const GWEN_INETADDRESS *ia, char *buffer, unsigned int bsize)
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_InetAddr_SetAddress (GWEN_INETADDRESS *ia, const char *addr)
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_InetAddr_SetName (GWEN_INETADDRESS *ia, const char *name)

## Get and set port

These functions allow getting and setting of the port.
GWENHYWFAR_API int | GWEN_InetAddr_GetPort (const GWEN_INETADDRESS *ia)
GWENHYWFAR_API GWEN_ERRORCODE | GWEN_InetAddr_SetPort (GWEN_INETADDRESS *ia, int port)

## Typedefs

typedef GWEN_INETADDRESSSTRUCT | GWEN_INETADDRESS

## Enumerations

enum | GWEN_AddressFamily { GWEN_AddressFamilyIP = 0, GWEN_AddressFamilyUnix }

## Detailed Description

This file contains the internet address handling module.