This module allows using of internet IP addresses. It is also capable of resolving addresses and hostnames.
| #define GWEN_INETADDR_CAPS_AF_TCP 0x00000001 |
| #define GWEN_INETADDR_CAPS_AF_UNIX 0x00000002 |
| #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 |
| typedef struct GWEN_INETADDRESSSTRUCT GWEN_INETADDRESS |
You shoukd treat this type as opaque. Its members are not part of the API, i.e. they are subject to changes without notice !
| enum GWEN_AddressFamily |
| GWENHYWFAR_API GWEN_INETADDRESS* GWEN_InetAddr_dup | ( | const GWEN_INETADDRESS * | ia | ) |
| GWENHYWFAR_API void GWEN_InetAddr_free | ( | GWEN_INETADDRESS * | ia | ) |
| GWENHYWFAR_API GWEN_ERRORCODE GWEN_InetAddr_GetAddress | ( | const GWEN_INETADDRESS * | ia, | |
| char * | buffer, | |||
| unsigned int | bsize | |||
| ) |
Gets the IP address stored in the INETADDRESS.
| ia | INETADDRESS to use | |
| buffer | pointer to a buffer to receive the address | |
| bsize | size of the buffer in bytes |
| GWENHYWFAR_API GWEN_TYPE_UINT32 GWEN_InetAddr_GetCapabilities | ( | ) |
| GWENHYWFAR_API GWEN_ERRORCODE GWEN_InetAddr_GetName | ( | const GWEN_INETADDRESS * | ia, | |
| char * | buffer, | |||
| unsigned int | bsize | |||
| ) |
Gets the host name stored in the INETADDRESS. If there is none, then the IP address stored in the INETADDRESS will be used to resolve the hostname.
| ia | INETADDRESS to use | |
| buffer | pointer to a buffer to receive the name | |
| bsize | size of the buffer in bytes |
| GWENHYWFAR_API int GWEN_InetAddr_GetPort | ( | const GWEN_INETADDRESS * | ia | ) |
Return the port stored in the INETADDRESS
| ia | INETADDRESS to use |
| GWENHYWFAR_API GWEN_INETADDRESS* GWEN_InetAddr_new | ( | GWEN_AddressFamily | af | ) |
| GWENHYWFAR_API GWEN_ERRORCODE GWEN_InetAddr_SetAddress | ( | GWEN_INETADDRESS * | ia, | |
| const char * | addr | |||
| ) |
Sets the IP address.
| ia | INETADDRESS to manipulate | |
| addr | IP address in 3-dot-notation ("1.2.3.4") |
| GWENHYWFAR_API GWEN_ERRORCODE GWEN_InetAddr_SetName | ( | GWEN_INETADDRESS * | ia, | |
| const char * | name | |||
| ) |
Sets the IP name and resolves its address.
| ia | INETADDRESS to manipulate | |
| name | hostname whose address is to be resolved in 3-dot-notation |
| GWENHYWFAR_API GWEN_ERRORCODE GWEN_InetAddr_SetPort | ( | GWEN_INETADDRESS * | ia, | |
| int | port | |||
| ) |
Set the port in the given INETADDRESS.
| ia | INETADDRESS to manipulate | |
| port | port to set (0-65535) |
1.4.7