Functions
extDns Session: API function to start and handle DNS sessions

Functions

void __ext_dns_session_shutdown_and_record_error (extDnsSession *session, extDnsStatus status, const char *message,...)
 private functions More...
 
EXT_DNS_SOCKET ext_dns_listener_accept (EXT_DNS_SOCKET server_socket)
 Public function that performs a TCP listener accept. More...
 
extDnsSessionext_dns_listener_new (extDnsCtx *ctx, const char *host, const char *port, extDnsSessionType type, extDnsListenerReady on_ready, axlPointer user_data)
 Creates a new extDns Listener accepting incoming sessions on the given host:port configuration and over the given protocol type (extDnsSessionType). More...
 
extDnsSessionext_dns_listener_new2 (extDnsCtx *ctx, const char *host, int port, extDnsSessionType type, extDnsListenerReady on_ready, axlPointer user_data)
 Creates a new extDns Listener accepting incoming sessions on the given host:port configuration, receiving the port configuration as an integer value. More...
 
extDnsSessionext_dns_listener_new_full (extDnsCtx *ctx, const char *host, const char *port, extDnsSessionType type, extDnsListenerReadyFull on_ready_full, axlPointer user_data)
 Creates a new listener, allowing to get the session that represents the listener created with the optional handler (extDnsListenerReadyFull). More...
 
EXT_DNS_SOCKET ext_dns_listener_sock_listen (extDnsCtx *ctx, extDnsSessionType type, const char *host, const char *port, axlError **error)
 Starts a generic TCP listener on the provided address and port. More...
 
axl_bool ext_dns_session_close (extDnsSession *session)
 Closes a session and releases all its resources. More...
 
void ext_dns_session_free (extDnsSession *session)
 Frees extDns session resources. More...
 
extDnsCtxext_dns_session_get_ctx (extDnsSession *session)
 Allows to get the extDnsCtx object from the DNS session provided. More...
 
axlPointer ext_dns_session_get_data (extDnsSession *session, const char *key)
 Allows to get the data associated to the provided key on the provided session. More...
 
const char * ext_dns_session_get_host (extDnsSession *session)
 Returns the actual host this session is sessionected to. More...
 
int ext_dns_session_get_id (extDnsSession *session)
 Returns the session unique identifier. More...
 
const char * ext_dns_session_get_port (extDnsSession *session)
 Returns the actual port this session is connected to. More...
 
extDnsPeerRole ext_dns_session_get_role (extDnsSession *session)
 Allows to get current session role. More...
 
EXT_DNS_SOCKET ext_dns_session_get_socket (extDnsSession *session)
 Returns the socket used by this extDnsSession object. More...
 
axl_bool ext_dns_session_is_ok (extDnsSession *session, axl_bool free_on_fail)
 Allows to check if the session is still working. More...
 
extDnsSessionext_dns_session_new_empty (extDnsCtx *ctx, EXT_DNS_SOCKET socket, extDnsSessionType type, extDnsPeerRole role)
 Allows to create a new extDnsSession from a socket that is already connected. More...
 
axl_bool ext_dns_session_ref (extDnsSession *session, const char *who)
 Increase internal ext_dns session reference counting. More...
 
int ext_dns_session_send_udp (extDnsCtx *ctx, const char *content, int length, const char *address, int port, char **source_address, int *source_port)
 Send the provided message using UDP protocol to the destination. More...
 
int ext_dns_session_send_udp_s (extDnsCtx *ctx, extDnsSession *session, const char *content, int length, const char *address, int port)
 Send the provided message using UDP protocol to the destination. More...
 
void ext_dns_session_set_data (extDnsSession *session, const char *key, axlDestroyFunc key_destroy, axlPointer data, axlDestroyFunc data_destroy)
 Allows to set a key and a value associated to the provided session which can be used later to retrieve those values. More...
 
axl_bool ext_dns_session_set_nonblocking_socket (extDnsSession *session)
 Allows to change session semantic to nonblocking. More...
 
void ext_dns_session_set_on_badrequest (extDnsSession *session, extDnsOnBadRequest on_bad_request, axlPointer data)
 Allows to setup a handler which is called every time a bad request is received. More...
 
void ext_dns_session_set_on_message (extDnsSession *session, extDnsOnMessageReceived on_dns_message, axlPointer data)
 Allows to configure the onMessage handler, the callback that is called every time a new message is received over the provided session. More...
 
axl_bool ext_dns_session_set_sock_block (EXT_DNS_SOCKET socket, axl_bool enable)
 Allows to enable/disable non-blocking/blocking behavior on the provided socket. More...
 
axl_bool ext_dns_session_set_sock_tcp_nodelay (EXT_DNS_SOCKET socket, axl_bool enable)
 Allows to configure tcp no delay flag (enable/disable Nagle algorithm). More...
 
void ext_dns_session_shutdown (extDnsSession *session)
 Allows to close the socket that is supporting the provided session. More...
 
void ext_dns_session_unref (extDnsSession *session, char const *who)
 Decrease ext_dns session reference counting. More...
 

Detailed Description