ObjFW
Classes | Functions
resolver.h File Reference
#import "OFString.h"
#import "socket.h"

Go to the source code of this file.

Classes

struct  of_resolver_result_t
 A struct representing one result from the resolver. More...
 

Functions

of_resolver_result_t *OF_NULLABLE *OF_NONNULL of_resolve_host (OFString *host, uint16_t port, int protocol)
 Resolves the specified host. More...
 
void of_address_to_string_and_port (struct sockaddr *address, socklen_t addressLength, OFString *__autoreleasing OF_NONNULL *OF_NULLABLE host, uint16_t *OF_NULLABLE port)
 Converts the specified address to a string and port pair. More...
 
void of_resolver_free (of_resolver_result_t *OF_NULLABLE *OF_NONNULL results)
 Frees the results returned by of_resolve_host. More...
 

Function Documentation

void of_address_to_string_and_port ( struct sockaddr *  address,
socklen_t  addressLength,
OFString *__autoreleasing OF_NONNULL *OF_NULLABLE  host,
uint16_t *OF_NULLABLE  port 
)

Converts the specified address to a string and port pair.

Parameters
addressThe address to convert to a string
addressLengthThe length of the address to convert to a string
hostA pointer to an OFString* which should be set to the host of the address or NULL if the host is not needed
portA pointer to an uint16_t which should be set to the port of the address or NULL if the port is not needed
of_resolver_result_t* OF_NULLABLE* OF_NONNULL of_resolve_host ( OFString host,
uint16_t  port,
int  protocol 
)

Resolves the specified host.

Parameters
hostThe host to resolve
portThe port that should be inserted into the resulting address struct
protocolThe protocol that should be inserted into the resulting address struct
Returns
An array of results. The list is terminated by NULL and should be free'd after use.
void of_resolver_free ( of_resolver_result_t *OF_NULLABLE *OF_NONNULL  results)

Frees the results returned by of_resolve_host.

Parameters
resultsThe results returned by of_resolve_host