Top |
Functions
UhmResolver * | uhm_resolver_new () |
void | uhm_resolver_reset () |
gboolean | uhm_resolver_add_A () |
gboolean | uhm_resolver_add_SRV () |
Description
A mock DNS resolver which resolves according to specified host-name–IP-address pairs, and raises an error for all non-specified host name requests. This allows network connections for expected services to be redirected to a different server, such as a local mock server on a loopback interface.
Functions
uhm_resolver_new ()
UhmResolver *
uhm_resolver_new (void
);
Creates a new UhmResolver with default property values.
uhm_resolver_reset ()
void
uhm_resolver_reset (UhmResolver *self
);
Resets the state of the UhmResolver, deleting all records added with uhm_resolver_add_A()
and uhm_resolver_add_SRV()
.
uhm_resolver_add_A ()
gboolean uhm_resolver_add_A (UhmResolver *self
,const gchar *hostname
,const gchar *addr
);
Adds a resolution mapping from the host name hostname
to the IP address addr
.
Since: 0.1.0
uhm_resolver_add_SRV ()
gboolean uhm_resolver_add_SRV (UhmResolver *self
,const gchar *service
,const gchar *protocol
,const gchar *domain
,const gchar *addr
,guint16 port
);
Adds a resolution mapping the given service
(on protocol
and domain
) to the IP address addr
and given port
.
Parameters
self |
||
service |
the service name to match |
|
protocol |
the protocol name to match |
|
domain |
the domain name to match |
|
addr |
the IP address to resolve to |
|
port |
the port to resolve to |
Since: 0.1.0
Types and Values
UhmResolver
typedef struct _UhmResolver UhmResolver;
All the fields in the UhmResolver structure are private and should never be accessed directly.
Since: 0.1.0
UhmResolverClass
typedef struct { } UhmResolverClass;
All the fields in the UhmResolverClass structure are private and should never be accessed directly.
Since: 0.1.0